{"id":27784558,"url":"https://github.com/red-x-0/sensor-robot","last_synced_at":"2025-04-30T14:29:02.276Z","repository":{"id":290450757,"uuid":"974494983","full_name":"red-x-0/sensor-robot","owner":"red-x-0","description":"Simple Sensor Robot project","archived":false,"fork":false,"pushed_at":"2025-04-28T22:14:16.000Z","size":219,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T14:28:56.089Z","etag":null,"topics":["embedded-systems","micropython"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/red-x-0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-28T21:41:34.000Z","updated_at":"2025-04-28T22:14:19.000Z","dependencies_parsed_at":"2025-04-28T22:54:33.177Z","dependency_job_id":"33963882-ac09-486e-8ebf-bc5feea05cef","html_url":"https://github.com/red-x-0/sensor-robot","commit_stats":null,"previous_names":["red-x-0/sensor-robot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-x-0%2Fsensor-robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-x-0%2Fsensor-robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-x-0%2Fsensor-robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-x-0%2Fsensor-robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/red-x-0","download_url":"https://codeload.github.com/red-x-0/sensor-robot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251721243,"owners_count":21632795,"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":["embedded-systems","micropython"],"created_at":"2025-04-30T14:29:01.556Z","updated_at":"2025-04-30T14:29:02.270Z","avatar_url":"https://github.com/red-x-0.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Sensor Robot Project\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Embedded%20System-Yes-yellow.svg\" alt=\"Embedded System Badge\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/MicroPython-Enabled-blue.svg\" alt=\"MicroPython Badge\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\" alt=\"MIT License Badge\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Platform-Wokwi-ff69b4.svg\" alt=\"Wokwi Badge\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Status-Completed-brightgreen.svg\" alt=\"Project Status Badge\"\u003e\n\u003c/p\u003e\n\n---\n\n## 📖 Overview\nThis project is a **sensor-driven robot** built using an **ESP32** and **MicroPython**.  \nIt integrates **distance sensing**, **stepper motor movement**, **tilt detection**, and **user feedback** via a **buzzer, LED, and OLED display**.\n\n---\n\n## 🛠 Hardware Components\n\n| Component         | Pin Connections                 |\n| ----------------- | -------------------------------- |\n| LED               | D12 (Output)                     |\n| Button            | D27 (Input, Pull-Up enabled)      |\n| Buzzer            | D15 (Output via Buzzer class)     |\n| Ultrasonic Sensor | Trigger: D5, Echo: D18            |\n| Left Stepper      | STEP Pin: D13 (A4988 Driver)      |\n| Right Stepper     | STEP Pin: D19 (A4988 Driver)      |\n| OLED Display      | I2C (SCL: D22, SDA: D21)          |\n| Accelerometer     | I2C (SCL: D22, SDA: D21)          |\n\n---\n\n## 🧠 Project Behavior\n\n| Action                             | Result |\n| ----------------------------------- | ------ |\n| Startup                            | Displays \"Press button to start\" |\n| Button Press                       | Buzzer beeps once, starts distance measurement |\n| Measures Distance                  | OLED displays distance and calculated steps |\n| Drives Motors                      | Moves robot corresponding to the measured distance |\n| Tilt Detected While Driving        | Stops immediately, lights LED, beeps 3 times, displays \"TILTED\" |\n| Successfully Reached Destination   | Buzzer beeps once, displays \"REACHED\" |\n\n---\n\n## 🧩 Software Organization\n\n| File            | Purpose |\n| --------------- | ------- |\n| `main.py`       | Main control logic for the robot |\n| `buzzer.py`     | Handles buzzer beeping functions |\n| `ultrasonic.py` | Reads distance from ultrasonic sensor |\n| `stepper.py`    | Controls stepper motor movement |\n| `oled.py`       | Manages text display on the OLED screen |\n| `mpu6050.py`    | Reads accelerometer values (AcY axis) |\n\n---\n\n## 📦 Getting Started\n\n\u003e ⚡ **How to run this project:**\n\n1. Go to [Wokwi Simulator](https://wokwi.com/).\n2. Create a new ESP32 project.\n3. **Upload all source files** (`main.py`, `buzzer.py`, `ultrasonic.py`, `stepper.py`, `oled.py`, `mpu6050.py`) into the Wokwi project.\n4. Set up the virtual components according to the **Hardware Components** table above.\n5. Click **Start Simulation** — and you're good to go!\n\n\u003e **Note:**  \nMake sure the filenames match exactly! Wokwi depends on proper file naming for imports to work correctly.\n\n---\n\n## 🎥 Demo\n\n### 📸 Image Preview\n \n![Sensor Robot Preview](image.png)\n\n### 🎮 Wokwi Simulation\n  \n[🔗 Click here to view the live simulation](https://wokwi.com/projects/429302038745236481)\n\n---\n\n## 🔗 Useful Links\n\n- [ESP32 Datasheet](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf)\n- [HC-SR04 Ultrasonic Sensor Datasheet](https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf)\n- [A4988 Stepper Motor Driver Datasheet](https://www.pololu.com/file/download/a4988_DMOS_microstepping_driver_with_translator.pdf?file_id=0J450)\n- [MPU6050 Accelerometer Datasheet](https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf)\n- [MicroPython Documentation](https://docs.micropython.org/)\n\n---\n\n## 📈 Technical Details\n\n- **Microcontroller**: ESP32 Dev Module\n- **Programming Language**: MicroPython\n- **Distance Calculation**: Based on ultrasonic pulse timing\n- **Step Calibration**: 10 steps ≈ 1 cm\n- **Tilt Detection Threshold**: Accelerometer AcY axis \u003e 12000 or \u003c -12000\n- **Buzzer Notifications**:\n  - 1 short beep on start\n  - 3 short beeps on tilt detection\n  - 1 short beep on successful movement\n\n---\n\n## 👨‍💻 Author\n\n| Field       | Details |\n| ----------- | ------- |\n| **Name**    | Sief Ali Sayed Said |\n| **GitHub**  | [github.com/red-x-0](https://github.com/red-x-0) |\n| **Email**   | 463688431@cairo5.moe.edu.eg |\n\n---\n\n## 📜 License\n\n### MIT License\n\n---\n\n## Centemeter to Steps\n\n### You can find the additional criteria for converting Centemeter to Steps in cmToSteps.txt file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred-x-0%2Fsensor-robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fred-x-0%2Fsensor-robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred-x-0%2Fsensor-robot/lists"}