Skip to content

ESP32 Hall Sensor Not Working #7721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
moefear85 opened this issue Aug 27, 2021 · 8 comments
Closed

ESP32 Hall Sensor Not Working #7721

moefear85 opened this issue Aug 27, 2021 · 8 comments

Comments

@moefear85
Copy link

I freshly erased an ESP32-Wrover, then flashed v1.16 of micropython. When I call hall_sensor(), it only returns 0. I'm testing it with a strong magnet, which I have moved all around the ESP32, in all thinkable orientations of the magnet. Still, the return value from hall_sensor doesn't even jitter, it remains a solid 0.

@dpgeorge
Copy link
Member

Using latest master building the GENERIC board with ESP IDF v4.2, the hall_sensor() function works for me on a TinyPICO (returns about 40 sitting alone, and up to 70 when a magnet is nearby).

@moefear85
Copy link
Author

Ok... I tried a devkit-C... It gives me readings around 110 when no field, and rises to about 300 when a standard refrigerator magnet is laid directly on the top.

This seems to imply that any value of 0 returned by hall_sensor() almost definately means an error occured, especially if solid. It also seems to imply that neither an ESP32-Wrover, nor an ESP32-S2 have internal Hall Sensors. Let he call me stupid who already knew this :S Perhaps some research may have revealed the ESP32-S2 lacks one, but I thought the ESP32-Wrover was the exact same chip as the ESP32-Wrover, except that the Wrover has an additional PSRAM chip. Seems that's incorrect.

@moefear85
Copy link
Author

As a side note, would be nice if micropython were able to detect the presence/lack of a Hall Sensor and throw an exception instead of 0.

@dpgeorge
Copy link
Member

As a side note, would be nice if micropython were able to detect the presence/lack of a Hall Sensor and throw an exception instead of 0.

The esp32.hall_sensor() function is only included for standard ESP32 chips (ie it's not there on S2, C3, etc). And as far as I know it should work on all standard ESP32's.

It might be that it didn't work on your board because channels 0 and 3 of ADC1 were used for something else.

@moefear85
Copy link
Author

moefear85 commented Aug 30, 2021

No honestly, I'm using factory modules with nothing but the programmer attached. Those pins are free. Yet still I see only 0. I double checked the chips, the Wrover Modules I'm using are ESP32-D0WDQ6 (revision 1). So no idea why it's not working. Unless Wrover Modules internally connect those channels to something else?

I'm starting to think the internal SPIRAM/PSRAM is attached to ADC0/3. Can anyone confirm this?

@Josverl
Copy link
Contributor

Josverl commented Sep 8, 2023

linking Pr that removes the hal_sensor
#11528

@peterhinch
Copy link
Contributor

The PR detail has the comment

The hall sensor is no longer supported by IDF v5.

It also seems to have vanished from the docs. So the only solution is to use old firmware.

@Josverl
Copy link
Contributor

Josverl commented Sep 10, 2023

On the documentation, @jimmo, this was part of our conversation on st documentation,
this is one simple example of changes in functionality that would benefit from some way of documentation that a feature / function has been added or deprecated in version X.Y.Z.

Python docs often have a note describing when a feature was introduced or deprecated.
For example New in version 3.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants