Introduction: Electronic Cane for Blind People

Picture of Electronic Cane for Blind People

This is a simple project can make a big difference in someone's life and you are here because you are interested
what you need to know about this project:
I used a wood cane and customize it the way I need for electronic parts like Arduino, ultrasonic, PCB etc...

How the electronics work together:
So I put the ultrasonic sensor in the top of servo motor that rotate about 90 degrees (Like Radar) to scan the area in front, Right and Left of blind patient, when this radar see's something closer than Ex:10 cm it give an alert through vibrating motor(I used two of them you can use more to increase accuracy).
But what if the patient lost his cane ?!
I used a Bluetooth HC-05 to give an alert through android app to cane so a buzzer on the cane make noise then the patient find the cane.

that's it.

Step 1: We Need to Build Our Pcb

Picture of We Need to Build Our Pcb

you can see the circuit I built on Eagle software.

Parts you need:

1- Two vibrate motors you can use mobile vibrator for better results.
2- Any kind of Arduino chips but this project built on Arduino uno R3.
3- Bluetooth module Hc-05 (i used) or Hc-06.
4- Buzzer.
5- 2×lm7805 volt regulator.
6- 3×Bc337 transistor.
7- 3×Diodes any kind can handle 5 volt can work with you.

Step 2: Connect Every Thing Together

Picture of Connect Every Thing Together

Alert: if you power up this project from the arduino say good bye to the chip because it needs a lot of current that your arduino can't handel.

some parts like Bluetooth and servo i attached directly to arduino without connecting to PCB to shorten the wires.

The connection between arduino and PCB is simple, just follow the numbers on each line to the destination, not so hard.

If you have any question about connections send me Email.

Step 3: Upload the Code

i attached the arduino code, you have to put this file on a Folder with the same name on English directory or it will not work for you.

you can edit the code the way you want like servo angle and the rules when the motors work and delay duration's.

Hope you enjoy.


/*------------"int timer 2"---------*/

void Timer2init() {

// Setup Timer2 overflow to fire every 8ms (125Hz)

// period [sec] = (1 / f_clock [sec]) * prescale * (255-count)

// (1/16000000) * 1024 * (255-130) = .008 sec

TCCR2B = 0x00; // Disable Timer2 while we set it up

TCNT2 = 130; // Reset Timer Count (255-130) = execute ev 125-th T/C clock

TIFR2 = 0x00; // Timer2 INT Flag Reg: Clear Timer Overflow Flag

TIMSK2 = 0x01; // Timer2 INT Reg: Timer2 Overflow Interrupt Enable

TCCR2A = 0x00; // Timer2 Control Reg A: Wave Gen Mode normal

TCCR2B = 0x07; // Timer2 Control Reg B: Timer Prescaler set to 1024


void measure(void);

int trig = 6; // attach pin 6 to Trig

int echo = 7; //attach pin 7 to Echo

int L_motor =8;

int R_motor =4;

long duration, cm,dis; //for Echo calc

float Light = 0; //for analog light sensor

int buzzer =9;

int Light_int_b =2; //if high measure light

int state =0; //for blutooth state

Servo myservo; // create servo object to control a servo

int pos = 45; // variable to store the servo position

void setup() {

// put your setup code here, to run once:


pinMode(trig, OUTPUT);








myservo.attach(3); // attaches the servo on pin 3 to the servo object




void loop() {

// put your main code here, to run repeatedly:

dis=Distance(); //measure distance

test_m(); //test if there is an object in front of sensor

blutooth(); //test blutooth



//------------------loop end-----------------------

int Distance()











return cm;


void test_m()


if(dis>=5 && dis<=100)


if(pos>=45 && pos<=60)








else if(pos >=61 && pos<=120)










else if(pos>=121 && pos<=135)










void blutooth()


while (Serial.available() > 0) {

state =;


if(state =='0'){


state = 0;


if(state =='1'){





ISR(TIMER2_OVF_vect) {

myservo.write(pos); //servo rotate






TCNT2 = 130; // reset timer ct to 130 out of 255

TIFR2 = 0x00; // timer2 int flag reg: clear timer overflow flag


Step 4: We Are Done

download the android app to control the buzzer (on or off)

hit the Bluetooth picture on the app and connect to HC-05 then it will say connected and you are done.

you can use any app and send '1' or '0' if this not work for you try to send 1 0


Step 5: Contact Me

Picture of Contact Me

you can contact me on:



linked in: alaa naser alnasef

Yt: alaa nasef


qeilucpa (author)2017-10-17

Hello I am visually impaired, , I am trying to develop a electronic stick , with your same idea, I mean a sensor with a servo, really I wanted to use a TimeOfFlight laser sensor but also ultrasonic should be ok.

I have some question about your project , I can't see the ultrasonic sensor model in the description , could you please add it, I found that the cheap HCS04 have a large beam so it is not very useful to find a little obstacle of to find the hole of a door for example.

The second question is , how to use the TIMER in arduino, I guess to move the servo and check obstacle in the same time?

Thanks in advance.


Hi qeilucpa,
I use HCS04 ultrasonic sensor for my project, but if you want more accurate sensor you can use TimeOfFlight laser but these kind of laser sensors don't give you same range of ultrasonic ones, on the other hand you will not use the sensor for 4m range so it will not be a big problem.
for the second question, yes you will have to use a timer I have a behave on how to program avr controllers with C and how to use timers and the Arduino use avr atmega 328p so you can program inside Arduino ide on c language and you will have no errors. you can google it or copy paste my code.
I hope I answer your questions. :)

Swansong (author)2017-10-05

That's a neat idea :) Do you have any progress photos from when you built the cane itself?

Thank you,
Unfortunately, I did not document this, but you can buy any wooden stick and build a sandal with suitable dimensions to contain Arduino and Pcb