|
CLASS DOCUMENTS
REPORTS & ASSIGNMENTS
CLASS CONTENT
USING THIS SITE
registered authors login here You are: (logout) For more on PMWiki, see pmwiki.org |
Hall Effect Direction Detection SensorThis 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 ApplicationsAutomotive (e.g. tachometer)
![]() MAGNETIC CHARACTERISTICS over operating voltage range.
NOTES: ELECTRICAL CHARACTERISTICS over operating temperature range.
NOTES: MagnetsI purchased two types of magnets (both from Radioshack, maybe that was part of the problem) to test out: ![]()
![]()
![]()
Quadrature relationshipThe 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: ![]()
TestingAs 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 - PedalPlayI 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. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||