Introduction
"MAXBOT" is a low cost Robotic Kit using MAX32630FTHR board has the main Controller Core and is mainly designed to initiate development of Low cost Robotic kit as alternate option to costlier Kits like LEGO Mindstorms NXT & EV3 to ensure avoiding cost as a barrier for learning Robotics.
“MAXBOT” will feature interfaces to DC motor, Servo , light sensors, Ultrasonic sensor , Bluetooth connectivity and some additional ports that can be used to interface servo’s/Digital/Analog sensors as per user requirement.
Integrated Peripherals of MAX32630FTHR board like Dual-Mode Bluetooth Module and 6-Axis Accelerometer/Gyro was planned to develop a complete Robotic kit for learning
The main advantage of MAXBOT is, programming part of the robot is ensured to be easy and fun by developing a user friendly library ,which the user can import and straight away go ahead with designing and programming robots as per their creativity, without digging deep into the hardware and software.
Has of now Maxbot library is implemented with functionality for Robot Navigation and light sensor, with which user can design a simple to complex(PID) line following robots.
The library will be updated in future with more functionalities to work with other Sensors,Servos,Dual-Mode Bluetooth Module,6-Axis Accelerometer/Gyro etc in future.
BOM
MAX32630FTHR board 1 NoS
l239D Hbridge 1 Nos
DC Motors 2 Nos
10K Resistor 2 Nos
1K Resistor 2 Nos
IR transmitter Receiver Pair 2 Nos
2000mAh Power Bank - 1 Nos
REES52 KG113 Servo Motor-1 Nos
General Purpose PCB-1 Nos
RMC Connectors(3 Pin,4 Pin & 2 PIN) - 7 Nos
Male and Female Berg Stick -1 Nos
Ultrasonic Sensor(HC-SR-04)- 1 Nos
Schematics
Instructions
Developing Maxbot was really fun and challenging , with the new MAX32630FTHR hardware in hand the startup guide really created a confidence of ease working with the board.
The initial development phase involved writing test codes to check interfaces of Maxbot like DC Motor control using H bridge IC and Light sensors.
Even though had some initial problem ,the support from the mbed developers forum was amazing, it may be a error in code or startup guide for customized library development for Maxbot, the support from mbed team was really excellent.
Finally the test code was modified has a user friendly library and found working as per expections.
Maxbot library requires improvements and updation to explore all feature of it, believe the phase has started with this submission
and will be improved with further support and encouragement from the community.
Below are some images of the developed hardware.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
View attachment 128801
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Video
Source Code
Maxbot library
Maxbot.cpp file
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Maxbot.h File
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Example program demonstrating various robot navigations possible by Maxbot with simple in build functions
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Example program demonstrating line following robot using Maxbot with simple in build functions
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CAD Files
Attach or link to any CAD files if relevant to your project.
"MAXBOT" is a low cost Robotic Kit using MAX32630FTHR board has the main Controller Core and is mainly designed to initiate development of Low cost Robotic kit as alternate option to costlier Kits like LEGO Mindstorms NXT & EV3 to ensure avoiding cost as a barrier for learning Robotics.
“MAXBOT” will feature interfaces to DC motor, Servo , light sensors, Ultrasonic sensor , Bluetooth connectivity and some additional ports that can be used to interface servo’s/Digital/Analog sensors as per user requirement.
Integrated Peripherals of MAX32630FTHR board like Dual-Mode Bluetooth Module and 6-Axis Accelerometer/Gyro was planned to develop a complete Robotic kit for learning
The main advantage of MAXBOT is, programming part of the robot is ensured to be easy and fun by developing a user friendly library ,which the user can import and straight away go ahead with designing and programming robots as per their creativity, without digging deep into the hardware and software.
Has of now Maxbot library is implemented with functionality for Robot Navigation and light sensor, with which user can design a simple to complex(PID) line following robots.
The library will be updated in future with more functionalities to work with other Sensors,Servos,Dual-Mode Bluetooth Module,6-Axis Accelerometer/Gyro etc in future.
BOM
MAX32630FTHR board 1 NoS
l239D Hbridge 1 Nos
DC Motors 2 Nos
10K Resistor 2 Nos
1K Resistor 2 Nos
IR transmitter Receiver Pair 2 Nos
2000mAh Power Bank - 1 Nos
REES52 KG113 Servo Motor-1 Nos
General Purpose PCB-1 Nos
RMC Connectors(3 Pin,4 Pin & 2 PIN) - 7 Nos
Male and Female Berg Stick -1 Nos
Ultrasonic Sensor(HC-SR-04)- 1 Nos
Schematics
Instructions
Developing Maxbot was really fun and challenging , with the new MAX32630FTHR hardware in hand the startup guide really created a confidence of ease working with the board.
The initial development phase involved writing test codes to check interfaces of Maxbot like DC Motor control using H bridge IC and Light sensors.
Even though had some initial problem ,the support from the mbed developers forum was amazing, it may be a error in code or startup guide for customized library development for Maxbot, the support from mbed team was really excellent.
Finally the test code was modified has a user friendly library and found working as per expections.
Maxbot library requires improvements and updation to explore all feature of it, believe the phase has started with this submission
and will be improved with further support and encouragement from the community.
Below are some images of the developed hardware.
Image may be NSFW.
Clik here to view.

