Is there a way to test the Hall sensor for hardware failure? Maybe to connect directly to it?
I have tried the Example Hall sensor but I get only noise (it looks like a disconnected pin). My ESP32-EVB is OK as the other examples work nicely.
Any suggestions would be much appreciated! Thank you very much in advance.
How to check the Hall sensor?
-
- Posts: 828
- Joined: Mon Jul 22, 2019 3:20 pm
Re: How to check the Hall sensor?
Does it work better if you do?
Code: Select all
#include "driver/adc.h"
Serial.println(hall_sensor_read());
Re: How to check the Hall sensor?
Thank you very much lberstone.
I am sorry to say that the output continues to be a noisy signal.
This is such a simple code so I must be overlooking something basic or else there is a faulty hardware, which usually is not the case. Should I fetch the "driver/adc.h" from some specific place? Here is my code now.
I am sorry to say that the output continues to be a noisy signal.
This is such a simple code so I must be overlooking something basic or else there is a faulty hardware, which usually is not the case. Should I fetch the "driver/adc.h" from some specific place? Here is my code now.
Code: Select all
//Modified sketch to access the internal hall effect detector on the ESP32.
// DLC 20190812 by JSP
#include "driver/adc.h"
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(hall_sensor_read());
}
//Re: How to check the Hall sensor?
//Postby lbernstone » Mon Aug 12, 2019 5:31 am
//
//#include "driver/adc.h"
//Serial.println(hall_sensor_read());
-
- Posts: 828
- Joined: Mon Jul 22, 2019 3:20 pm
Re: How to check the Hall sensor?
The hall sensor uses pins 36 and 39 in operation. It looks like the esp32-evb uses those pins (U1RXD and IR_RX). https://docs.espressif.com/projects/esp ... eading-adc. If you buy a cheaper dev board without so many fancy gadgets the hall sensor should work.
Re: How to check the Hall sensor?
Also from that link:
The ADC1 module must be enabled by calling adc1_config_width() before calling hall_sensor_read(). ADC1 should be configured for 12 bit readings, as the hall sensor readings are low values and do not cover the full range of the ADC.
Code: Select all
adc1_config_width(ADC_WIDTH_BIT_12);
Who is online
Users browsing this forum: Google [Bot] and 45 guests