Hall Sensor Gauss Meter

Arduino noob, using A3144 Hall sensor to make tachometer with Arduino Uno. I am also interested in making a Gauss meter but am aware that not all Hall sensors are linear. However, this tutorial uses a KY-003 Hall sensor which is literally just the A3144 with a 680Ω resistor and an LED. When i copy his exact setup and use his code, I get no change in reading when a magnetic field is present, which really doesn't make any sense regardless of it being a switch or not.

The site: how to make gauss meter using hall effect sensor module — Steemit

I can absolutely send in pictures, but I do have my wiring does exactly as he shows on the site.
The code is also the code on the site.
I have noticed that in the code, it says sensorRead = analogRead(sensorPin);
my intuitive guess is that this is supposed to read the output of the sensor in an "analog" way, regardless of it being connected to digital 10. If i am wrong, totally explain why. Any help is much needed and appreciated. thanks

Looks like an error.
analogRead() does not work on 10, only A0 to A5.
I would change sensor pin to A0,A1,A2,A3 and try it again.

If the code was for a Mega, that does have A0 to A15.
Maybe they started on a Mega, changed to an Uno, and forgot to change the pin.

When I tried using A0 the LCD printed INTENSIT Y ERROR which it is told to do
if (sensorRead >= 1020 || sensorRead <= 3){

Potentiometer is connected to A1, if that matters

That "gauss meter" tutorial is COMPLETELY BOGUS. You can't use 'analogRead(10)' and expect to get a result. I recommend you try to forget everything that tutorial told you.

I'm afraid you will need a linear Hall-effect transducer.

Thanks for you’re honesty!

it does seem unbelievable because it is a Hall switch, but how do you explain his pictures? Or do you think some guy just pieced together a guide using random photos across the web thinking he knew what he was talking about.

Will this work? https://www.amazon.com/Bestol-Ratiometric-Linear-Effect-Sensors/dp/B07DWXCTFL/ref=sr_1_2?dchild=1&keywords=a1302+linear+hall+sensor&qid=1620513684&s=industrial&sr=1-2

I looked at the sources for analogRead() and I believe it treats 10 as a synonym for A2. For pin numbers 14 (A0) and higher it subtracts 14. It then masks off all but the bottom three bits. In binary, decimal 10 is 0b1010. The bottom three bits are 0b010 which is decimal 2.

So analogRead(10) is reading A2, which is not connected.

All of the analog inputs share a common Sample/Hold capacitor. When an analog input is not connected, it doesn't add or remove much charge on the S/H capacitor. Most of the charge on the capacitor will have come from the last time A1 was read. A1 is connected to the 'calibration' potentiometer.

Note: There is even code to report "INTENSITY ERROR!" if you accidently connect A2 to Ground or +5V.

The LCD is displaying 1000 times the difference between the measured voltages at A1 and A2. This will depend mostly on what electrical noise the A2 pin is picking up.

The Hall-effect switch connected to digital pin 10 is not used at all.

One of the reviews says:

Used this with arduino to make a gauss meter and it was all over the place jumping around like crazy maybe it will work for a simpler project but it did not work for me

DigiKey.com has a bunch of linear magnetic sensors from $0.40 on up.
https://www.digikey.com/en/products/filter/magnetic-sensors-linear-compass-ics/554

I understood like 60% of that. Are you saying if I connected the sensor to A2 it would analog read? But that isn't possible because it's a digital sensor right?

How about this? The only review says that the analog output seemed to work well. Has option for both. I think I have heard iffy things about these types of modules though. Let me know, much appreciated. This is all for physics project due next month!

Right. You'd get an 'analog' signal of either very close to 0 or very close to 1023 (LOW or HIGH) because that's what digital signals do. :slight_smile:

Appreciate your patience, I realize I'm asking some redundant questions, but it's great to hear someone who knows what they are saying confirm my understanding. Thoughts on that LM393 49E module?

The Honeywell SS49E looks like it is quite linear from -1000 to +1000 Gauss. The analog input range is 1/5 scale to 4/5 scale so 205 to 819. You can translate to Gauss with:
int Gauss = map(analogRead(HallPin, 205, 819, -1000, 1000);
Note that outside the 205 to 819 range it is likely to be non-linear so values under -1000 or over +1000 should not be used.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.