Template: Hall Sensor Arduino Guide
From Waveshare Wiki
Revision as of 11:12, 8 October 2021 by Waveshare-eng11 (talk | contribs) (Created page with "The examples provided are based on the Arduino UNO, if you need to use other Arduino boards, please check if the board is compatible with the UNO. ==Hardware connection== Fi...")
The examples provided are based on the Arduino UNO, if you need to use other Arduino boards, please check if the board is compatible with the UNO.
Hardware connection
Hall | Arduino | Description |
---|---|---|
VCC | 5V | Power input |
GND | GND | Ground |
AOUT | A0 | Analog data output |
DOUT | D2 | Digital data output |
Examples
- Please download and install Arduino IDE to your PC.
- Download the demo codes, unzip and find the Arduino examples
- Open the Hall_Sensor.ino file by the Arduino IDE
- Build and upload the codes to the UNO board
- After uploading, you can open the Serial Monitor of IDE and check the data
Expected result
- The indicator of the sensor lights up when the sensor is near the magnet and goes off when it is away from the magnet.
- As the sensor contacts and separates from the metal, the output data of the serial port will change accordingly.