Archive for June 20th, 2012
Our Larval Engineer has begun writing the Arduino code (Baby’s First Real Program!) that will control ground effect lighting on her longboard, with RGB LED colors keyed to the wheel rotation speed. Her back of the envelope says the wheels spin at about 60 rev/s (= 17 ms/rev) at 30 mph, which rules out mechanical / reed switches; some experimentation with a simple mechanical switch showed why the Arduino bounce library is a Good Thing even for pushbuttons.
Some rummaging produced a collection of these Hall effect switches:
I thought they were ordinary keyboard switches, but noooo… Honeywell 201SN1B1 switches turn out to be Mil-Spec items, with brethren serving in B-52 bombers, F-16 fighters, and even long-departed Peacekeeper ICBMs (most likely in the ground support equipment). There are no data sheets at this late date, but this compressed specs burst gives some hints:
General Characteristics Item Description: Switch body 1.060 in. l; 0.740 in. h; 0.740 in. w; hall effect solid state switching; alternate action; 5V dc; 9 ma.; operated at 0.4V dc max.; sinking 4 ma. per output; pulse output; printed circuit terminals
A gentle twist of a small screwdriver under the plastic latches releases the base plate and frees the Hall effect switch module, which is the square black plate above. It contains an IC (downward in the picture) with wire-bonded leads embedded in a flexible silicone seal that has pale gray smudges on its surface:
A closer look at the IC shows actual components:
That’s from back when you could see components on an IC…
I soldered wires to the +V and Gnd pins, plus a 10 kΩ pullup resistor to one of the two output pins, applied 5 V from the bench supply, then waved a small neodymium magnet nearby:
The two output pins appear to produce separate-but-equal 50 µs output pulses that are completely independent of the magnet’s proximity, speed, and polarity, which is a Nice Touch. The IC draws about 10 mA when inactive and 12 mA with the magnet nearby.
The form factor seems a bit awkward for a longboard wheel sensor, but it’ll get her closer to the goal. Most likely, it’ll wind up embedded in an epoxy block strapped to one of the wheel trucks.
The Arduino’s Bounce update function / method / whatever has a polled view of the input pin, which means that if you don’t call it during that 50 µs pulse you’ll completely miss that revolution. Sooo, the pulse must go into one of the Arduino’s external interrupt pins, which can catch short pulses with no trouble at all if you write a suitable interrupt handler.
Somewhere I have a handful of Hall effect motor commutation sensors, but they have an internal latch that requires alternating magnetic poles to switch the output, thus requiring two magnets halfway around the wheel circumference. Haven’t figured out how to embed the magnets in the wheels or mount the sensors, but …