ESP32 Hall Effect Sensor Not Working

I used a simple sketch from dronebot workshop YouTube channel to test my new ESP32. Unfortunately the serial plotter just shows noise even when there is a magnet. But when touching the SN and SP pins, the value drops as if it's a touch sensor. I used the hallread() statement

Hello
Does the logic level of sensor match to the ESP?

I'm not sure. I'm trying to use the integrated sensor and not an external one.

Your post was MOVED to its current location as it is more suitable.

Hi,
I think we need some more info.

Can you please post your code?
Can you please post a circuit diagram?
Can you please post a link to data/specs of the Hall Effect Sensor?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

ESP32 Touch Sensor API.

A touch sensor system is built on a substrate which carries electrodes and relevant connections under a protective flat surface. When a user touches the surface, the capacitance variation is used to evaluate if the touch was valid.

Code:

int val = 0;
void setup() {
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
val = hallRead();
// print the results to the serial monitor:
//Serial.print("sensor = ");
Serial.println(val);//to graph
}

There is NO circuit diagram as I am using integrated sensor. Also the hall sensor is IN the chip and doesn't have a datasheet

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

I posted a link the the API and it is NOT a hall sensor but a capacitive touch sensor as per the link to the API I posted.

Hi, @bheeduino

Can you post a diagram showing how you have it connected to the controller and how you are powering your project.

And post a link to where you purchased it?

Tom... :smiley: :+1: :coffee: :australia:

There is no hall sensor.

The ESP32 has several touch sensor pads on portB, as per the documentation link I posted. The OP is using the capacitive touch sensor pads as a hall effect device. Hopefully, you can see how a capacitive touch sensor pad does not work like a hall effect switch. The OP is confused in thinking that a magnet operates a capacitive touch sensor switch.

Hi,
I would say the OP needs to look at this;

Tom... :smiley: :+1: :coffee: :australia:

It seems that not everyone agrees with you

Nor are they agreeing with the ESP32's API.

Not even this part of the ESP32 API reference ?
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/adc.html?highlight=hall

Owie, YOU ARE A WINNER!!!

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. Otherwise it may affect the measurement of low value signal from the sensor.

Though, I still do not consider the touch sensors as hall effects over capacitive touch sensors and good luck to you in getting them to work as much else..

I will definitely try the hall_sensor_read() function. Thanks