hcsr04sensor - Python Module

Donate | PDF Manual

Fork Star Issue Watch

HCSR04 Sensor

Installing hcsr04sensor

sudo apt install python3-pip python3-rpi.gpio
sudo pip3 install hcsr04sensor

Contributing

The python hcsr04sensor module source code is available on Github.

Description

Use Python to calculate distance, depth and volume measurements with an HCSR04 Ultrasonic Sound Sensor and a Raspberry Pi. The module also works with a waterproof JSN-SR04T sensor.

The module does the following;

Connecting the Sensor

The HCSR04 sensor has four pins.