{"id":21305555,"url":"https://github.com/git-utkarsh/obstacle-avoiding-robot","last_synced_at":"2025-03-15T19:28:03.289Z","repository":{"id":206221600,"uuid":"715564054","full_name":"Git-Utkarsh/Obstacle-Avoiding-Robot","owner":"Git-Utkarsh","description":" This Arduino code utilizes an ultrasonic sensor to measure distances. When an object is detected within a fix distance , the connected motors trigger a sequence: move backward, turn right, turn left, then move forward. Motor control is achieved using the AFMotor library, and the distance calculation is based on the sensor's pulse duration.","archived":false,"fork":false,"pushed_at":"2024-01-22T15:47:59.000Z","size":4014,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T08:44:18.653Z","etag":null,"topics":["arduino","l293d","obstacle-avoidance","obstacle-avoidance-robot","obstacle-detection","ultrasonic-sensor"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Git-Utkarsh.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}},"created_at":"2023-11-07T11:56:16.000Z","updated_at":"2024-03-02T14:00:22.000Z","dependencies_parsed_at":"2023-11-20T05:22:14.365Z","dependency_job_id":"fdb3e07d-13f2-4761-af82-a157e1576d5d","html_url":"https://github.com/Git-Utkarsh/Obstacle-Avoiding-Robot","commit_stats":null,"previous_names":["git-utkarsh/robotics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Git-Utkarsh%2FObstacle-Avoiding-Robot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Git-Utkarsh%2FObstacle-Avoiding-Robot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Git-Utkarsh%2FObstacle-Avoiding-Robot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Git-Utkarsh%2FObstacle-Avoiding-Robot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Git-Utkarsh","download_url":"https://codeload.github.com/Git-Utkarsh/Obstacle-Avoiding-Robot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243780003,"owners_count":20346793,"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","l293d","obstacle-avoidance","obstacle-avoidance-robot","obstacle-detection","ultrasonic-sensor"],"created_at":"2024-11-21T16:18:22.399Z","updated_at":"2025-03-15T19:28:03.268Z","avatar_url":"https://github.com/Git-Utkarsh.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Award Winning Obstacle Avoidance Robot\n\u003cimg width=\"540\" alt=\"github\" src=\"https://github.com/Git-Utkarsh/Obstacle-Avoiding-Robot/assets/84007458/7aeda056-1576-4711-8bd8-979557bbe6c9\"\u003e\n\n## Description\n\nThis Arduino code implements an object avoidance mechanism using an ultrasonic sensor and a four-wheeled robot with individual motors. When an object is detected within 15 cm, the robot performs a predefined sequence: it moves backward, turns right, turns left, and then moves forward. Motor control is facilitated through the AFMotor library, while the distance calculation relies on the pulse duration from the ultrasonic sensor.\n\n## Components Used\n\n- Ultrasonic Sensor\n- AFMotor Library\n- Motor Shield\n- Four DC Motors (M1, M2, M3, M4)\n- Arduino Board\n\n## Circuit Setup\n\n![circuit](https://github.com/Git-Utkarsh/Obstacle-Avoiding-Robot/assets/84007458/781412bb-f07f-4280-b765-7d485bdd2650)\n\u003cimg width=\"596\" alt=\"image\" src=\"https://github.com/Git-Utkarsh/Obstacle-Avoiding-Robot/assets/84007458/b0042fcc-5bce-4545-8022-7ba2c903a563\"\u003e\n\n1. Connect the ultrasonic sensor's trigPin to A2 and echoPin to A3 on the Arduino.\n2. Connect the four DC motors to the motor controller, assigning each to motorM1, motorM2, motorM3, and motorM4.\n3. Ensure the AFMotor library is installed in your Arduino IDE.\n\n## How It Works\n\nThe Arduino continuously measures the distance using the ultrasonic sensor. When an object is detected within 15 cm, it triggers a sequence of movements to avoid the obstacle: move backward, turn right, turn left, and then move forward. Motor speed and direction are controlled through the AFMotor library.\n\n## Usage\n\n1. Upload the provided code to your Arduino board.\n2. Ensure the hardware setup is correct.\n3. Power up the robot.\n4. Observe the robot's behavior in response to obstacles within its detection range.\n\nNote: Adjustments to motor speeds and delay times can be made in the code to optimize performance for your specific robot.\n\nFeel free to contribute by forking the repository and submitting pull requests.\n\n\nhttps://github.com/Git-Utkarsh/Obstacle-Avoiding-Robot/assets/84007458/88f2c774-79d2-4136-abfd-49cb82a730f3\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-utkarsh%2Fobstacle-avoiding-robot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgit-utkarsh%2Fobstacle-avoiding-robot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-utkarsh%2Fobstacle-avoiding-robot/lists"}