Obstacle Detecting Robot

Obstacle Detecting Robot using Arduino Uno


Components Required:

  1. Arduino Uno
  2. Robot Chassis
  3. DC geared motors X2
  4. Dummy motors X2
  5. Wheels 
  6. Battery 12V
  7. Crocodile clips
  8. Ultrasonic sensor HC-sr04
  9. M-M, F-F, F-M connectors
  10. L clamps
  11. Screws
  12. Connector plug
  13. L293D motor driver module
  14. Ultrasonic sensor frame

Working:
This robot works on the same principle which helps bats for their navigation in atmosphere. The ultrasonic sensor continuously emits ultrasonic sound from the trigger side of the sensor. This ultrasonic sound, whenever gets reflected by the obstacle in the path, the echo pin takes the input and passes commands to Arduino to perform a specific function. This is done by writing a code to Arduino using the basic formulae of distance. These formulae help the Arduino to accurately calculate the distance of the obstacle and thus the robot then be able to take specific actions.

Construction:
Before starting off with the construction part, you’ve to be very sure about the code which you are going to upload into the Arduino.
  • For this purpose, take an Arduino Uno board and then connect it to your computer. Now open the Arduino IDE on your computer and check for the port to which the Arduino is attached. 
  • Select the port and then start writing the code in the editor which is visible to you on the screen.
  • After writing the code, click on the tick which is shown at the upper left of the monitor. This is nothing but a run button.
  • After compiling the program, check whether there are any errors in code that you’ve written. If there are no errors in code, then upload the code into Arduino.
  • Fix the L clamps to the chassis of the robot using screws and attach motors to the robot using the nut.
  • At the front end of the robot, fix the dummy motors and attach wheels to the 4 shafts viz, 2 shafts of dummy motors and 2 shafts of the DC motors.
  • Now take the Arduino Uno and fix it to the chassis of the robot as per your convenience. After mounting it on to the chassis, attach a motor driver to the body of the robot.
  • At the front end of the robot, place an Ultrasonic sensor HC-sr04 by means of a sensor frame.

Now you’ve completed the mechanical part of your robot.
  • Now take some good number of M-M, F-M, F-F connector pins based on the header pins you’ve with Arduino and give connections as per the circuit diagram shown below.
  • After successfully connecting all the components to arduino, make a connection with the power plug-in for arduino and connect the power supply using a 12V battery.

You are now ready to see the actual functioning of the robot that you made.
After switching on the power supply, you will able to see that your robot is moving forward and whenever it comes across an obstacle, it stops.

Precautions:
  1. Make sure that the code is written properly.
  2. If in case the program is not uploaded into the arduino, check for the port to which it is connected and the default board in the IDE.
  3. After connecting the circuit, recheck whether all the components are connected to the corresponding pins or not.
  4. Be careful while dealing with the power supply using the 12V battery. Sometimes, connecting the components in a wrong way may damage the components and this may lead to malfunctioning of the robot.
  5. The alignment of the wheels should be perfect, such that the robot never experiences problems with the stability in motion.

Comments