This project is to build an obstacle avoiding robot, using Arduino uno and sensors. The final robot car that I made sensed objects with IR sensor and turned around based on the logic of the code.
I was curious how self driving cars worked so I made an obstacle avoidance robot, and during that process learned that IR sensors work with the reflection of light.
Step 1: Building. First I got 4 wooden sticks with holes, on the last hole we attached a motor and the motor is connected to a wheel. After we got a circular wooden disk and put it on top of the four sticks in such a way that we can attach a castor wheel in front and for the sensor to stick out. When that’s done we can connect the battery pack, it holds 4 AA battery’s. Here are the things you will need to make this robot: one mother board( Arduino Uno), one motor shield, 4 wooden sticks, 1 wooden disc, jumper cables( male——male male——female), 2 ir sensors, 2 motor , 2 wheels, 4 AA battery’s, battery pack
Step 2 : Connecting the Motors. The Arduino Uno is a mother board but it only has one input whereas we need to connect 2 motors to an Arduino Uno, so we attached a motor-shield which has one input/output pin for each motor. So I attached the right motor to M3 on the motor shield and the left motor to M4 as shown in the picture
Step 3 : Connecting sensors. The sensors have 3 pins, Out Gnd Vcc. The Out is connected to the A0 input in the motor shield and the Vcc is connected to the +5V and the Gnd is connected to the Gnd, as shown in the picture.
Step 4 : Connecting battery. The last connection to make is the battery’s. Battery’s have red and black wires, the red wire is connected to M+ and the black one to Gnd as shown in the picture.
Step 5: Logic. In the 1 picture: the left sensor detects the object, then the left sensor should send a message to the right motor to go backwards and the left to go forward therefore avoiding the obstacle. In the 2 picture: the right sensor detects the object, then the right sensor should send a message to the left sensor to go backwards and the right sensor to go forward. In picture 3: none detects the object, then the right&left sensor send a signal to the right&left motors to go forward. In picture 4: both sensors detect the line so they send a message to the motors to stop.
Step 6: the code. Now comes the last step, the code you can copy the code i used or make your own!!!
I found out that through coding you can manipulate objects like motors, sensors etc. I also learnt that IR sensors detects light reflected from the objects.
After I made the project using IR sensor, I found out that self driven cars use ultrasonic sensors, which are better than IR sensors because the ultra sonic sensor makes a map of things around it whereas IR sensor detects the objects only infront.
I can extend the project by attaching a little vacuum/mop in front to use it as a floor cleaner. I can also extend the project by putting a color detection sensor to follow a line, that way the robot will be a line following - obstacle avoiding robot. The next step will be to make the chassis of the robot car.
"I wanted to say thank you to my mom dad. My mom helped me with logical part and my dad helped me with the car base (glue-gunned) and soldering of wires.
I would also like to thank the website https://www.instructables.com/Line-Follower-Robot-Using-Arduino-2 because it is were i got a lot of ideas."
I loved watching your robot navigate the dark and light floor tiles. Very cool! I also love your idea to put a mop on the back and have it clean your floors! I wonder what other types of sensors you could attach and have your robot perform other functions for you. Great job!