All-in-one-robot
All-in-one-robot is a smart robot which can be controlled in four modes:
1. Mobile Controlled Mode.
2. Voice Controlled Mode.
3. Obstacle Avoiding Mode.
4. Line Following Mode.
It is created by Dipin Adhikari a Student from Nepal who has a keen interest on Robots and Artificial Intelligence.
Supplies
1. Arduino Uno.
2. Motor Driver Shield.
3. Four DC Gear Motors with Wheels.
4. HC-05 Bluetooth Module.
5. Ultrasonic Sensor.
6. Four Infrared Sensor.
7. Servo Motor.
8. Two Li-ion Batteries.
Step 1: Assembling Things Together
I have buy a 4wd robot chassis from market which is very common. All the things like motors, wheels and screws to assemble it comes along with it which makes our work easier. First of all we need to solder our motors with wires using a soldering iron. After soldering it we need to screw it with our chassis. After screwing motors, we need to fix the wheels with our DC motors. After doing this much work our robot comes in it shape.
Now we need to assemble Arduino and Motor Driver Shield. We can mount Motor Driver Shield with Arduino easily by just inserting the Male Burg Strip of Motor Driver Shield with Female Burg Strip of Arduino. While inserting it apply pressure from each directions equally otherwise it can get stuck and it can be a nightmare.
Now we need to setup Servo Motor, Infrared Sensors, Ultrasonic Sensor and Li-ion Batteries. First of all we need to glue Servo Motor at front aligned center of the robot and glue a wooden or metal piece with the horn of Servo Motor so that we can mount the Ultrasonic Sensor with Servo Motor. We also need to glue the wooden or metal piece to Ultrasonic Sensor. After that we need to glue our three Infrared Sensors at front aligned justify i.e. first one at left, second one at middle and third one at right. Now we need to glue our last Infrared Sensor at backside aligned center of robot.
Now at last we need to assemble our two Li-ion Batteries. I don't have a Li-ion Battery Holder so I decided to make it. First I take a PVC pipe, cut it and heat it. As PVC stands for PolyVinylCholride and is a thermoplastic i.e. it is softened on heating. After heating it I put it into a flat surface and flattened it by pressing a flat surface. Then I cut into a shape measurement of 8m x 4.5m and two shapes of 2.3m x 4.5m. Then I take a Tin piece instead of spring, glued and connect it with wires. In this way I make my own Battery Holder but if you have you can skip this step and glued it with our chassis.
Step 2: Wiring
We can see the diagram above and connect everything easily.
First of all we need to connect the wires of Motors to Motor Driver Shield. We can see that the wires are connected to the screw terminals. If you connect wires at different place the respective motor starts rotating in different directions than others and you can simply fix with changing the wires.
Now we need to connect servo motor. The Vcc, Gnd and Signal pin of Servo motor is connected with the 5 Volt, Gnd and Digital pin 9 of the Arduino.
Likewise the trig and echo pin of Ultrasonic Sensor is connected with the Analog pin 0 and Analog pin 1 respectively. The signal pins of IR Sensors are connected respectively at Analog pin 2, 3, 4, 5.
For the Bluetooth, the RX pin of Bluetooth is connected with the TX pin of Arduino and vice versa.
For powering the whole circuit the battery is connected with the Motor Driver Shield.
Step 3: Taking About Modes
- Mobile Controlled Mode.
•In this mode, we need to provide commands from my Robot app which is designed by me. The UI of the app is user-friendly. To move the robot forward we need to click the forward arrow button and by pressing the respective arrow buttons, the robot moves. This robot is sophisticated than others as it can sense distance from front and back both by the help of ultrasonic and ir sensor. So what is the advantage point of using this sensors? The answer is simple it can act to the environment as it can avoid the obstacles while moving in all directions. When we give command to robot to turn left, robot first see whether something is present in left or not i.e. to avoid obstacles and if nothing is present only the robot turns left otherwise it will remain in its position and in right also there is same process. This point can be easily understand by demo(practical video).
- Voice Controlled Mode.
By the name Voice Controlled Mode, the first thing comes in our mind is the complex ML algorithms. But here the concept is actually simple. I have used Voice Recognition API of google so I didn’t need to train the model for Voice Recognition. For controlling the robot in this mode, we need to just press the Voice Controlled Mode. And after that we need to click the mic button and speak what we want and the robot will act according to its algorithm(code). And all the features of Bluetooth Controlled Mode are also in this mode. This point can be easily understand by demo(practical video).
- Obstacle Avoiding Mode.
In this mode, the robot moves by itself without getting command from the app. To activate this mode we need to click the Object Avoiding Mode button. And our robot moves completely by itself without colliding the obstacles. For this mode robot takes data(distance) from the ultrasonic and ir sensor. When the “A” command is given to the robot, the robot starts to move in a straight path until any obstacle is in the path. When any obstacle is felt by the robot through ultrasonic sensor, then the robot turns ultrasonic sensor on both left and right direction and calculate the distance of both left and right part. After calculating the distance, it save the values in variables and which distance is greater, it turns toward it. So it uses servo motor for moving the ultrasonic sensor left to right so that it can take distance of left and right part. This point can be easily understand by demo(practical video).
- Line Following Mode.
In this mode also, the robot moves by itself without getting command from the app. To activate this mode we need to click the Line Following Mode button. And our robot moves completely by itself following line. In this mode robot sense the line by three ir sensor located at front. When “C” command is given to the robot, it activate the 3 IR sensors and this sensors continuously transmits IR rays. We know reflection of light is lesser in darker objects as they absorbs the light. So when robot is align in its path, the middle IR sensor receives less IR rays. And by that resistance is maximum and it recognizes the line. This point can be easily understand by demo(practical video).
Step 4: Coding
You can download code from here. Actually code is simple. You need to download libraries like Afmotor and ping.
I have made my robot app myself by using MIT App Inventor. You can download it from here.
http://bit.ly/robotappbydipin