Introduction: Vibrating Distance Sensor
Imagine waking up next to a light sleeper and you have to get to the bathroom but you're in an pitch black hotel room. Even a flashlight will wake him or her up but you can't hold it for the next three hours when the alarm goes off. What if you could navigate a hotel room like a bat navigates a cave?
With a vibrating distance sensor you can "feel" walls up to fifteen feet away rather than groping blindly.
The vibrating distance sensor gives you sonar vision with no training. The flashlight enclosure is easy to build and intuitive to use. Feedback is a vibrating motor that vibrates strongly when an object is close then vibrates weakly when an object is far away. Kids have picked this up and automatically began testing the range of walls and ceilings with no one telling them how to operate it. Just point it where you want to look/feel and you sense if there is something in the way.
This project involves soldering, cutting, drilling, sanding, measuring, and downloading a program to an Arduino.
Step 1: Shopping List
Flashlight.* Rayovac Economy 2D 9 Lumen model. Get the red model with the black bezel. Amazon link.
Ultrasonic distance sensor
9V Connector
9V battery
Attiny85 Arduino
Tactile switch
Vibrator motor
STL Model for flashlight adapter
3/4" #10 bolt*
#10 end nut *
Super glue
Hot glue stick
1" Schedule PVC * White plumbing pipe
Wire
* These items are cheaper to purchase from a hardware store than order online.
While we're gathering everything I want share the files for this project. The necessary one is the Arduino code.
There is an .stl file but if you don't have a 3D printer you can move to the next step after downloading the Arduino code. If you can print that you won't have to cut the adapter in the next step.
For the hackers who want to see all the inner workings of the 3D models I have the OpenSCAD files on my blog. They're freely available so if you want to use a different flashlight you can easily tweak things and make a model to fit lots of different flashlights. There are also .dwg files for people with laser cutters or CNC machines.
Downloadable files for Vibrating Distance Sensor:
- Arduino code
- STL Model for flashlight adapter
- Flashlight adapter PDF Print at 100%
- Schematic PDF
Step 2: Flashlight Adapter
By the end of this step we will end up with an adapter to hold a distance sensor in a flashlight. This part is visible so I recommend doing a neat job. The yellow and green image is animated so expand it to get a good idea of what we're making.
If you printed the .stl file from the previous step you can skip this step now.
This part is small so it is easy to print off a template on a standard paper printer. Download the .pdf and print it at 100% scaling. Don't worry if some of the borders are cut off. When printed at 100% the scale at the bottom will align with a ruler exactly. Cut out the templates from wood or plastic. Your material should be at least 2mm thick but less than 13mm thick. Hole sizes and positions are printed right on the file.
When the part it done it should fit easily into the black flashlight bezel and not stick in place. It is fine if the piece rattles a little bit, don't worry, it won't rattle once it's assembled.
Step 3: Electrical
This is the step with soldering.
I've included a schematic image above. On my blog I even provide a .dwg of the schematic if that's your thing. If not, that's cool too. The rest of the pictures go in order of what to do if you would rather have a step-by-step pictorial of the soldering steps.
Soldering the thin wires of the vibrator can be tricky so once you get it I recommend gluing the vibrator to the Arduino. Hot glue works well but so does double sided foam tape.
Once everything is soldered, adhere the distance sensor to the adapter made in the previous step. Hot glue and double-sided tape work well for this too. It is not necessary to use special glue since the distance sensor will be held in place once the flashlight bezel is tightened onto it.
If you apply power to the Arduino now the vibrator motor should pulse in time with the LED. This is a good way to test the power and vibrator circuit.
Attachments
Step 4: Program the Arduino
If you haven't already downloaded the project's Arduino code please do so now.
If you have used a DigiSpark then you know the ropes. If not please follow the steps shown by DigiStump, the people who make the DigiSpark.
The difference will be adding an Additional Board Manager URL at:
http://digistump.com/package_digistump_index.json
Attachments
Step 5: PVC Cutting and Drilling
I wrestled with different method of using the switch built into the flashlight. I even considered ripping it out and putting in a brand new switch but the elegance of using the original switch was too much. With that said, some of you hackers will have no problem changing this step around to suit yourself. Some ideas would be to use a LiPo battery pack instead of the 9V battery or a high capacity 12V battery. A lighted switch would look pretty cool, just saying.
1" PVC, the cheap plumbing kind, is roughly the same diameter as a D-cell. This works well to fill the space where the bulky batteries would normally go.
- Cut a 5 3/4" (145mm) length of the pipe.
- Cut out a space for the 9V battery. This could be cut with a saw or router. It should be secure but easy to remove
- Place the pipe inside the flashlight and push it to the bottom of the handle
- Align the pipe so there is plenty of pipe right under the switch.
- Drill a 3/16" (4mm) hole though the flashlight and pipe
- Put a #10 (4mm) bolt through this hole.
This pipe serves two purposes. The first reason is to hold a small, inexpensive tactile switch under the flashlight's switch. Secondly the pipe will hold the 9V from rattling around and tugging on wires. You want it to feel sturdy, don't you?
Step 6: Last Step and It Is Easy
We want to position that little black button under the flashlight's switch so when it is pushed forward the button is held down. The button will be glued in place and that's about it.
To align the switch:
- Install the PVC pipe and position it with a bolt. There is not need for a nut yet.
- Make sure the flashlight switch is in the OFF position.
- Use tweezers or thin pliers to position the button where it will be pressed when the flashlight switch is fully forward.
- Use a hot glue gun to temporarily hold the switch in position.
- Switch the flashlight off.
- Remove bolt
- Remove PVC from flashlight handle.
- Use a marker or pencil to outline the switch position.
- Break the hot glue away from the PVC and switch.
- Use plastic glue or super glue to hold the switch in place.
Once the glue has dried reinstall the PVC and bolt like you did in the previous step. Switch the flashlight on so the button is pressed. There should be a small click. Add the nut while the button is held and do not over tighten the nut.
If everything has been done correctly you can start using your handheld sonar unit!
Step 7:
I hope you enjoyed reading or building this project.
This device was developed over the course of months and I documented every step. Some of those steps were fruitless and some were amazing breakthroughs. If you enjoy getting into the mind of someone who creates things like this please visit me.
I run a blog where I talk incessantly about the things I build, including an unabridged versionof this project. There are also other neat projects like a device which converts temperature to sound. You can also see how this project started as a servo feedback device which became a different Instructable first.
27 Comments
Question 3 years ago on Step 2
I can’t use the pdf. Send help and cookies.
Answer 3 years ago
6 years ago
I love this instructable! I have two questions 1. Can you give a range of cost for the total project? 2. Do I have to use the flashlight to house everything? Could I build my own housing? What other parts would I need if I wanted to do that?
Reply 6 years ago
This project should cost less than $10USD if you can buy the small hardware pieces at a hardware store. If you don't mind waiting for shipping from China the electronic parts are very inexpensive.
The flashlight housing isn't necessary and it actually has a lot of empty space. If you're going to build a new enclosure the sky is the limit. I do recommend a mount for the distance sensor so it will be easy to bolt down. Have fun with the design and post a picture when you finish!
7 years ago on Introduction
Any recommendations for how best to modify the circuit to allow for audio AND OR vibration output; my blind friend thinks it might be educational in group settings, and when his neuropathy is acting up.
7 years ago on Introduction
This thing is freaking awesome! Believe it or not, I didn't have to change the pinout configuration. This will really help my buddy get around the house with a little more ease. (he is pretty much completely blind) Thanks for coming up with this!
7 years ago on Introduction
I was thinking this could be great for camping out doors run a remote -or extention wire to the vibrate function to alert of a bear or other wild life threats .Ps The blind useing for shooting was just a joke . Thank You keep the wheals turning!!
7 years ago
Hey, in a tactical mount on a shotgun! Zombies wouldn't stand a chance.
Reply 7 years ago on Introduction
be great for blind gun owners in self defense .Stopping an intruder the blind just mount it on there shot gun .When it vibrates just pull the trigger.
7 years ago on Introduction
So awesome if it works well. I can see far better applications for this than getting to the toilet at night LOL
Reply 7 years ago on Introduction
Agreed. What would you use it for?
Reply 7 years ago on Introduction
Navigating anywhere I can't see clearly. Would be an enormous help if stealth is desirable. Can't think of anything at present but perhaps some apocalyptic day soon it will come in handy. Thanks for sharing will check out your other posts soon ;)
7 years ago on Introduction
Could you use the arduino uno rev 3 if the pinout numbers where changed? I would love to try this one
Reply 7 years ago on Introduction
Technically, yes you can use an Arduino UNO Rev 3. To do so you will need to do the following:
1. Change the code to specify the pins you've chosen. (This is usually the easy part, so start here.) Why? This is because the pin numbers are not the same (as you point out in your question)
2. Change the way things are physically contained (Larger flashlight, home built...etc.). Why? An ATTINY85 Arduino is very small allowing it to easily fit into the flashlight housing. An Arduino UNO Rev 3 will not fit into the size of flashlight used for this instructable. So if you wish to have a handheld device, even just temporarily, you will need to find a way to hold the pieces together long enough to use it.
Reply 7 years ago on Introduction
Exactly! Thank you, JasonD1.
Make sure the vibrator motor is connected to a pin capable of analog (PWM) output and you are good to go.
Reply 7 years ago on Introduction
No problem. Cool instructable, by the way. I've bookmarked it. :-)
7 years ago on Introduction
Nice! The cyborg tag is really fitting. I need to make this.
Reply 7 years ago on Introduction
Earlier this year I even made a version which worked with an implanted magnet so the user had to be a cyborg. This version needed no moving parts.
http://www.24hourengineer.com/2015/05/2015-05-01-sa-cyborg-distance-sensor.html
7 years ago on Introduction
Would this not be incredibly useful for actual blind people? I think you should patent this before somebody steals your idea!
Reply 7 years ago on Introduction
I really hope this can be adopted by vision-impaired people. I wouldn't patent the idea because that might literally keep it out of the hands of people who need it.
One of my early prototypes was sent to a blind person in NC for exactly that purpose.