Skip to main content

Simple module to access HCSR04 sensor on RaspiPi

Project description

HC-SR04 Ultrasonic Sensor on Raspberry Pi

A simple module for calculating distance in centimeters, using an HC-SR04 sensor and a Raspberry Pi.

Install

pip install hcsr04sensor

Description

The module does the following;

  • Returns an error corrected distance by using the median reading of a sorted sample.

  • Rounds the value to a specified decimal place.

  • Adjusts the reading based on temperature by adjusting the speed of sound.

Usage

See example scripts in https://github.com/alaudet/hcsr04sensor/tree/master/examples.

Access to Raspberry Pi GPIO pins require elevated priviledges. Run example scripts with sudo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hcsr04sensor-1.0.2.tar.gz (2.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page