Robot is always and will always remain an amazing arena for the tech enthusiast. Everyday new developments and features are added to this vast growing field. This DIY project, an obstacle avoidance robot is being developed with the help of an Arduino board. It will be a great learning experience for the Arduino programmers.
Ultrasonic Sensor is an electrical- mechanical energy transformer which will measure the distance of an object from the sensor. Ultrasonic waves are basically longitudinal waves having compression and rarefactions along its path of wave propagation. Here we are using HCSR04 ultrasonic sensor. The sonic waves transmitted by the transducer will get reflected upon falling on the object will be received by the transducer. The time taken between this transmitting and receiving is proportional to the distance with object from the sensor. Using sonic waves we can detect solid, liquid, powder or anything where we can’t use optical means reliably. It can measure the distance from 2-500 cm.
Initially the trig pin and echo pin will be set low. When you want to go for ranging apply a 5V pulses to the trig pin for at least 10us. In response to this the sensor will generate ultrasonic waves at 40 kHz. It will transmit 8 cycles of the generated pulses. If there is an object in its range then the signal will be reflected back else not. Upon receiving the signal the sensor sets the echo pin high. The width of the high level pulse will give the time.
Its velocity in air is 340m / s. To calculate the distance
s = 340t / 2
s- Distance
t- Time difference or Width of Echo pulse
• Distance in centimeters = Time / 58
• Distance in inches = Time / 148
Here we are calculating the distance in Centimeter. The value from the ultrasonic sensor will be given as input to the Arduino. Arduino Uno board is used here which is an apt one for electronic projects. The arduino will be giving instructions to the motor driver IC L293D which can drive 2 DC motors simultaneously. Once an object is encontered it will analyse the distance of the target from it. It will follow in that path till it reaches the limit set by the user. Once reached an alternate path will be taken by it. The alternate path has to be programmed by the user while designing it.
Enjoy your obstacle avoidance robot ………………….