Obstacle detection is one of the major concerns for a fully or a partially blind person (e.g. person suffering from night-blindness, cataracts, glaucoma, albinism or injury). Presented here is a smart stick using Arduino Uno. The stick uses Ultrasonic sensors for obstacle detection. The main aim of this project is to detect nearby obstacle and notify the user of the direction of that obstacle, thereby enabling the user to determine the corrective direction to head.
List of components
|Development Board||Arduino Uno|
|Buzzers and Vibrators|
Circuit & Working
Circuit shown below operates using a minimum of 5V DC power supply (Across Vcc & GND pin of Arduino UNO). The Arduino itself requires only 5V to operate but considering the fact that it has to power three ultrasonic sensors, one piezo-electric buzzer & a vibrating motor we have used a 9V supply. Arduino has an inbuilt 5V voltage regulator so we also have the options to power it using a 6V or 12V supply.
The brain of the circuit is Arduino Uno MCU board (Board1). Three Ultrasonic sensors “HC-SR04” are used for obstacle detection using ultrasonic waves. These sensors require a power supply of 3.3V each to operate up to a distance of 3 m and can detect obstacles within an average angle of 25 degrees in the sphere.
Two of the four pins of these three sensors namely Vcc & GND are connected to Arduino’s 3.3V power output. The remaining two pins – TRIG & ECHO are connected to Arduino as follows.
Apart from this, a peizo-electric buzzer SND1 and a vibrating motor SND2 are connected so that it can guide the user using different tones and vibration. Also, a toggle switch, S1 is used to save the power when the device is not in use or when the impaired person has support of others to guide him/her.
The Arduino is programmed in such a way that on switching ‘ON’ the Arduino, it sends a LOW to HIGH signal on the TRIG pin of all the three Ultrasonic sensors. These ultrasonic sensors will send an Ultrasonic wave using the ultrasonic transmitter of the sensor. These ultrasonic waves travel through air and on colliding with an obstacle, get reflected back. Programming is done in such a manner, that when this obstacle is in the range of 1.4 m of the sensor, the Arduino will play the buzzer with different delay for obstacles located on the sides, and no delay for the straight ones. To further enhance its performance, if the obstacle is too close (less than 0.7 m from sensor) then the vibrating motor is also activated.
The sensor would give an electrical response at the ECHO pin of the sensor. This response is the time taken by the wave for a round journey from sensors to obstacle and back to the sensors. For our calculation, we need only the one-way distance. This can be calculated by Arduino using the following formula:
Here, Duration = Echo output;
and since we need only one-way distance, hence we divide this duration by 2.
Here the constant 29.1 is derived as follows:
- The speed of sound is 343.5 m/s or 0.0345 cm/microseconds.
- 1/0.0345 cm/microseconds is 29.1 microseconds/cm.
- Dividing the Duration (ms) by 29.1 (microseconds/cm) gives us the distance in (cm).
To distinguish between the direction of obstacle location, the following mechanism is followed:
- For Left and Right side direction locations, the delay is 500 ms.
- For Forward direction location, the delay is zero.
An additional provision of a motor that vibrates the stick is planted into the assembly for very near obstacles. Experimentation study shows the optimum distance post assembly, to be 0.7m.
Construction and Testing
Implementation of the circuit on a printed circuit board is not going to be fruitful, as most of the circuit parts would be implemented on a wooden chassis/cardboard/plastic mounting. We can’t hardwire the sensors on PCB as they would be in a vertical position; and more so placed in a circular /semi-circular fashion. The final assembled device is placed about midway on the stick. Once the circuit is assembled, test the circuit at the test points given in table below.
|TP6-TP9 without any obstacle||Waveform 2|
|TP6-TP9 with obstacle||Waveform 3|
After that, make a cardboard box or a plastic box with 8 circular holes in it. 6 of the 8 holes should be of the size of transmitter/receiver of the ultrasonic sensors & they should be punched on the wall of the box. Remaining 2 holes should be of the size greater than the diameter of the wooden stick you choose & they should be punched on the top & bottom of the box, also they should be collinear to each other. The top of the box should be removable if in case we need the access to circuit. Consider below figure for reference.
Once the circuit is assembled, put the Arduino & sensor along with the connecting wires inside the cardboard box. Through the six holes punched on the surface take the transmitter & receiver set of each sensor out of the box. The significance of this assembly is to avoid false triggers as the box itself would behave as an obstacle to the sensors. Proper placing and alignment is very important. Ensure proper mounting by optimally placing the buzzer, vibration motor, switch & battery after removing it from the box. Test the assembly now against variable obstacles at variable distances.
The flowchart for the program is given below.
Arduino version 1.6.6 is used for this project but as no directory change is made, the same can be achieved using any of the latest versions of the Arduino IDE. The IDE is available here.
The next section gives a brief insight into the pin definitions and input-output port details.
[stextbox id=’grey’ caption=’Defining the pins and variables in the program’]#define trig1 3
#define echo1 2
#define trig2 4
#define echo2 5
#define trig3 7
#define echo3 8
#define motor 12
#define buzzer 11
[stextbox id=’grey’ caption=’Defining which pins to be used as Input or Output’]void setup()
[stextbox id=’grey’ caption=’Initialize ultrasonic waves via sensors and interfacing I/P ports to corresponding variables:’]void loop()
//For sensor 1
duration1 = pulseIn(echo1, HIGH);
//For sensor 2
duration2 = pulseIn(echo2, HIGH);
//For sensor 3
[stextbox id=’grey’ caption=’Calculate the distances and save them to variables.’]distance1 = (duration1/2)/29.1;
distance2 = (duration2/2)/29.1;
distance3 = (duration3/2)/29.1;[/stextbox]
[stextbox id=’grey’ caption=’Calculate the distances and save them to variables.’]if ( distance1 < 120 || distance2 < 120 || distance3 < 120 )
if ( distance1 <= 60 || distance2 <= 60 || distance3 <= 60 )
Following are the criteria to activate either the buzzer or the motor or both.
|For distance > 1.4m||No Buzzer|
|For 0.7m < distance < 1.4m||Buzzer|
|distance < 0.7m||Buzzer + Vibration|
For the convenience of the user, apart from the buzzer a vibrating motor informs the user of a nearby obstacle in the corresponding direction as well.
[stextbox id=’grey’ caption=’apart from the buzzer a vibrating motor informs the user of a nearby obstacle in the corresponding direction ‘]else if ( distance1 > 60 && distance1 < distance2 && distance1 < distance3 )
else if ( distance2 > 60 && distance2 < distance1 && distance2 < distance3 )
else if ( distance3 > 60 && distance3 < distance2 && distance3 < distance2 )