ESP32 Dev Module hall Sensor issues

Lillithet
Posts: 1
Joined: Wed Sep 02, 2020 6:36 pm

ESP32 Dev Module hall Sensor issues

Postby Lillithet » Thu Oct 08, 2020 6:12 pm

I am having issues with the hall sensor of the ESP32.

When I do hallRead() (arduino IDE) I mostly a value around 20, occasionally (every 9ish reads on average) I get a value > 220. Is there a reason for this? Is there any way to electronically fix this? Software wise I take an average of 5 values, which would be fine if the "triggered" sensor would deliver a high enough value. Unfortunately the triggered value is about 60 or -20 (so 40 more or less depending on the magnet side) when I hold the magnet directly against the case. Is this a normal value? What are the possible reasons that this is so low?
I've also noticed when the Inputs 36 and 39 are connected to 3.3, the hall sensor drops far enough that the measured value is not noticeably at a triggered state when close to the magnet, why is this?
On a completely different note, I also had issues with inputs 39 and 36 when in INPUT_PULLUP mode, where pulling them to low would also pull the other pin as well as pin 23, why does this happen?

Any insight to these issues would be greatly appreciated.

Thanks in advance.

becorey
Posts: 92
Joined: Sat Mar 28, 2020 4:18 pm

Re: ESP32 Dev Module hall Sensor issues

Postby becorey » Mon Nov 09, 2020 6:30 am

If it's always a glitch for a single reading, you could detect that and throw out the glitch reading. The real magnet should give you the measurable quantity for several readings in a row. That could be your criteria for detecting the magnet. Don't just average the previous 5 readings, but check if it is stable for ~3 readings in a row.

Who is online

Users browsing this forum: No registered users and 110 guests