Final Project Idea – Collision and Edge Detection Robot with Arduino and p5.js

Concept

The aim of this project is to create a robot that can avoid collisions and sudden edges while moving around. The robot will be controlled using an Arduino board and p5.js, a JavaScript library for creative coding. The robot will be equipped with an ultrasonic distance sensor and an infrared sensor to detect collisions and edges respectively. The robot will have two different modes of operation which can be controlled using serial communication between the Arduino and p5.js. One mode will allow the robot to roam freely, while the other mode will allow the user to control the robot using keys on the computer. The movement of the robot will be mapped onto the p5.js canvas.

Implementation

One of the Arduino boards will be connected to the computer which receives serial information from p5 and transmits them over to the other Arduino board. This is a two way link communication between the robot and the computer. The ultrasonic distance sensor will be connected to the servo motor, which will rotate the sensor to scan the environment. The infrared sensor will be attached to the front of the robot chassis to detect edges. The robot moves around using regular motors and wheels. Whenever an edge is detected or the distance sensor senses a possible collision, it starts moving backward in order to avoid imminent danger. It also transmits back the movement data that is later displayed in the form of a path in the p5 canvas.

Leave a Reply