This sensor report covers the A3422xKA Hall-effect, direction-detection sensor from Allegro Microsystems, Inc. The data sheet can be found here. I received samples and was not able to find the cost of purchase.

Like other hall effect sensors, as mentioned in John Schimmel's datasheet, this one also detects a magnetic field and acts as a switch (on/off state). However, it also has the unique capability of being able to determine the direction that the magnet (Allegro recommends a high density ring magnet)is rotating (as you might have guessed by the name). This built in capability is what interested me in the sensor. Although you could accomplish the same goal yourself by using two hall sensors and calculate the direction by which sensor passes you first, Allegro Microsystems has already done the job for you in a very precise way.

The sensor comes with two aligned hall elements inside of it. And although Hall effect sensors are usually used in harsh environments (not affected by dirt like an optical sensor, and using the magnetic field means there's no need for contact), this one seems especially sturdy. There are two versions of the 3422, labeled by the suffix E- or L- that let you know the high end temperature range (both have a low end temperature range of -40˚C). As seen from the chart below the E- can withstand up to +85˚C, but the L- is rated to +150˚C (302˚F)! According to the datasheet the E- is used mostly in industry and the L- in military, though both in automotive.

Intended Applications

Automotive (e.g. tachometer)
Industrial
Military

This sensor is able to handle such a range of voltage (4.5V to 18V) because of a regulater that's built onto the chip. When I first wired the board for this sensor I tried using the power from the rest of the board (using a 5V regulator). I wasn't getting any readings from the sensor even though testing the wires with a multimeter indicated there were 5V going in. I believe that one of the features of the sensor, the under-voltage lockout, was preventing the sensor from turning on. Once I gave it 12V though I started getting readings. I'm including some charts as well as diagrams from the datasheet even though I'm still mulling over the Magnetic Flux Density part. Basically it's a magnetic field, but this site goes into more detail: http://www.answers.com/topic/magnetic-field-density.

MAXIMUM RATINGS
Supply Voltage, VCC18 V
Magnetic Flux Density, BUnlimited
Output OFF Voltage, VOUTVCC
Output Sink Current, IOUT30 mA
Package Power Dissipation, PD500 mW
Operating Temperature Range, TA
Suffix 'E-'-40˚C to +85˚C
Suffix 'L-'-40˚C to +150˚C
Storage Temperature Range, TS-65˚C to +170˚C

MAGNETIC CHARACTERISTICS over operating voltage range.

Characteristic Symbol Test Conditions Min. Typ. Max. Units
Operate Point BOP TA = -40C 85 G
TA = +25C 29 75 G
TA = Maximum 75 G
Release Point3 BRP TA = -40C -85 G
TA = +25C -75 -17 G
TA = Maximum -75 G
Hysteresis Bhys TA = -40C 10 G
TA = +25C 10 46 G
TA = Maximum 10 G
Operate Differential BOP1 - BOP2 60 G
Release Differential BRP1 - BRP2 60 G

NOTES:
1. Magnetic flux density is measured at most sensitive area of device, nominally located 0.0165 (0.42 mm) below the branded face of the package.
2. Typical Data is at VCC = 12 V and TA = +25C and is for design information only.
3. As used here, negative flux densities are defined as less than zero (algebraic convention).

ELECTRICAL CHARACTERISTICS over operating temperature range.

CharacteristicSymbolTest ConditionsMin.Typ.Max.Units
Supply Voltage RangeVCCOperating, TJ < 165C14.518V
Output Leakage CurrentIOFFVOUT = VCC = 18 V<1.010μA
Output Saturation VoltageVOUT(SAT)IOUT = 20 mA0.210.50V
Power-On StatePOSVCC = 0 → 5 V, BRP1 < B < BOP1, BRP2 < B < BOP2OFFOFFOFF
Undervoltage LockoutVCC(UV)IOUT = 20 mA, VCC = 0 → 5 V3.5V
Undervoltage HysteresisVCC(hys)Lockout (VCC(UV)) - Shutdown0.5V
Power-On TimetpoVCC > 4.5 V50μs
Output Rise TimetrCL = 20 pF, RL = 820 Ω200ns
Output Fall TimetfCL = 20 pF, RL = 820 Ω200ns
Direction Change DelaytdCL = 20 pF, RL = 820 Ω0.51.05.0μs
Supply CurrentICCVCC = 8 V, All outputs OFF5.09.018mA

NOTES:
1. Maximum supply voltage must be adjusted for power dissipation and ambient temperature.
2. Typical Data is at VCC = 12 V and TA = +25C and is for design information only.



Magnets

I purchased two types of magnets (both from Radioshack, maybe that was part of the problem) to test out:



Ceramic magnet : Radioshack link



Rare earth magnet : Radioshack link




Quadrature relationship

The datasheet discusses a "quadrature relationship" that needs to be maintained between the sensor and the magnet and I think this is where I'm running into problems. According to a formula they give, the spacing requirements can be satisfied if nT/4 = 1.5 mm, where T is the period of the magnetic field and n is an odd integer. For an example it is stated "ring magnets with pole-pair spacing equal to 6 mm (n = 1), 2 mm (n = 3), 1.2 mm (n = 5), etc. are permitted." Here is my attempt at checking the magnets I have against this:




Testing

As mentioned before, there were initial problems getting any kind of readings from the sensor when supplying only 5V, so I bumped it up to 12V (max is 18V). Here are some pictures of the board:

According to the timing diagram (shown earlier), the information from the pins is digital. I wanted to see what I was actually getting and first tried using a multimeter but soon switched to a digital oscilloscope. Below are my tests for both magnets.

Direction Pin (increments of 5mV)

Video for the ceramic ring magnet

Video for the rare earth magnet

E1Output Pin (increments of 50mV)

Video for the ceramic ring magnet

Video for the rare earth magnet




My Application - PedalPlay

I chose this sensor to use as a tachomter for a stationary bicycle in my project PedalPlay. The basic project idea is to motivate students at a school for children with autism to use the bike in their gym. The method for accomplishing this is connecting the bike to the computer they have in the gym and controlling the playback volume and brightness of a video by the rate the student pedals. The sensor sends the data from the bike to the microcontroller which calculates the range the student is pedaling and in turn sends this to a Max/MSP/Jitter patch that controls the video. The direction sensing is important to me because I need to know if the users pedal backwards and then change the output accordingly.

There were two major hurdles I encountered before getting solid data from my sensor. The first was getting the sensor firmly attached so that when the magnet passed by on the wheel the two would be a set distance apart (about 1/8"). Here is a picture of the encasement I built so that I could mount the sensor on the bike:

As you can see better from this next picture, I have the sensor wired to a shielded cable (normally used for phones) that has six wires and ending in an RJ-11 connector. It worked very nicely for my 5 pin sensor.

Here it is finally mounted on the bike. You can see the magnet near the bottom that slides by the sensor when pedaling begins.

With the RJ-ll connector on the cable and the matching receptor on my microcontroller box it will be very easy for the Occupation Therapists at the school I'm working with to attach the sensor cable. The other half - sending data to the computer and powering the microcontroller - is accomplished nicely by a USB cable. The microcontoller receives about 5V from the computer which is perfect for the chip and enough for the sensor (which needs more than 4.5V). The chip being used here is the PIC18F2550. Thanks to Amit Pitaru for introducing me to the chip and getting me up and running with it.

The second hurdle was figuring out I needed pull-up resistors. Let me repeat that because it's very important: PULL-UP RESISTORS. My numbers were wonky (yes, that's the technical term) and I was trying various values of pull-down resistors. Here is the FAQ sheet on Allegro that proved helpful: FAQs : Digital Hall-Effect Sensors

And finally, a brief video of the project working.

PedalPlay in Action