This is the HC-SR04 ultrasonic distance sensor. This economical sensor provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm. Each HC-SR04 module includes an ultrasonic transmitter, a receiver and a control circuit.
There are only four pins that you need to worry about on the HC-SR04:
VCC (Power) to NodeMCU VinPin
Trig (Trigger) to NodeMCU D1 Pin
Echo (Receive) to NodeMCU D2 Pin
GND (Ground) to NodeMCU GND Pin.
https://www.dofbot.com/post/iot-web-server-based-object-distance-meter-using-ultrasonic-sensor
Comments
Please log in or sign up to comment.