{"id":28717123,"url":"https://github.com/bocaletto-luca/obstacle-avoiding-robot","last_synced_at":"2026-04-28T01:32:40.050Z","repository":{"id":298792710,"uuid":"1001161367","full_name":"bocaletto-luca/Obstacle-Avoiding-Robot","owner":"bocaletto-luca","description":"Obstacle-Avoiding-Robot - A two-wheel differential drive rover that roams autonomously, uses an HC-SR04 ultrasonic sensor to detect obstacles ahead, and an MPU-6050 IMU to monitor tilt (prevent tipping). On obstacle detection it stops, reverses, turns randomly left or right, then resumes. If it tilts beyond a safety angle, it immediately halts. ","archived":false,"fork":false,"pushed_at":"2025-06-12T23:31:52.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T00:33:23.469Z","etag":null,"topics":["arduino","bocaletto-luca","cpp","obstacle","obstacle-robot","openhardware","opensource","robot","standalone"],"latest_commit_sha":null,"homepage":"https://bocaletto-luca.github.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bocaletto-luca.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-06-12T23:30:53.000Z","updated_at":"2025-06-12T23:33:18.000Z","dependencies_parsed_at":"2025-06-13T00:33:25.722Z","dependency_job_id":"785304ff-a116-44a9-b34b-5bd8f0a34698","html_url":"https://github.com/bocaletto-luca/Obstacle-Avoiding-Robot","commit_stats":null,"previous_names":["bocaletto-luca/obstacle-avoiding-robot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bocaletto-luca/Obstacle-Avoiding-Robot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2FObstacle-Avoiding-Robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2FObstacle-Avoiding-Robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2FObstacle-Avoiding-Robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2FObstacle-Avoiding-Robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bocaletto-luca","download_url":"https://codeload.github.com/bocaletto-luca/Obstacle-Avoiding-Robot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2FObstacle-Avoiding-Robot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259914930,"owners_count":22931333,"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":["arduino","bocaletto-luca","cpp","obstacle","obstacle-robot","openhardware","opensource","robot","standalone"],"created_at":"2025-06-15T03:13:18.091Z","updated_at":"2026-04-28T01:32:40.023Z","avatar_url":"https://github.com/bocaletto-luca.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Obstacle-Avoiding Robot\n\n**Files**  \n- `README.md`  \n- `ObstacleAvoidingRobot.ino`\n\n## 1. Concept  \nA two-wheel differential drive rover that roams autonomously, uses an HC-SR04 ultrasonic sensor to detect obstacles ahead, and an MPU-6050 IMU to monitor tilt (prevent tipping). On obstacle detection it stops, reverses, turns randomly left or right, then resumes. If it tilts beyond a safety angle, it immediately halts.\n\n**Key Behaviors**  \n1. **Forward Patrol** at constant speed.  \n2. **Obstacle Avoidance**:  \n   - If distance \u003c 20 cm ➔ Stop ➔ Reverse ➔ Turn (random) ➔ Resume.  \n3. **Tilt Safety**:  \n   - If roll or pitch \u003e 30° ➔ Emergency stop.\n\n## 2. Bill of Materials  \n- 1 × Arduino Uno (or Nano)  \n- 1 × L298N dual H-bridge motor driver  \n- 2 × DC gear motors + wheels  \n- 1 × HC-SR04 ultrasonic distance sensor  \n- 1 × MPU-6050 6-axis IMU  \n- Chassis, caster wheel, battery pack (7.4 V Li-ion or 6×AA)  \n- Jumper wires, solderless breadboard (optional)  \n\n## 3. Wiring Diagram\n\n    Arduino Uno                L298N Motor Driver         Motor A  \n    ┌──────────────┐           ┌────────────────┐        ┌─────┐\n    │ D2  ─────► IN1 │──►      │ IN1            │──►    │ M+  │\n    │ D3  ─────► IN2 │──►      │ IN2            │──►    │ M-  │\n    │ D5 (PWM)► ENA │──►       │ ENA            │\n    └──────────────┘           └────────────────┘        └─────┘\n\n    Arduino Uno                L298N Motor Driver         Motor B  \n    ┌──────────────┐           ┌────────────────┐        ┌─────┐\n    │ D4  ─────► IN3 │──►      │ IN3            │──►    │ M+  │\n    │ D7  ─────► IN4 │──►      │ IN4            │──►    │ M-  │\n    │ D6 (PWM)► ENB │──►       │ ENB            │\n    └──────────────┘           └────────────────┘        └─────┘\n\n    HC-SR04:\n    ┌──────────────┐\n    │ D8 ──► Trig  │\n    │ D9 ──► Echo  │\n    └──────────────┘\n\n    MPU-6050 (I²C):\n    ┌──────────────┐\n    │ A4 ──► SDA   │\n    │ A5 ──► SCL   │\n    │ 5V ──► VCC   │\n    │ GND─► GND    │\n    └──────────────┘\n\n\u003e **Power:** Drive motors from battery pack; power Arduino and sensors from 5 V regulator.\n\n## 4. Software Setup  \n1. In Arduino IDE install libraries:  \n   - `NewPing` by Tim Eckel  \n   - `I2Cdev` \u0026 `MPU6050` (Jeff Rowberg’s I2CdevLib)  \n2. Create project folder `ObstacleAvoidingRobot` and add both files.  \n3. Open `ObstacleAvoidingRobot.ino` in Arduino IDE.  \n4. Select **Arduino Uno** (or Nano) and correct COM port.\n\n## 5. Operation  \n1. Power on. Robot begins forward at `MOTOR_SPEED`.  \n2. If obstacle \u003c `DIST_THRESHOLD` cm:  \n   - Stops ➔ reverses `REVERSE_TIME` ms ➔ random turn left/right for `TURN_TIME` ms ➔ resumes.  \n3. If tilt \u003e `TILT_LIMIT` ° in any axis:  \n   - Immediate full stop. Re-enable by power-cycle.  \n\n---\n\nSay **continua** to move on to project #7!  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbocaletto-luca%2Fobstacle-avoiding-robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbocaletto-luca%2Fobstacle-avoiding-robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbocaletto-luca%2Fobstacle-avoiding-robot/lists"}