Hall Effect Sensor circuit recommendations.

Discussion in 'General Electronics Chat' started by Derek Emerson, Dec 29, 2017.

  1. Derek Emerson

    Thread Starter Member

    Mar 16, 2016
    41
    1
    Hi all

    I'm new to electronics and even newer to hall effect sensors.

    I am trying to build a circuit that uses a hall effect sensor to detect a magnetic field. I'll give an example of the desired outcome, it's kind of a "Which Hand" effect i.e. I have the sensor hidden in my hand and another person holds a small magnetised object, they put their hands behind their back and place the object in either hand then bring their hands out in front, I am then able to detect which hand the object is in simply by holding the hidden sensor close to either hand, the sensor will activate a small vibration motor to indicate a magnetic field.

    Are there any components that I should consider using with the sensor? in a similar way that LED's should be used with a resistor.

    I also need a way of increasing the sensing range if it is at all possible.

    Any help anyone could provide would be greatly appreciated.

    Regards

    Nelix
     
  2. bertus

    Administrator

    Apr 5, 2008
    19,895
    4,137
    Hello,

    The attached book might interest you.

    Bertus
     
    MrChips likes this.
  3. MrChips

    Moderator

    Oct 2, 2009
    19,111
    6,143
    Sounds like a clever idea. I'm guessing that the magnetic presence will be too weak for the Hall Effect sensor to detect at that distance of separation.
     
  4. MaxHeadRoom

    Expert

    Jul 18, 2013
    18,808
    5,858
    I use the Honeywell SS400 series, they include three basic types or modes of operation.
    Max.
     
    ebeowulf17 likes this.
  5. Derek Emerson

    Thread Starter Member

    Mar 16, 2016
    41
    1
    I'm reading it now, not understanding all of it but I'm reading it non the less :) thanks.

    I had thought about this and was hoping there might be a way to increase the sensitivity of the sensor or use some kind of amplifier in the circuit.

    I have a few that I am going to have a play with as soon as I find a basic circuit that I can use as a base to build from, the 3 I have are as below:

    Allegro Microsystems A1302KUA-T (RS Stock No.680-7504)
    Honeywell Ratiometric Hall Effect Sensor SS495A (RS Stock No.216-6231)
    Honeywell Ratiometric Hall Effect Sensor SS495A1 (RS Stock No.216-6247)

    I've also been looking at these to see if I can use them:

    http://arduinomodules.info/ky-003-hall-magnetic-sensor-module/

    And:

    https://www.sainsmart.com/collectio...ch-magnetic-detector-module-for-arduino-motor

    Cheers
     
  6. MaxHeadRoom

    Expert

    Jul 18, 2013
    18,808
    5,858
    They appear to be linear output type, wouldn't you need the Schmidt trigger out?
    Max.
     
  7. Derek Emerson

    Thread Starter Member

    Mar 16, 2016
    41
    1
    Not sure, I'm hoping that the circuit/sensor will cause the vibration motor to vibrate even slightly if the magnetic field is weak and increase the intensity of the motor as the signal gets stronger.
     
  8. Derek Emerson

    Thread Starter Member

    Mar 16, 2016
    41
    1
    Just stumbled across Magnetometers, these may do the job even better :)
     
  9. ebeowulf17

    AAC Fanatic!

    Aug 12, 2014
    2,933
    640
    Every Hall sensor I've seen with Schmitt trigger output had really wide tolerances on trip points. The ratiometric models have much better accuracy specs. I prefer to use one of them in conjunction with my own comparator or adc input of a microcontroller.

    The down side of using hall effect sensors and magnets here is that both the magnet and the sensors have nulls. If the sensor is in the magnet's null, it won't pick anything up, regardless of how close you get. You'll also see greatly reduced sensitivity if the sensor nulls are lined up incorrectly relative to the magnet. Unless you can control the orientation of the magnet, field strength for remote sensing will be unpredictable. You might be able to mitigate this with a lot of motion, scanning each mystery hand from many angles, but it's something to be aware of.
     
  10. Derek Emerson

    Thread Starter Member

    Mar 16, 2016
    41
    1
    Thanks for the advise I’ll bear that in mind.

    Sounds like you know what your talking about regarding magnets and Hall effect sensors, which way would you go about accomplishing this? I need it to be as small as possible so it is easily hidden in the hand or under a watch strap.
     
  11. ebeowulf17

    AAC Fanatic!

    Aug 12, 2014
    2,933
    640
    Well, I'd probably try hall effect sensors first, just cause it's simpler, and you don't necessarily need a microcontroller to get what you need out of one. Besides, if you already have several, you might as well try some experiments.

    No need to go crazy building the perfect circuit yet. If you've got a 5V power supply, a suitable magnet, and a volt meter (multi meter, etc.) you can get some rough impressions right away. Just hook up power and ground, then measure voltage between output and ground with your meter (alligator clips will make this easier.) Try moving the sensor around while watching the voltage and try to get a sense of how much noise you see on the sensor. I seem to remember getting consistent readings with negligible noise down to 1-2 gauss resolution (3-7mV on the SS495,) but it's been a while since I used one in this way, so I could be remembering wrong.

    Assuming you've got a pretty clean signal, now start moving a magnet near it in different orientations and see how close you have to get to see significant output voltage movement. My gut feeling is that you'll want at least 10mV difference between idle voltage and magnet nearby voltage to avoid noise issues and false triggering. More like 40 or greater would be more comfortable!

    If you can get decent output voltage movement from a reasonable distance, then this is promising, and you can build a simple analog circuit to do what you need.

    If not, it might be time to look at magnetometers. I know very little about them, but the first one I looked up was much more sensitive to low field strengths than a hall effect sensor. They also are three-axis, meaning the combination of sensors won't have any nulls (the magnet still would, but the sensor wouldn't.) The downside is that, at least for what I've found, you have to have a microcontroller. If you're already comfortable working with them, that's great. If not, they're a lot of fun, but can take some time to learn. Might not be worth it for just this project.
     
  12. ebeowulf17

    AAC Fanatic!

    Aug 12, 2014
    2,933
    640
    A couple years ago I developed a simple non-contact dual switch with one magnet and two hall effect sensors.

    Later, I took the analog outputs from an early prototype of that system, fed them into an Arduino and used that to control position of a solenoid (first experiment with proportional solenoid valve concepts, which I'm still working on now, although now presently in conjunction with hall effect sensors.)

     
  13. ebeowulf17

    AAC Fanatic!

    Aug 12, 2014
    2,933
    640
    I do love hall effect sensors... so your question made me curious. I dug out the old parts, did a bit of reassembly, and took some measurements. This rig is using an SS495, which has 3.125mV/Gauss sensitivity.

    With the crummy, noisy, 10-bit ADC built into an Arduino Uno I get up to 7 Gauss (~22mV) of noise. However, if I read the voltage with a DMM, it's rock solid down to within +/-1mV (less than 1 Gauss.) So I think magnetic noise and sensor noise shouldn' be too much of an issue, but your circuit needs to be relatively clean, more like my DMM, and less like my Arduino!

    As for magnetic field strength, with really small magnets (~pencil eraser size,) I have to get within ~1" of the sensor, on axis, to get significant (10 Gauss or better) changes. With a better circuit than my Arduino ADC, you might be willing to sense smaller changes (small magnets at slightly greater distances,) but there's definitely a limit.

    With a larger magnet, maybe about the size of an AA battery, I was able to get good clear readings (10-25 Gauss depending on angle and position) with the sensor in one closed hand and the magnet in the other closed hand, like you'd need to do in your scenario. So, depending on the size of magnet you're willing to work with, there's definitely potential to make this work.

    magnet-hall-gauss.jpg

    ***EDIT:
    I added a "smoothing" formula (sort of a sloppy version of over-sampling) to the Gauss output, and now, even with the lousy ADC performance, noise is down to 1 or 2 Gauss!
     
    Last edited: Dec 29, 2017
  14. Derek Emerson

    Thread Starter Member

    Mar 16, 2016
    41
    1
    Wow, never expected anyone to do some assembly! Thanks it is very much appreciated.

    I’ll hopefully be using a magnet about the size of a £1 coin. I’ll see if I can do some playing on breadboard and report back.

    I have seen a similar idea in action it worked with a range of approx 4” and was even able to tell magnet orientation so I know it is possible, I just need to figure it how to get the range.

    Thanks again everyone
     
  15. ebeowulf17

    AAC Fanatic!

    Aug 12, 2014
    2,933
    640
    Well, I got curious about the limits of the SS495 sensors I play around with, and built an amplifier circuit for it. I've got roughly 100x gain, so instead of 3.125mV, it's now 312.5mV/Gauss. With the amplified circuit going into my Arduino rig, I can now read into the hundreths of Gauss, including measuring the Earth's magnetic field with surprising accuracy.

    Once I had established that the rig was working as expected, I did some tests with magnets. My strongest, most compact magnets are some 1/4" x 1/4" x 1" rare earth magnets we use at work. One of those makes noticeable changes in the sensor reading (~0.1 Gauss) from about 11" away, and reads 1 Gauss from about 4.5" away.

    This system is still a little noisy, wiggling around by up to 0.1 Gauss all on its own, so the readings from 11" would be tough to build a circuit around, but the 1 Gauss (4.5" distance) readings are really solid, well above the noise floor. More importantly, they're above the magnetic field strength of the Earth itself (0.25-0.65 Gauss) which is an obvious limiting factor on how sensitive you can make a magnet detection circuit. If you make it too sensitive, then simply facing the sensor north will trigger it!

    So, it looks like 4.5" range is easily achievable with the sensor you've got, but you may need some amplification on it to get there. Then again, maybe the amplification is only needed for me to easily visualize the signal - now that we know the SS495 is sensitive enough to read reliably at the sub-Gauss level, maybe all you need is a comparator circuit with a very, very precise threshold setting!
     
  16. ebeowulf17

    AAC Fanatic!

    Aug 12, 2014
    2,933
    640
    Here's a rough schematic of today's amp setup (would've been simpler if I had a single supply rail to rail op amp on hand.) Only deviations from sim to real world were a trim pot between R1 and R3 to fine tune my reference voltage, and a 0.3uF capacitor added in parallel with R6 to filter a bit of the noise. I've got very little op amp experience, so I'm pleasantly surprised with how well this worked!
    Hall-Gauss-Amp_03b.png
    And here's the real circuit in action, along with that little magnet on a notebook ruler for scale:
    IMG_4046.JPG
     
  17. Derek Emerson

    Thread Starter Member

    Mar 16, 2016
    41
    1
    That all sounds and looks like it's working a treat. As previously mentioned, I'm new to electronics so what your describing is going to be a steep learning curve for me.

    I tried breadboarding some of the Sensors and did not have great success, I didn't, however, use an op-amp.

    I'm not sure that the voltages that your seeing will be sufficient to accomplish what I am after. The vibration motor I'm using is 3v.

    The solution that I have seen previously was extremely small (See pic). It's slightly different in that it does not have a vibro motor but a transmitter instead which triggers a vibro motor in a receiver. It does, however, have a re-rechargeable battery in it as well which is charged via USB.

    IMG_1412 Crop.jpg

    I have also done some research into the magnetometers that I mentioned above, I am unable to find one that has analogue outputs so I am assuming I will need some kind of logic circuit it interpret the digital outputs which in turn will increase the size of the finished design :(
     
  18. ebeowulf17

    AAC Fanatic!

    Aug 12, 2014
    2,933
    640
    I wouldn't worry too much about the size issue just yet. Getting down to the size shown in your pic would be pretty difficult, but we can get pretty small without a great deal of difficulty, maybe double that size?

    Unfortunately, I've made a new discovery in the analog hall effect sensor. When I leave the system running for a while a get drift in the zero point. At first I thought it was problems with my amp circuit or Arduino input, but I believe I've narrowed it down to bring the null drift as a function of temperature. In other words, if the sensor itself gets warmer or cooler, the voltage output for zero Gauss moves. When using the sensor in its intended range (+/-670 Gauss,) this drift is tiny and can be mostly ignored. But when you amplify that drift by 100x, it becomes fairly significant. I'm seeing drift of 2-3 Gauss, which means my earlier estimate of being able to reliably detect 1 Gauss fields is probably not realistic.

    Based on the null drift discovery, I think your best bet would probably be a magnetometer.

    How do you feel about programming? Any experience? Any interest in learning? If you'd only ever need it for this one project, it would probably be a hard sell, but if you think you might have more projects in the future that would benefit from precision sensors, wireless communications, etc. then it might be worth the learning curve.

    The world of microcontroller programming has many separate branches, all with their own pros and cons. I work in the Arduino environment, and buy a lot of my stuff through Adafruit, because they have many products tailored towards more compact installations, integrated battery control, etc.

    Some example items that would get you most of the way to what you need:

    https://www.adafruit.com/product/2772

    https://www.adafruit.com/product/1120

    https://www.adafruit.com/product/2750

    You can make things more compact by designing your own boards and integrating everything into one board, but you only really come out ahead of you're willing to solder surface mount parts, which is pretty challenging. For a beginner wanting to get started, you're probably better off working with breakout boards and pre made microcontroller boards like the ones above. The result won't be quite as compact as what an expert could achieve, but you're much more likely to actually make it work!

    If you have any interest at all in going the microcontroller / programming route, you can get lots of help here, on the Arduino forums, and on the Adafruit forums.

    If you'd prefer to stick to analog, in not sure anymore where the sensing threshold is, but it's gotta be above 2-3 Gauss just to get past sensor drift. I don't know if that's a deal breaker, but it does mean closer range or even stronger magnets.
     
    Derek Emerson likes this.
  19. Derek Emerson

    Thread Starter Member

    Mar 16, 2016
    41
    1
    I have been toying with the idea of going down the Auduino route for a while, I'm have not done any programming for about 30 years and then it was only in BASIC and a very slight introduction to PASCAL. I understand the Magnetrometer uses I2C which is similar to C programming language. I do have a few more idea's/projects that I would like to get off the ground so might take the plunge and start learning.

    I have created my own circuit boards from schematics in the past and had them printed and am also experienced with a soldering iron, even so, Surface-mount can still be difficult.

    I'll take a look at those parts that you listed and report back if I have any success/fail miserably :)

    Thanks for your help and advice, it's much appreciated.
     
  20. ebeowulf17

    AAC Fanatic!

    Aug 12, 2014
    2,933
    640
    When started working with Arduinos (4 years ago?) I was in the same boat, BASIC programming experience from when I was a little kid 30 years earlier. Even that small amount of experience helps!

    I'd recommend following tutorials and studying sample sketches from Arduino and Adafruit websites. More importantly, I'd strongly advise against trying instructables, hack-a-day, and some of the other websites which offer user-submitted, unverified information. Instructables has so many detailed tutorials that are just plain wrong. You could drive yourself crazy trying to learn anything useful there.

    Also, you don't necessarily have to learn all the I2C communication stuff. Most Adafruit products (as well as many, many others from other developers) have libraries already written that handle that all that for you. The better programmers here complain that the libraries tend to be slow, incomplete, inefficient, etc. That's probably all true, but more often than not, if you don't need maximum efficiency, they'll get the job done with much less effort. You can always customize libraries too, but having a starting point is still often easier than starting from scratch.
     
    Derek Emerson likes this.
Loading...