M5StickC Hall Sensor not working
-
You can't read the Hall Sensor on the M5StickC.
According to the ESP32 manual the internal hall sensor on the ESP32 is connected to the analog channels on pins GPIO36 and GPIO39.
The ESP32 document note reads: "It is also possible to read the internal hall effect sensor via ADC1 by calling dedicated function hall_sensor_read(). Note that even the hall sensor is internal to ESP32, reading from it uses channels 0 and 3 of ADC1 (GPIO 36 and 39). Do not connect anything else to these pins and do not change their configuration."
The M5StickC uses pin GPIO39 as the hardware button pin B switchingthe stick on and off (always monitoring for a 6 sec press) , GPIO36 is brought out to the connector at the top of the device and there is no schematic showing it has no internal strings attached ..
-
I'm find this project, and in get date from Hall sensor, using MicroPython and M5 libs:
https://m5stack.hackster.io/Max-Lavrov/hall-sensor-and-temperature-sensor-in-esp32-934ba8 -
What is the Hall sensor actually measuring in that example? I dont see any evidence of a changing external magnetic field. Also I wonder if it's a problem that there is also a magnet in the M5StickC case.
-
It's simple, fill in the code from the example, hold the magnet to the M5stickC and you will see that the readings will change significantly! The magnet is needed strong enough, because The sensor is far away in the device.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login