{"id":21853563,"url":"https://github.com/lupin3000/micropython-i2c-urm09","last_synced_at":"2026-05-08T03:49:00.589Z","repository":{"id":233285775,"uuid":"786449790","full_name":"Lupin3000/Micropython-I2C-URM09","owner":"Lupin3000","description":"MicroPython I2C library and example for Gravity: URM09 Ultrasonic Sensor","archived":false,"fork":false,"pushed_at":"2024-04-14T14:05:15.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T13:31:26.219Z","etag":null,"topics":["dfrobot","esp32","gravity","i2c","micropython","sensor","ultrasonic-sensor"],"latest_commit_sha":null,"homepage":"https://softwaretester.info","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lupin3000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-14T13:58:23.000Z","updated_at":"2024-04-14T14:01:33.000Z","dependencies_parsed_at":"2024-04-15T14:21:46.648Z","dependency_job_id":"ca4e5f9d-2b91-4e53-84d9-1e2a327c6a38","html_url":"https://github.com/Lupin3000/Micropython-I2C-URM09","commit_stats":null,"previous_names":["lupin3000/micropython-i2c-urm09"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lupin3000%2FMicropython-I2C-URM09","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lupin3000%2FMicropython-I2C-URM09/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lupin3000%2FMicropython-I2C-URM09/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lupin3000%2FMicropython-I2C-URM09/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lupin3000","download_url":"https://codeload.github.com/Lupin3000/Micropython-I2C-URM09/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244852133,"owners_count":20521151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dfrobot","esp32","gravity","i2c","micropython","sensor","ultrasonic-sensor"],"created_at":"2024-11-28T01:25:42.992Z","updated_at":"2025-10-12T19:48:04.571Z","avatar_url":"https://github.com/Lupin3000.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MicroPython I2C library and example for Gravity: URM09 Ultrasonic Sensor\n\nThis repository contains the MicroPython I2C library for the Gravity: URM09 Ultrasonic Sensor from DFRobot, as well as a very simple example of how to use it. The original repository from DFRobot is located [here](https://github.com/DFRobot/DFRobot_URM09) (_for Arduino and Raspberry Pi_).\n\n## Why this repository?\n\nThe original version of DFRobot uses Python serial (_UART_) and Python SMBus (_I2C_), which are not compatible with MicroPython. Also, I was not so happy with the Python code style/quality. That's why I created this version.\n\n## Prerequisite\n\n- [Gravity: URM09 Ultrasonic Sensor](https://www.dfrobot.com/product-1832.html?tracking=Mszf2HlGMStAAKkFfhNgg3QhFFchlilhR47u9vXX9o9Ko6giJYRJQdmwZjbDIvMV)\n- ESP32 (_MicroPython compatible device_)\n- MicroPython firmware installed (_min. 1.20.0.*_)\n- USB cable (_for connection between ESP32 and sensor_)\n- latest [VCP](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads) driver installed\n\n![Ultrasonic.jpg](img/Ultrasonic.jpg)\n\n## Installation\n\nClone this repository to your local computer.\n\n```shell\n# clone repository\n$ git clone https://github.com/Lupin3000/Micropython-I2C-URM09.git\n\n# change into local repository folder\n$ cd Micropython-I2C-URM09/\n```\n\nYou can optionally install other helpful Python packages.\n\n- esptool (_to flash the MicroPython firmware to the ESP32_)\n- rshell (_to establish a serial connection between the local computer and the ESP32 and to transfer data_)\n- micropython-esp32-stubs (_to facilitate local development, for example: code completion_)\n\n```shell\n# install python packages (optional)\n$ pip install -r requirements.txt\n```\n\nConnect the sensor to the ESP32. Make sure that you have set the communication mode on the sensor to I2C and use the correct connections (_ESP GPIO's/Sensor interface_)! Only then connect the ESP32 to your local computer via USB.\n\n\u003e In the example `main.py`, the GPIOs pins 21 (_SDA_) and 22 (_SCL_) are used. However, you can adapt these to your needs at any time.\n\nThen start the serial connection and load the example and the library onto the ESP32 device.\n\n```shell\n# start rshell connection\n$ rshell -p /dev/cu.usbserial-0001\n\n# upload files and folder\n/YOUR/LOCAL/PATH\u003e cp main.py /pyboard/\n/YOUR/LOCAL/PATH\u003e cp -r lib/ /pyboard/\n```\n\n\u003e The example device/path `/dev/cu.usbserial-0001` could be different for you! Please adapt before your execute the commands!\n\n## Usage\n\n```shell\n# start the Python REPL\n/YOUR/LOCAL/PATH\u003e repl\n```\n\nNow press the keys `CTRL` + `d` on your local device, to trigger the soft-reset of the ESP32. If there are no errors, you should see the GNSS values in the terminal after a very short time.\n\n```python\nEntering REPL. Use Control-X to exit.\n\u003e\nMicroPython v1.22.1 on 2024-01-05; Generic ESP32 module with ESP32\nType \"help()\" for more information.\n\u003e\u003e\u003e \n\u003e\u003e\u003e \nMPY: soft reboot\n```\n\nIf you have an object in given range (_no object in range means -1_), the output looks similar to this example:\n\n```python\n---\n####################\nDistance: 18 cm\nTemperature: 24.9 °C\n```\n\nAdditional information:\n\n- [DFRobot: Product Wiki](https://wiki.dfrobot.com/URM09_Ultrasonic_Sensor_(Gravity-I2C)_(V1.0)_SKU_SEN0304)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flupin3000%2Fmicropython-i2c-urm09","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flupin3000%2Fmicropython-i2c-urm09","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flupin3000%2Fmicropython-i2c-urm09/lists"}