User Tools

Site Tools


wiki:diysdrobot

BE READY TO START

This assembling guide is based on the yellow D.I.Y. kit p. 297 - 10.11 D.I.Y. Build a simple self-driving robot

Build an obstacle avoiding robot using a L298N motor controller module and an ultrasonic sensor.

TO BEGIN YOU WILL NEED
  • yellow board x 1
  • USB cable x 1
  • Breadboard x 1
  • SRF04 or SRF05 ultrasonic range finder x 1
  • 0.1μF capacitor (marked 104 or μ1J63) x 2
  • L298N motor controller module x 1
  • DC motors with gearbox x 2
  • Robot wheels x 2
  • Plastic parts x 2
  • Screws*
  • Holder for 8 AA batteries
  • Jumper wires

* Please refer to the image below to identify what is inside your transparent screws bag. Note that you may find some more pieces than you need.

ASSEMBLE THE ROBOT

Build your robot and place the components on your breadboard as shown in the drawings.

STEP 1

You can start working on the assembling of the robot holding the bottom of the bigger plexi base (refer to the “TOP” label engraved on the plexi to be sure you hold it in the right way). Attach the two small plexi bars with 2x Ø 3mm x 12 mm screws and respective nuts. Fix the motors with 6x Ø 2mm x 6 mm screws as shown in the picture.

STEP 2

Turn the assembly upside up (check the “top” label) and attach the castor wheel with 2x Ø 2mm x 8 mm screws. Fix the Yellow board with the 4 plastic pegs provided in the yellow board box.

STEP 3

Fix the L298N motor controller module to the smaller plexi base using the 4x Ø 2mm x 10 mm screws (place the plastic spacers between it and the plexi base and fix it using the nuts as shown in the picture). To connect the breadboard, remove the protective film and attach the breadboard in the appropriate space.

STEP 4

Place the smaller plexi on the bigger one and fix the motors between them with the remaining 6x Ø 2mm x 6 mm screws. Fix the wheels to the appropriate gears of the motors, attaching them with the 2x Ø 2.2mm x 6.5 mm self-tapping screws.

PREPARE THE CIRCUIT

You will now place the ultrasonic range finder and all the electronics components on your breadboard. Following the drawing you will connect all the components together in order to make your robot working!

Book Errata Corrige (CH 10, p. 297): Refer to this drawing to connect in the right way the ground pin of the ultrasonic range finder.

UPLOAD THE SKETCH

From the Github repository you can download the exercise sketch (30_10.11.ino) and open it in the IDE.

Download Sketch

Code will give our circuit intelligence to become a self-driving robot. The bot will turn right when it detects an obstacle in front of it at a distance of 10 cm. Before it moves forward, it will keep turning until it detects no obstacles within 10 centimeters. You can adjust the speed and the distance in the code as you prefer.

ENJOY !

After compiling and uploading the code, both motors will move forward. Now, try to place your hand in front of the ultrasonic range finder, both motors should stop for 0.5 seconds, then motor A will move forward but motor B will reverse. Both motors will move forward after 0.5 seconds if no obstacle has been detected.

wiki/diysdrobot.txt · Last modified: 2019/05/28 11:18 (external edit)