This project is for my Artificial Intelligence subject in my school and it's my first Arduino project, so I would like to share this project with you.Materials for this Project
Arduino Uno | Get it here
Motor Driver Shield | Get it here
2 Wheel Car Chasis | Get it here
Servo Motor | Get it here
Ultrasonic Sensor | Get it here
First build the Arduino robot chassis. The kit contains the chassis, two motors with the wheels attached, a front wheel, a battery holder, some screws and wires.
Solder the thick black and red wires at the motors.
Attach the front wheel. After, attach the rear wheels according to the instructions leaflet that comes with kit.
The next step is to attach the switch to the battery holder. Cut the battery holder black wire and solder the one end to separate side of the switch. Our switch is ready. Then attach it to the battery holder using the screw that comes with the chassis kit.
The next step is to connect the motors. We connect the left motor to the M1 connector of the shield like this. We connect the right motor to the M3 connector of the shield this way.
Move on to the motor shield. This shield provides power to the motors and the servo motor, and makes our project easier. The motors need a lot of current, and this shield can provide up to 600mA of current to each motor, that’s why we need it. We have to solder 4 wires to the motor shield. These wires will be then connected with the supersonic sensor. We solder one to 5V, one to GND, one to Analog Pin 5, and the last one to analog pin 4.
Next we attach the motor shield to the Arduino Uno board. With a double sided tape, attach the Arduino Uno and the battery holder to the chassis. With a double sided tape, also attach the supersonic sensor to the servo motor, and both of them to the robot chassis. I used a hot glue gun to attach the servo motor to the chassis.
We need to follow these steps to configure the supersonic sensor.Step 1
Supersonic sensor. Vcc goes to 5V via the wire we attached earlier. GND goes to the GND wire. ECHO pin goes to Analog Pin 5, and TRIG pin goes to Analog Pin 4.Step 2
Next, to connect the power. We connect the black wire from the switch to the motor shield. It goes to the GND pin of this external power connector. The red wire from the switch goes to the M+ connector. If we open the switch, we can see that the green LED lights up, the Arduino is receiving power from the batteries.
Lastly we connect the servo motor to the servo_2 slot. The darker color on the right end side red in the middle and orange in the left side order.
The code uses three libraries. Two of them must be downloaded in order the program to compile. The first one is the motor shield driver from Adafruit. The second library is the NewPing library for the supersonic distance sensor. You can find the links for both libraries in here:
To give support on this channel.
Like and Follow.