circuitpython-hcsr04.readthedocs.io - CircuitPython HC-SR04 Driver — Adafruit HCSR04 Library 0.2 documentation

Example domain paragraphs

The HC-SR04 is an inexpensive solution for measuring distances using microcontrollers. This library provides a simple driver for controlling these sensors from CircuitPython , Adafruit’s port of MicroPython .

This driver depends on CircuitPython and is designed for use with an HC-SR04 ultrasonic range sensor. You’ll also need to ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle .

The HC-SR04 uses 5V logic, so you will have to use a level shifter between it and your CircuitPython board (which uses 3.3V logic).