Deprecated: Assigning the return value of new by reference is deprecated in /fs5e/blendedtechnologies/public/wp-content/plugins/pmetrics.php on line 1192
Blended Technologies » Blog Archive » How I Created a Haptic Ultrasonic Range Finding Hat

How I Created a Haptic Ultrasonic Range Finding Hat

I came across this project a while back that lets you “see” with ultrasound:

The ultrasonic haptic vision system enables a person to navigate hallways and around large objects without sight, through the use of an ultrasonic rangefinder that haptically interfaces with the user via tiny vibrating motors mounted on the user’s head.


It looked so cool I decided I must have one of my own. And being a newly minted Arduino owner, I figured no electronics project was out of my reach :-)

First I changed the design around a little. Here’s what mine ended up looking like:

My Changes

Instead of having the ultrasonic sensor rotate around your head, and give you distances in every direction, I have it simply tell you the distance to the nearest object in the direction you’re facing. I thought this might make for a more intuitive “interface”. I also used a stylish baseball cap instead of a dorky hardhat.

Instead of mounting the whole Arduino right on the hat, I decided to just include the components of the Arduino I needed. This is called building a Standalone Arduino. You can run your Arduino sketch unmodified but with only a few inexpensive components. This way I won’t be tempted to cannibalize my nifty hat for its Arduino for whatever project comes along next.

Here is a tutorial for building a standalone Arduino. (And here is another.)

What I used

PING))) Ultrasonic Sensor:

This guy sends out an ultrasonic pulse from one of these two transducers and listens for the echo with the other one. You can calculate the distance from the length of time it takes the echo to return.

The hat ($5 from Walmart)

And some miscellaneous parts:


I built everything on a breadboard to make sure it worked. I then soldered everything to the protoboard:

(I won’t show you the other side of this which would reveal my horrendous soldering mistakes.)

I popped the ATMega chip into my regular Arduino and loaded the sketch onto it. Then I popped it out and put it into the chip seat on the new protoboard. Since everything is wired up just like an Arduino, the sketch can run unmodified. This method also required that my ATMega328 already had an Arduino boot loader loaded.

I set the vibrating motor in the flap inside the hat. I cut off part of a pen case and glued the moter in that. This lets the motor spin freely without worrying about fabric interfering.


It works OK. I can find things like doorways and walls with my eyes covered!

My main complaint is that there isn’t very much variability in the vibration motor. The program it’s running converts the distance in inches to the object you’re facing into a voltage to send to the motor (pulse width modulation). E.g, seven feet away means almost no voltage and the motor spins slowly, one foot away means lots of voltage so it vibrates more. However I can effectively only “feel” three states: something in front of me, nothing in front of me, and something really close to me. I was hoping I could scan my head up and down stairs and feel the variation between each step, but the motor just can’t get that fine grained.

If you make your own, you might want to find a better motor, or have several motors where close objects make say three motors run, and far objects only one. Or maybe just make it beep instead of vibrate and use auditory cues to find your way around.

All in all it was a great learning experience, and hopefully I’ll find a practical use for it soon …

The Arduino sketch (the program the micro controller runs):

Read distance using Ping sensor, and vibrate
motor by how close distance is to sensor.
(Most of code comes from

Greg Pinero
July 2009

#define debug //debug for debugging, anything else otherwise
const int pingPin = 7;
const int vibPin = 6;
int pulseOut = 0;

void setup() {
  // initialize serial communication:
  #ifdef debug

void loop()
  // establish variables for duration of the ping,
  // and the distance result in inches and centimeters:
  long duration, inches, cm;
  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  digitalWrite(pingPin, HIGH);
  digitalWrite(pingPin, LOW);
  // The same pin is used to read the signal from the PING))): a HIGH
  // pulse whose duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);
  // convert the time into a distance
  inches = microsecondsToInches(duration);
  //vibrate proportionally to closeness
  pulseOut = inchesToPulse(inches);
  #ifdef debug

float inchesToPulse(int inches)
  //curved function so closer distances have more variation
  int MaxInches = 133;
  int minPulseOut = 70; //vib motor won't spin below ~50-70
  //(3 was way too steep) Only felt motor within a foot or two
  float powerConst = 1.5; //steepness 1 for line >1 for steeper
  int pulseOut;
  pulseOut = (int)(pow(((MaxInches - (float)inches)/MaxInches),powerConst) * (255.0-minPulseOut)) + minPulseOut;
  if (pulseOut < = minPulseOut) {pulseOut = 0;}
  return pulseOut;

long microsecondsToInches(long microseconds)
  // According to Parallax's datasheet for the PING))), there are
  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
  // second).  This gives the distance travelled by the ping, outbound
  // and return, so we divide by 2 to get the distance of the obstacle.
  // See:
  return microseconds / 74 / 2;

long microsecondsToCentimeters(long microseconds)
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
} |  Digg |  FURL |  Yahoo! My Web 2.0 |  Reddit

28 Responses to “How I Created a Haptic Ultrasonic Range Finding Hat”

  1. Cyber Geek Says:

    I like your haptic idea. Have you considered sound feedback (via an earpiece) you could change the pitch depending upon the distance measured or pauses between clicks. I would think that having clicks getting quicker as objects got closer would be cool. Rising pitch with increased closeness could give you a Thermin like effect when scanning an area.

  2. Greg - CEO/Founder Says:

    That’s a very good idea, Cyber Geek. I might try that.

  3. Scott Says:


    Someone in our church recently became blind in both eyes. I happened to be checking out your website today when I saw your latest project with the ultrasonic range finder mounted on a hat. How does it work? How much did you spend in building it? Would you be able to make one like the students in the other site you reference? I would be interested in your feedback to see if this is something that I could make to give to my friend.



  4. chaitanya Says:

    i like ur idea can u giv me ur circuit diagram

  5. bdesigned Says:

    Did you ever make available the circuit diagram for the ultrasonic cap? I’d love to make one.

  6. como hacer crecer el cabello Says:

    Rising pitch with increased closeness could give you a Thermin like effect when scanning an area.

  7. dofollow Says:

    Hello there, You have done an incredible job. I will definitely digg it and personally suggest to my friends. I am sure they’ll be benefited from this web site.

  8. Lars Jansen » Huge index of Arduino & Freeduino Knowledge Says:

    […] ULTRASONIC: sketch and tutorial for interfacing a PING Ultrasonic sensor […]

  9. dark souls 2 hack tool Says:

    This final book in the trilogy Kane Chronicles is fast-paced and filled with action. First, Dark Malady- -> Then Twilight Force- ->-Fiery Spike- ->-Fiery Spike- ->
    -Scourge of Darkness-. It will make you look sexy and it can create a
    continuous look to appear taller. And these spirits shall rise up against the
    children of men and against the women, because they have proceeded from them.

    He also said, “One does not become enlightened by imagining figures of light, but by making the darkness conscious.

    Stop by my web-site dark souls
    2 hack tool

  10. FAKE oakley sunglasses Says:

    Blended Technologies » Blog Archive » How I Created a Haptic Ultrasonic Range Finding Hat

  11. バット Says:

    Quit Whining , Start Off your private men Marketing strategy As a substitute .

  12. official quality dez bryant blue white black jersey nike throwback cowboys elite all the best Says:

    Turn that nfl jersey into a full-blown Goldmine
    official quality dez bryant blue white black jersey nike throwback cowboys elite all the best

  13. pinterest Says:

    In fact social networks have revolutionized our
    lives by incorporating all the basic elements of a person’s social life in one place.
    It’s just for craftaholic women and outfit-hungry fashionistas, right.

    For example, if your food business is dedicated to gourmet party
    appetizers your bio might be as simple as “Gourmet appetizers delivered right to your door.

    Also visit my web site pinterest

  14. hotmail 365 error Says:

    Regarding instance, when you tag a message as study or reply to it in Outlook, the
    meaning won’t be marked since read or show
    that will it has been responded to on the machine.
    Additional mail folders that will you might have produced as
    well, won’t end up being available in Outlook possibly.
    Microsoft automatically update your account.

  15. porno en haute definition Says:

    On remarqսe ԁirect que vous connaissez bien ce sujet

    Hеre is my web blog; porno en haute definition

  16. new nike ndamukong suh womens jersey lions green black white authentic sale online 2014 Says:

    Insights on how to learn nearly anything there is to find about nfl jersey in Two easy steps.
    new nike ndamukong suh womens jersey lions green black white authentic sale online 2014

  17. Says:

    Really, let alone. Seems as though I had build up the LUNs effectively, the situation has been with ESXi not necessarily joining accurately from the GUI. I had fashioned to do this for you to mount typically the LUNs:

  18. offical cheap prada 2014 leisure men shoes 1647556 outlet online shop Says:

    Hard to find study gives you the important points on the nfl jersey that experts claim just some customers know of.
    offical cheap prada 2014 leisure men shoes 1647556 outlet online shop

  19. cheap louis vuitton Says:

    This time Louis Vuitton launched the 2014 autumn and winter new backpack not as brand classic Monogram pattern based printing lice got nickname his or her be like caribbean sea design a retro style shoulder bag full of flavor
    cheap louis vuitton

  20. canada goose Says:

  21. ugg ブーツ 正規品 che Says:

    これはです素晴らしいサイト、可能性あなたがあること関与そうすることでインタビューに関して|あなたはどれだけどのように デザインさを、それ?もしそうであればメールを受け取る!
    ugg ブーツ 正規品 che

  22. Dame Nike Free 3.0 V2 Says:

    42mm Ballistic Plex rescue

  23. ugg ブーツ ソール Says:

    しかし私は知りたいしワンダフルポストにこのトピックに関するリッテ続きを書くことができれば?あなたは少し手の込んだことができれば| 感謝感謝をさらに私は非常にあることと思います。 おかげ!
    ugg ブーツ ソール

  24. dollar webhosting Says:

    By doing so instead person paying them the is the paying you instead.
    This can make it impossible of your visitors to link to the
    specific page on your internet. In the first article I said about earning money using Google adsense.
    Each internet site needs to have the details of
    2 name servers recorded. Host gator makes it in order to set up a blog website.

  25. Tiffany Jewellery USA Says:

    The group of experts, scientists and doctors from Japans hospitals and medical institutions focuses on war crime studies between 1931 to 1945, particularly those related to Unit 731.

  26. seofxs seo training Says:

    I do consider all the ideas you’ve introduced for your post.
    They are really convincing and can certainly work. Still,
    the posts are very short for starters. May just you please extend them a little from subsequent time?
    Thanks for the post.

  27. air jordan retro 6 olympic on feet Says:

    Trouvez des sentiers près de San Joaquin en Californie, y compris les parcs de San Joaquin, San Joaquin promenades et San Joaquin pistes cyclables.

  28. Maradona Says:

    You can either email them through your GoDaddy dashboard, or just call them. I’ve had to process a few refunds before (not the website builder, but a few other items I purchased from them) and the refunds were processed very quickly and smoothly.

Leave a Reply