Haptic Distance Sensor





Introduction: Haptic Distance Sensor

Handheld SONAR. This device will apply pressure to the wearer depending on the distance sensed which allows the wearer to virtually feel his or her surroundings without making physical contact.

This device is not a new idea. The only difference I wanted to make was modularity. In the past they were always built around a specific implementation such as a wrist mounted version or a belt mounted one. Since there is an endless variety of ways to make these devices I wanted to show you how easy it is so you can build the next version, which could be a hat, or a necklace, by simply attaching one to a cap or chain. This device can be used exactly as it is built too. In the process I also produced extremely minimalistic code but not before writing a monster.

This project uses a 3D printed enclosure to make a very streamlined and compact device but it's not vital. These could literally be made out of cardboard and still work, albeit not as sturdy.

While walking around my apartment and holding this in my palm I was able to find every doorway with my eyes closed. Had it been mounted on my body I wouldn't even need a hand to hold it.

For this build you will need:

Optionally you can use a 3D printer for the enclosure in which case you may want:

  • 2 @ 1 1/2" #10 bolts
  • 2 @ matching acorn nuts
  • 2 @ 1.6mm x 10mm bolts
  • 2 @ 1.6mm nuts
  • Screwdrivers

To add some finishing touches a nylon sleeve and bolt head caps dress it up a bit.

Step 1: Solder

A schematic for the wiring is in the photos for this step. It shows the servo wires running to a three position header which works fine but this takes up extra room in the enclosure so I eventually opted to simply cut the servo wires and solder them directly to the board. Both options work. The schematic doesn't explicitly show the data pins being soldered but please solder them at this step.

If changes are made for your build and different pins are used it will be necessary to change the code to reflect this. Any of the discrete pins may be used but I recommend against the data pins, 0 and 1. This could be built with an ATTiny85 chip since only three I/O pins are used.

Step 2: Program

The Arduino is programmed through an external programming board which connects through female↔female cables. Each board will have the data pins labeled and they will be in the same order so it is a matter of making sure each side is hooked up the same way. You may notice the transmit (Tx) and receive (Rx) pins are crossed from board to board but this this intentional since you want the receive pins to talk to the transmit pins so the cable bundle will go straight across.

If you have not already downloaded the Arduino IDE (Integrated Development Enviroment) please download and install this software on your computer.

Follow any instructions provided with your serial ↔ USB cable.

Code is shown at the end of this stepor it can be downloaded.

  1. Open or paste the code into the installed Arduino IDE.
  2. Select your serial port.
  3. Connect the Arduino
  4. Download the code.

