ESP32 Hall Effect Sensor
MOHAMMAD SAIFIQUL AIMAN B MOHAMMAD ALI
192011145
R2427-MICROELECTRONIC ENGINEERING- Detect proximity;
- Calculate positioning;
- Count the number of revolutions of a wheel;
- Detect a door closing;
Here’s a list of parts you need to assemble the circuit
ESP32 DOIT DEVKIT V1 Board
Read Hall Effect Sensor
Reading the hall effect sensor measurements with the ESP32 using the Arduino IDE is as simple as using the hallRead() function. In your Arduino IDE, go to File > Examples > ESP32 > HallSensor:
// Simple sketch to access the internal hall effect detector on the esp32.
// values can be quite low.
// Brian Degger / @sctv
int val = 0;
void setup() {
Serial.begin(9600);
}
// put your main code here, to run repeatedly
void loop() {
// read hall effect sensor value
val = hallRead();
// print the results to the serial monitor
Serial.println(val);
delay(1000);
}
Uploading the Sketch :
Before clicking the upload button, go to Tools Board, and select the board you’re using. In my case. It’s the DOIT ESP32 DEVKIT V1 board. Also don’t forget to select your ESP32’s COM port.
Now, press the upload button.
Then, wait for the “Done uploading.” message:
Testing your project :
Comments
Post a Comment