This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com).
In this tutorial you will learn how to make a fully automated robot named Rob who is equipped with sensors that allow it to detect obstacles. Rob moves until he comes into contact with an obstacle and then he stops, checks his surroundings and continues on a path that is free from obstacles.
To create this robot, a knowledge of Arduino and C++ isn’t necessary but it does help!
Let’s get started!
Step 1: What You Will Need
For this project, you will need:
- Arduino UNO x1
- Motor Shield x1
- Breadboard x1
- DC Motors x4
- Wheels x4
- HC-SR04 Ultrasonic Sensor x1
- 9-V battery Holders x2
- Micro Servo Motor x1
- 9V Batteries x2
- Electrical Tape
- Black Box x1
- Touch Sensor x1
- Hot Glue Gun
- Soldering Iron
- 3-D Printer
- Wire Cutters
Step 2: Prepare Wheels
Take the wheel and position it onto the white pin found on the opposite side of the copper tabs on the DC motor. The wheel should stay on tightly and spin freely along with the DC Motor.
To check if the wheels are functioning properly, place each of the wires that were soldered onto each DC motor onto the positive and negative terminals of a 9-V battery. The wheel should spin.
Step 3: Preparing 3D Printed Components
Using a 3-D Printer, print the following .stl files. The part files are also included in case there is a need to alter the design.
Step 4: Set Up Motor Shield
Connect the motors that will be control the left wheels onto the M1 and M2 ports and the right wheel motors onto the M3 and M4 ports.
If a motor is running backwards, simply switch the wires on the Motor shield port for that wheel. (Essentially switching the positive and negative connections).
Solder long Wires onto the +5V, Ground, A0, A1, and Pin 3 on the motor shield. These will be used to connect the Breadboard, Ultrasonic Sensor and the Touch Sensor in later steps.
Using a screwdriver, connect a battery holder to the EXT_PWR port on the motor shield. This will provide power to the motor shield and the wheels.
Place the Motor shield onto the Arduino, making sure that the ports are properly aligned.
Step 5: Connect to the Breadboard
Using the wires soldered onto the Motor shield in the last step, connect the +5V wire to the red power strip of the bread board and connect the Ground wire to the blue power strip on the breadboard.
Step 6: Set Up the HC-SR04 Ultrasonic Sensor
Fit the Ultrasonic Sensor into the 3-D Printed Ultrasonic Sensor Holder part. Connect 4 female to female jumper wires to the Ground, Trigger, Echo, and VCC ports found on the back of the ultrasonic sensor. Run the jumper wires through the inside of the Servo Mount Part and using hot glue, connect the servo mount part to the Ultrasonic Sensor Holder part.
Connect the wires that were soldered onto the motor shield in step 4 to the end of the ultrasonic sensor female to female connection.TRIG should connect to A0, and ECHO should connect to A1. Run a connection from the red power strip on the breadboard to the VCC port on the ultrasonic sensor and another connection from the blue power strip to the GROUND port.
Secure connections with electrical tape to ensure the they do not become loose.
Step 7: Set Up the Servo Motor
Fit the Servo Motor onto the center opening (The middle opening of the 3 rectangular openings) of the Base 3-D printed part. Run the Servo Wires through the opening and connect the servo motor onto the SER1 port on the corner of the motor shield.
Hot glue the Ultrasonic Piece from the previous step to the top of the servo motor.
Step 8: Set Up the Touch Sensor
Connect 3 female to female jumper wires to the G,V and S ports found on the back of the touch sensor.
Connect the wire soldered onto pin 3 of the Motor shield to the S port on the touch sensor. Run a connection from the red power strip on the breadboard to the VCC port on the ultrasonic sensor and another connection from the blue power strip to the GROUND port.
Step 9: Assemble Rob
Heat up your hot glue gun, it will be used extensively in this step. While you wait for the hot glue gun to heat up , paint the black box you were provided in the Make Course using Acrylic paint . Wait for this to dry.
Once the glue is hot, glue the Base/Ultrasonic sensor part onto the top of the box. Run the wires onto the inside of the box . Place the motor shield, Arduino, and breadboard inside the box.
Hot glue the four DC Motors onto the bottom of the box, ensuring the wheels connected to M1 and M2 are on the left, and the wheels connected to M3 and M4 are on the right side. At this point, Rob should be complete minus the code.