unsigned long upperLimit = 15000;
void setup(){
pinMode(3, INPUT);
pinMode(4, OUTPUT);
pinMode(12, OUTPUT);

void loop(){
digitalWrite(4, HIGH);
digitalWrite(4, LOW);
int servoDelay = pulseIn(3, HIGH, upperLimit);
if((servoDelay < 110) || servoDelay > upperLimit){servoDelay = upperLimit;}
servoDelay = map(servoDelay, 110, upperLimit, 500, 2500);
digitalWrite(12, HIGH);
digitalWrite(12, LOW);

Step 3: Enclosure and Assembly

The first image is animated and shows all the changes the enclosure when through.

As mentioned earlier this project uses a 3D printed enclosure but anything you do to keep it all together is fine. Wood, plastic, epoxy, metal, fabric, and cement are just a few things. Like I also mentioned this is meant to be modular so anything you do to hack this project and make it your own just makes it more awesome.

A hemispherical cam is shown in the animated image. This half-circle is attached off center to the servo horn and applies varying pressure as the servo rotates. Again, this doesn't have to be made on a 3D printer. Just make sure you don't make it out of something sharp. A plastic lid from a food container would be a good example of something you could cut out to attach. It should be roughly 1.5" or 4cm in diameter. How far off center you attach it will determine how much the difference in pressure when measuring distances.

If you are going to build your own enclosure you don't need to do anything else with this step, just get building and you'll have yourself a handheld SONAR unit.

See the model in 3D space in your browser.

Files for Self Contained Haptic Distance Sensor:

The OpenSCAD files below are not necessary unless you want to change something

The halves of the printed enclosure are held together with the #10 bolts. The distance sensor is held in place with the 1.6mm bolts. The power socket is glued in place with the flat side resting against the wall. Small plastic nubs on the underside of the power socket can be trimmed or sanded off.

Step 4: About Me

Thank you for reading. The second image is animated to show the device from all around. It is connected to an ordinary USB phone charger which provides plenty of power.

If you improve this device, there's room, please tell us all how in the comments.

I run a blog where I talk incessantly about the things I build, including an unabridged version of this project that contains all the ways I screwed up and improved before publishing here. There are also other neat projects like a switchable voltage USB to serial adapter for programming Arduino minis and a Rotational Photography Rig which I'm planning to upgrade soon.



    • Creative Misuse Contest

      Creative Misuse Contest
    • Clocks Contest

      Clocks Contest
    • Water Contest

      Water Contest

    14 Discussions

    Do you know how many hours a good battery will last? I'm planning to keep a log, just to see. I guess it's a learnaholic thing. I do think the best improvement I could think of is an on/off switch. We're trying them having fun trying them out.
    Thank you for the opportunity to test them.
    Mary Alice and Bear

    1 reply

    I haven't done any computations or measurements to test how long a battery would last. If you come up with a time estimate please post it! That would be valuable information. The next version will have a switch and should be more comfortable to hold.

    After I left the Flea Market, I bought batteries and began playing with one of the sonars
    l plan to test them tomorrow. It's really amazing. Thank you for the opportunity. They are so cool.
    Is there a way to turn the sonars off besides removing the battery?
    Mary Alice

    1 reply

    The only way to turn this off is to pull the battery. My next version will likely have a switch.

    You sent TWO for us to play with!!!♡♥♡ Thank millions you. As soon as Esperasa or her oldest son Ivan gets home I am so running to the Family Dollar Store for batteries to see what it can do. I made the 1st case with plastic canvas so that it would be ready.
    When I went to our local hardware store for the window screening, Mr Sellars what non window project I was doing now (I haven't needed to make new window screens since I moved here in 1984.) He laughed when I told him I was turning my favorite Bear into a bat.
    If it's all right with you, I will share your project instructions with the local organization for the blind. I'm sure Bear isn't the only one who could use one.
    Mary Alice

    1 reply

    I was experimenting with different ways of assembling and constructing these devices so I sent both of my prototypes. They each act a little differently so see which Bear likes and use that one. If you want to saw off the "wings" from the second enclosure you can do that without hurting any of the electronics. I suggest a hack saw if you don't have a good saw for cutting plastic.

    I've noticed these devices work best when they're pointed at a perpendicular surface and aiming them slowly may help too. Give me a call if you want. Anytime this weekend would work great.

    If Bear gives her approval it would be really cool if you showed your organization for the blind. I am working on a new revision which uses a flashlight case because people instinctively know how to point a flashlight whereas this shape isn't so intuitive. Keep me updated and take lots of pictures!

    Thank you for this 'Ible. I have a blind friend, who refuses to learn how to use the cane. (Becoming blind has not changed too much. When her boyfriend tried to smother her, she punched him in the face and while recovering from the surprise, thew him out to wait for the police to take him away.) She would use this and I will learn how to make this. Bear deserves this.

    4 replies

    That's really wonderful of you and exactly the reason I wanted to put this idea out there. Let us know how you implement your build and what materials you use. Happy building!

    I appreciate your offer.I used to be a freelance photographer and am quite aware of copyright and model releases. I useCreative Commons Copyright on my charts. That way I give permission to use my charts without losing my own rights. I grew up in the Alaska bush. The first I used a dial phone was when I went to University of Alaska (1969). I mosty went to one or two room school until high school. For most of that I did correspondence courses because only communities with 8 students got a teacher. I will happily make charts for needlepoint enclosures. I'm really excited about giving Bear better mobility. My e-mail is MooseDropCabins@hotmail.com. The Moose Dropping Festival use to be Talkeetna's big summer celebration. Alaskans know how to have fun! My phone # is (843) 343 9480.

    I will probably make the case out of needlepoint I specialize in 3-D needlpoint, usually special buildings. I will have to get someone else to do the soldering. I may have to get a geek to help me with the programing. Give me beads, wool, PVC, etc., and I can do wonderful things, but I am still trying to learn MS Office.
    Before my arthritis became too severe, I did home health care. Now I am working on wheelchair and walker adaptations. My rolling walker has a "trailer" hitch for my rolling bookbag, rear view mirror, umbrella holder, and a fabric shelf under the seat for my computer bag. I will be watching for future useful projects. Like you, I love designing and making things.

    A needlepoint enclosure would be very distinctive and a project all its own. Not to mention an uncommon melding of maker disciplines which would cool.

    You really know how own your devices. It sounds like your walker is pretty "tricked out."

    Sometimes I get so wrapped up in the presentation I forget that everyone hasn't seen these before. That happens when you live in your own little world. I added a new first paragraph to step one.

    Handheld SONAR. This device will apply pressure to the wearer depending
    on the distance sensed which allows the wearer to virtually feel his or
    her surroundings without making physical contact.

    Thank you for saying something.