Hall Effect sensor?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
uxhamby
Posts: 34
Joined: Thu Nov 14, 2019 9:47 pm

Hall Effect sensor?

Post by uxhamby » Sat Dec 21, 2019 12:05 am

All ESP32 chips have a built-in hall effect sensor, used to measure a prevailing magnetic field.

As I understand things, it is inherent to the chip itself and is not a peripheral, so presumably the field must be local to the chip.

In the Arduino IDE, I am told, it is straightforward to measure the output of the hall effect sensor using a dedicated 'HallRead()' function.

I haven't been able to find any mention of it in the MicroPython docs or with some dedicated Googling around.

Does MicroPython support it?

Thanks,

Brian H.

DJShadow1966
Posts: 60
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: Hall Effect sensor?

Post by DJShadow1966 » Sat Dec 21, 2019 6:28 am

Hello

Code: Select all

esp32.hall_sensor()     # read the internal hall sensor
Taken from http://docs.micropython.org/en/latest/e ... ckref.html

Regards Mike

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Hall Effect sensor?

Post by pythoncoder » Sat Dec 21, 2019 6:30 am

I believe the sensor is not very sensitive. For accurate measurements you're best off with an IMU device (inertial measurement unit), which will actually supply a vector - obviously at some cost in money and complexity.

Drivers for various devices are available on this site.
Peter Hinch
Index to my micropython libraries.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Hall Effect sensor?

Post by stijn » Sat Dec 21, 2019 9:32 am

Not all IMUs have a hall sensor I think? But depends on what the topic starter wants to do; if it's really about measuring magnetic field values then money might be better spent on a dedicated and calibrated sensor instead of paying extra for the unused features in an IMU.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Hall Effect sensor?

Post by pythoncoder » Sun Dec 22, 2019 8:05 am

Fair point: you need a 9DOF IMU. It's possible that the high production volumes of IMU's make them cost effective compared to dedicated magnetometers but I haven't investigated. The other advantage is that drivers exist. Devices like the MPU9250 produce a vector in units of μT. The driver enables the magnetometer to be calibrated by the usual method of rotation.
Peter Hinch
Index to my micropython libraries.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Hall Effect sensor?

Post by stijn » Sun Dec 22, 2019 8:33 am

Seeing prices in the range of 10$: yes it's going to be hard to beat that. I only briefly checked the specs but it seems something like an MPU9250 doesn't come with a dedicated temperature sensor along with the hall sensor so getting accurate absolute values out of it is not possible. Then again, for pure hobby projects and/or with the chip always running at roughly the same temperature this is normally not needed.

uxhamby
Posts: 34
Joined: Thu Nov 14, 2019 9:47 pm

Re: Hall Effect sensor?

Post by uxhamby » Fri Dec 27, 2019 4:54 pm

DJShadow1966 wrote:
Sat Dec 21, 2019 6:28 am
Hello

Code: Select all

esp32.hall_sensor()     # read the internal hall sensor
Taken from http://docs.micropython.org/en/latest/e ... ckref.html

Regards Mike
Thanks.

Post Reply