Compass Hat

3/09

For the Dorkbot Bristol Mad Hatters March Makers & Shakers day at Hamilton House

The lovely Dorkbot Bristol organised an all-day hat-hacking contest.

My Cunning Plan was to fit out a hat with an Arduino, a compass sensor, and a ring of 8 pager vibrate motors. With the aid of a little code, the northmost motor would always vibrate, and hence the wearer would always know which way round they were.

Predictably, the six hours of Dorkbot was not actually enough to make the thing work. By the end of it I had the assembly and wiring pretty much completed, but had not made any of it go. It was a lovely day though, with plenty of technical chatter and a bunch of people making strange things. And great soup.

But, the next day, I fired up my soldering iron and DVM and finished it off. I haven't yet built the works into the right hat, but I did a quick lashup with all the bits taped onto a baseball cap to prove that it worked.

(PS - I just stumbled across a reference to the original project which, in some half-remembered way, inspired this one: Udo Wächter in Osnabrück

Here's the Feelspace project homepage from 2004.)

The parts are:

From SK Pang :

- Arduino Duemilanove

- SparkFun ProtoShield Kit (a bit expensive at 12 quid, but worked out well)

- SparkFun HMC6352 compass module (very expensive indeed at 50 quid, but I don't think there is a cheaper way)

From RS Components :

- ULN2065B quad Darlington driver x 2 (£2 or so each)

- Assorted headers and battery boxes and so on

And, from Display Electronics, a bag of pager motors at two-and-abit quid each.

(Actually, the Solarbotics vibrating pager motor would have been a better choice. Smaller, and no need to shroud the whirly bits)

Assembly is pretty much obvious. The motors really only want about 3V, so I used a 39 ohm dropper resistor from my battery +ve (not the 5v rail, so as to spare the Arduino's regulator) to the common +ve side of all the motors. The -ve sides were each wired to an output pin on one of the Darlington drivers. I can only get away with a single dropper resistor because I only need to run one motor at once, otherwise I'd need to do something a bit more grown-up.

The inputs to the drivers came from the Arduino digital outputs 2 to 9 (I used 0 & 1 initially, but then realised that makes it impossible to upload new programs).

Code to read the compass came from here, and worked the first time I ran it. The compass communicates over I2C, using the Arduino's built in Wire library, which requires analogue pins 4 & 5.

Here's the assembled shield on its Arduino:

Closeup of the shield (as Drew says, I really should get some thinner hookup wire for this):

Motors and sensor taped to a hat:

One motor:

And the sensor:

Those motors turned out to be too big, but I found some better ones from Solarbotics:

Here they are sewn into a hatband, with the sensor on top of the head:

It even looks like a hat:

I'll bring it along to April's Dorkbot, when we can see if it really works.

Home | Artefacts| Fripperies