Closed ZidongGuo closed 3 years ago
Pick one 1k ohms resistor +one 4.7k ohms resistor as the top half of the voltage divider and one 10k ohms resistor as the bottom half of the voltage divider.
Connect Vcc from the sensor to the 5v power from the Pi, GND from the sensor to GND from the Pi, Trig from the sensor to GPIO5. Connect the Echo from the sensor in series with one leg of the 1k ohms resistor Run in VNC session
sudo piscope
and then run the python script with
python3 hc-sr04.py
Expected result: Show a correct distance between the object in front of the sensor in the command window and see a right pulse in the piscope