Self-driving Toycar

self driving toycar

Workshop manual

Team up!

Deconstuct the car


Test the Arduino and the Arduino software

Install Arduino Software


Open your first sketch

Open the LED blink example sketch: File > Examples >01.Basics > Blink.

Open sketch

Select your board type and port

You'll need to select the entry in the Tools > Board menu that corresponds to your Arduino or Genuino board.

Select board

Select the serial device of the board from the Tools | Serial Port menu. To find outwhich port to use, you can disconnect your board and re-open the menu; the entry that disappears should be the Arduino or Genuino board. Reconnect the board and select that serial port.

Select COM port

Upload the program

Now, simply click the "Upload" button in the environment. Wait a few seconds - you should see the RX and TX leds on the board flashing. If the upload is successful, the message "Done uploading." will appear in the status bar.

Upload sketch

A few seconds after the upload finishes, you should see the pin 13 (L) LED on the board start to blink (in orange). If it does, congratulations! You've gotten Arduino or Genuino up-and-running.

Connect the Motor Driver

The Motor Driver or Arduino Motor Shield allows you to easily control motor direction and speed using an Arduino.

Motor shield

Connect the motors

Steering motor       -> Shield M1
Driving motor        -> Shield M4
Car battery wires    -> Shield EXT_PWR


Motors test over serial connection


Connect the line sensor

The line detection sensor module sends out short pulses of (invisible) infrared light and measures how much of that light comes back. It output the brightness/darkness as an analog voltage that the Arduino can use to steer the car.

line sensor

Module  ->    Arduino   
- - - - - - - - - - -
VCC     ->    5V
GND     ->    GND
A0      ->    A0
Module  ->    Arduino   
- - - - - - - - - - -
VCC -> 5V

sensor Connected line sensor

Sensor testing

sensor testing sensor testing

Upload the car software

Enhance the software




External links

Used modules:

Stuff that might need explaining?