Clik here to view.

Clik here to view.

Clik here to view.

Clik here to view.

Image may be NSFW.
Clik here to view.

Clik here to view.

Clik here to view.

Clik here to view.

Video
Source Code
Maxbot library
Maxbot.cpp file
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Code (Text):
- #include "Maxbot.h"
- #include "mbed.h"
- #include "max32630fthr.h"
- MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
- DigitalOut M1A(P5_0);
- DigitalOut M1B(P5_1);
- DigitalOut M2A(P5_6);
- DigitalOut M2B(P5_5);
- PwmOut Enable(P4_0);
- AnalogIn LIGHTSENA(AIN_4);
- AnalogIn LIGHTSENB(AIN_5);
- float sensoravalue;
- float sensorbvalue;
- float PWMPERIOD=0.1;
- void move(int direction,float speed,float time)/*Function for Robot Navigation*/
- {
- speed = speedmap(speed, 10, 100, 0.05, 0.1);
- if(direction==FORWARD)
- forward(speed,time);
- else if(direction==BACKWARD)
- backward(speed,time);
- else if(direction==LEFTTURN)
- leftTurn(speed,time);
- else if(direction==POINTLEFTTURN)
- pointleftTurn(speed,time);
- else if(direction==RIGHTTURN)
- rightTurn(speed,time);
- else if(direction==POINTRIGHTTURN)
- pointrightTurn(speed,time);
- }
- void forward(float speed,float time)/*Function definition to move forward*/
- {
- M1A = 1;
- M1B = 0;
- M2A = 1;
- M2B = 0;
- Enable.period(PWMPERIOD);
- Enable.pulsewidth(speed);
- wait(time);
- void stop();
- }
- void backward(float speed,float time)/*Function definition to move backward*/
- {
- M1A = 0;
- M1B = 1;
- M2A = 0;
- M2B = 1;
- Enable.period(PWMPERIOD);
- Enable.pulsewidth(speed);
- wait(time);
- void stop();
- }
- void leftTurn(float speed,float time)/*Function definition to move leftTurn*/
- {
- M1A = 0;
- M1B = 1;
- M2A = 1;
- M2B = 0;
- Enable.period(PWMPERIOD);
- Enable.pulsewidth(speed);
- wait(time);
- void stop();
- }
- void pointleftTurn(float speed,float time)/*Function definition to move pointleftTurn*/
- {
- M1A = 0;
- M1B = 0;
- M2A = 1;
- M2B = 0;
- Enable.period(PWMPERIOD);
- Enable.pulsewidth(speed);
- wait(time);
- void stop();
- }
- void rightTurn(float speed,float time)/*Function definition to move rightTurn*/
- {
- M1A = 1;
- M1B = 0;
- M2A = 0;
- M2B = 1;
- Enable.period(PWMPERIOD);
- Enable.pulsewidth(speed);
- wait(time);
- void stop();
- }
- void pointrightTurn(float speed,float time)/*Function definition to move pointrightTurn*/
- {
- M1A = 1;
- M1B = 0;
- M2A = 0;
- M2B = 0;
- Enable.period(PWMPERIOD);
- Enable.pulsewidth(speed);
- wait(time);
- void stop();
- }
- void stop()/*Function definition to stop*/
- {
- M1A = 0;
- M1B = 0;
- M2A = 0;
- M2B = 0;
- Enable.period(PWMPERIOD);
- Enable.pulsewidth(0.00f);
- }
- float speedmap(float in, float inMin, float inMax, float outMin, float outMax)
- {
- // check it's within the range
- if (inMin<inMax) {
- if (in <= inMin)
- return outMin;
- if (in >= inMax)
- return outMax;
- } else { // cope with input range being backwards.
- if (in >= inMin)
- return outMin;
- if (in <= inMax)
- return outMax;
- }
- // calculate how far into the range we are
- float scale = (in-inMin)/(inMax-inMin);
- // calculate the output.
- return outMin + scale*(outMax-outMin);
- }
- float lightSensoranalog(int port) /*function definition for light sensor*/
- {
- if(port==PORTA)
- {
- float analogvaluea=analogmap(LIGHTSENA.read(),0.0,1.0,0,100);
- return analogvaluea;
- }
- if(port==PORTB)
- {
- float analogvalueb=analogmap(LIGHTSENB.read(),0.0,1.0,0,100);
- return analogvalueb;
- }
- }
- int lightSensordigital(int port,float value,int condition) /*function definition for light sensor*/
- {
- if(port==PORTA)
- {
- float analogvaluea=analogmap(LIGHTSENA.read(),0.0,1.0,0,100);
- if(condition==GREATER)
- {
- printf("light sensor value digital:%f \n",analogvaluea);
- if(value>analogvaluea)
- return 1;
- else
- return 0;
- }
- else if(condition==LESSER)
- {
- printf("light sensor value digital:%f \n",analogvaluea);
- if(value<analogvaluea)
- return 1;
- else
- return 0;
- }}
- else if(port==PORTB)
- {
- float analogvalueb=analogmap(LIGHTSENB.read(),0.0,1.0,0,100);
- if(condition==GREATER)
- {
- printf("light sensor value digital:%f \n",analogvalueb);
- if(value>analogvalueb)
- return 1;
- else
- return 0;
- }
- else if(condition==LESSER)
- {
- printf("light sensor value digital:%f \n",analogvalueb);
- if(value<analogvalueb)
- return 1;
- else
- return 0;
- }}}
- float analogmap(float in, float inMin, float inMax, float outMin, float outMax)
- {
- // check it's within the range
- if (inMin<inMax) {
- if (in <= inMin)
- return outMin;
- if (in >= inMax)
- return outMax;
- } else { // cope with input range being backwards.
- if (in >= inMin)
- return outMin;
- if (in <= inMax)
- return outMax;
- }
- // calculate how far into the range we are
- float scale = (in-inMin)/(inMax-inMin);
- // calculate the output.
- return outMin + scale*(outMax-outMin);
- }
Maxbot.h File
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Code (Text):
- #ifndef Maxbot_h
- #define Maxbot_h
- #include "mbed.h"
- #include "max32630fthr.h"
- #define FORWARD 0x1
- #define BACKWARD 0x2
- #define LEFTTURN 0x3
- #define POINTLEFTTURN 0x4
- #define RIGHTTURN 0x5
- #define POINTRIGHTTURN 0x6
- #define PORTA 0x7
- #define PORTB 0x8
- #define GREATER 0x9
- #define LESSER 0x0A
- void move(int,float,float);
- void forward(float,float);
- void backward(float,float);
- void leftTurn(float,float);
- void pointleftTurn(float,float);
- void rightTurn(float,float);
- void pointrightTurn(float,float);
- float speedmap(float,float,float,float,float);
- void stop();
- int lightSensordigital(int,float,int);
- float lightSensoranalog(int);
- float analogmap(float,float,float,float,float);
- #endif
Example program demonstrating various robot navigations possible by Maxbot with simple in build functions
Code (Text):
- #include "Maxbot.h"
- void main()
- {
- move(FORWARD,100,2); //move(direction,speed(0-100),time(sec))
- wait(1);
- move(RIGHTTURN,20,3);
- wait(1);
- move(LEFTTURN,60,4);
- wait(1);
- move(BACKWARDWARD,90,2);
- wait(1);
- move(POINTRIGHTTURN,60,2);
- wait(1);
- move(POINTLEFTTURN,70,1);
- wait(1);
- stop();
- }
Example program demonstrating line following robot using Maxbot with simple in build functions
Code (Text):
- #include "Maxbot.h"
- void main()
- {
- while(true)
- {
- int val1=lightSensordigital(PORTA,30,GREATER); //Read's sensor value from Light Sensor connected to PortA
- int val2=lightSensordigital(PORTB,30,GREATER); //Read's sensor value from Light Sensor connected to PortB
- printf("READNG:%f \n",val1);
- printf("READNG:%f \n",val2);
- if(val1==1&&val2==1)//Moves Forward when both light sensors are on white area
- move(FORWARD,50,.05);
- else if(val1==0&&val2==1)//Moves towards Left when Right Light sensors is on black area
- move(POINTLEFTTURN,40,.05);
- else if(val1==1&&val2==0)//Moves towards Right when Left Light sensors is on black area
- move(POINTRIGHTTURN,40,.05);
- else if(val1==0&&val2==0)//Moves Forward when both light sensors are on Black area
- move(FORWARD,50,.05);
- wait(0.1);
- }
- }
CAD Files
Attach or link to any CAD files if relevant to your project.