Introduction: Robot Car
How to build a Robot Car
Attachments
Supplies
Parts (recommended: print and cut all 3D printed and laser cut parts before you start assembly):
- wood chasis
- castor wheel
- castor wheel mount
- motors
- motor mounts
- wheels
- opto interrupter sensors
- encoder disks
- small spacers
- 33mm spacers
- TCRT5000L (line following sensors)
- battery holder
- 18650 lithium batteries (rechargeable)
- arduino uno
- arduino breakout shield
- L298N motor controller
- ultrasonic sensor
- Infrared sensors
- ws2812 LED
- LED mount
- voltage divider (perfboard)
- resistors
- wood screws
- micro servo
- front sensors mount
- HC-05 bluetooth module
- bluetooth mount
- power switch
- screws and nuts of various sizes (sizes found in bill of materials image)
- jumper wires
Tools Required For Assembly
- screwdrivers (flat and phillips head both needed)
- Side cutters/wire cutters
- soldering iron
- solder
- 3D printer
- laser cutter
- Arduino IDE software (downloa
- Onshape (3D modeling software)
- heat gun
- heat shrink
- wires (to solder to components)
- USB upload cable (for arduino to upload code)
- Zip ties (optional for wire management and neatness)
- Computer
- Android phone
- Joystick app (download on phone)
Parts That Require Fabrication
3D Printer:
- motor mount
- castor wheel mount
- bluetooth mount
- LED mount
- front sensors mount
- ultrasonic sensor mount
- 33mm spacers
- spacers
Laser cut:
- chasis
Step 1: Chasis and Drive Train
Tools:
- Laser cutter
- Vector program (of your choice, i.e. Adobe Illustrator)
- Screwdriver
- 4 25mm M3 screws
- 4 12mm M3 screws
- 2 motor mounts
- 2 motors and wheels
- Wires
- 2 Opto interrupter sensors
- 2 encoder disks
- 12 M3 nuts
- Solder
- Soldering iron
- 2 3 pin female connectors
- Side cutters
Chasis:
- Open DXF file.
- Export to any vector program of your choosing.
- Cut on laser cutter
Opto Interrupter sensors:
- Cut off original opto interrupter connectors (white ones)
- Slide heat shrink onto each wire, red is voltage, blue is signal, and black is ground
- Solder each wire to one of the pins on the 3 pin female connectors, BE SURE that the VOLTAGE wire is soldered to the MIDDLE PIN.
- Do this for each opto interrupter sensor and then they can be installed into the drive train
Drive Train:
- 3D print motor mount using slicing program of your choice and STL file
- Solder two wires on to metal prongs of located near the circular end of each motor (optional: tie zip ties around wires and motor to relieve stress on wires).
- Place 2 12mm screws in each of the mounting holes (bottom) of each motor mount.
- Take 25mm screws and attach motor onto motor mount using two from holes closer to the circular end of the motor, secure with nuts.
- Place opto interrupter sensors in to corresponding slits on the back wall of each mount
- Diagonally slide one encoder disk onto the inner axel of each motor so that it fits with the space gap of the sensors.
- Attach wheels to protruding axels on the outer side of the mount
- Place mounting screws (should already be protruding from the bottom of assembly) from motor assembly into corresponding holes on Chasis, secure with nuts.
Step 2: Mount Castor Wheel, Arduino Uno, L298N, Battery Holder, Power Switch
Tools:
- Castor wheel
- castor wheel mount
- 4 20mm M3 screws
- Arduino Uno
- Arduino Breakout Shield
- L298N Motor Controller
- 8 12mm M3 screws
- 2 10mm M3 screws (grab the 2 countersunk screws)
- 8 spacers
- 10 M3 nuts
- battery holder
- wires/connector (red connector with one red and one black wire from each end)
- screw driver
- solder
- soldering iron
- heat shrink
- heat gun
3D Printed Parts:
- castor wheel mount (use STL file and print using any slicing program of choice)
- spacers (STL)
Arduino Uno, Breakout shield, and L298N:
- mount arduino uno and L298N using 12mm M3 screws for each available hole.
- mount to corresponding holes on chasis
- place a spacers on each screw after the screw has gone through the components (yes, the arduino and L298N).
- finish mounting by securing with nuts.
- attach breakout shield by inserting pins from breakout shield to the corresponding pin headers on the arduino uno.
Power Switch:
- trim wires to desired lengths before soldering.
- add heat shrink on wires before soldering.
- solder a wire to one prong of power switch.
- solder one end of one half of the connector to the other prong.
- use heat gun to shrink the heat shrink to hide any exposed connections.
- slide power switch into corresponding square space on chasis (tip, slide diagonally and use some force).
Castor wheel:
- after you have printed your castor wheel mount, mount your castor wheel to the back of the chasis using corresponding holes
- make sure the mount is in between your wheel and the chasis
- use 4 20mm M3 screws and nuts to secure to chasis
Battery Holder:
- Take battery holder, trim wires and solder other end of connector (the other half of the one used in the power switch).
- make sure to apply heat shrink before you solder
- use heat gun when finished to shrink the heat shrink to hide any exposed metal
- Mount the battery holder to the corresponding holes on the Chasis with nuts and the countersunk screws.
Step 3: Mount Bluetooth Mount, LED, and Front Sensors Mount
Tools:
- Bluetooth mount (3D print)
- HC-05 Bluetooth module
- LED mount (3D print)
- ws2812 LED
- Front sensors mount
- 4 10mm M3 screws
- 1 12mm M3 screws
- 5 M3 nuts
- Wires
- 3 pin female connector
- Solder
- Soldering iron
- Screw driver
- Heat shrink
- Heat gun
- 3D printer
Bluetooth Mount:
- 3D Print Bluetooth mount from STL file, use any slicing program of your choice
- Mount Bluetooth mount using 2 10mm screws and nuts with corresponding holes on Chasis
- Slide Bluetooth module pins up into the mount to secure
Front sensors mount:
- 3D print front sensors mount from STL file on Onshape, use any slicing program of your choice
- Mount front sensors mount using 2 10 mm screws and nuts with corresponding holes located at the front of the Chasis
LED:
- Solder three wires to the solder pads on the back of the LED, solder to the ones labeled “Din”
- Add heat shrink to each wire and use the heat gun to hide any exposed connections
- Slide on more heat shrink on each wire for next step
- Solder other ends of wires to the three pin female connector, MAKE SURE to solder your VOLTAGE wire to the middle pin (for future reference whenever there’s a three pin female connector, always solder your voltage wire to the middle pin)
- Use heat gun to shrink the heat shrink and hide all exposed connections once again
LED mount:
- Print LED mount from STL file (any slicing program)
- Take LED and press into mount (square space to square LED) and then flip, so wired side is facing down and mount to Chasis
- Use a 12mm screw and nut to secure the mount which should be holding the LED down to the Chasis, the hole for the LED is located between the arduino and the Bluetooth module
Step 4: Ultrasonic Sensor Assembly and IR Sensors
Tools:
- Servo
- Servo horn
- 1 M1.6 screw (servo screw)
- 2 12mm M3 screw
- 2 M3 nuts
- 2 8mm M2 screws
- 2 M2 nuts
- 2 wood screws (pointed ends)
- 2 spacers
- 2 IR sensors
- Ultrasonic mount
- Ultrasonic sensor
- 3D printer
Ultrasonic mount:
- 3D print the ultrasonic mount from the STL file
Mount the servo:
- Mount servo without the servo horn
- Mount servo by placing the servo into the square space at the front of the chasis (tip, try to push it in diagonally and be aware of the wire, use some force).
- Take the wood screws and screw the servo down with mounting holes on the servo
Mount the ultrasonic sensor:
- Lower the ultrasonic sensor into the mount and push it through the corresponding holes, make sure the pins are exposed through the gap on the bottom of the mount.
- Attach servo horn to the ultrasonic mount using the M2 screws and nuts, use the holes on each end of the servo horn to mount.
- Put servo horn on top of the servo and screw in using the M1.6 (super small) screw.
Mount IR sensors:
- Mount the IR sensors using the available holes on the front sensors plate mount.
- Place a spacer in between the sensor and the mounting plate.
- Fasten with screw and nut.
- Do this for both
Step 5: Voltage Divider and Line Following Sensors
Tools:
- 2 line following sensors
- 2 40mm M3 screws
- 2 M3 nuts
- 2 33mm spacers
- Perfboard
- 2 resistors (1 27k ohm and 1 16k ohm)
- Wires
- 3 pin female connector
- 2 spacers
- 2 12mm M2 screws
- Solder
- Soldering iron
- Heat shrink
- Heat gun
- Multimeter
Mount IR sensors:
- 3D print 33mm spacers from STL file.
- Use the 40mm screws to mount the sensors using the holes located behind the servo.
- Place a 33mm spacer onto each screw before putting the sensors on the screws.
- Fasten with M3 nuts.
Voltage Divider (highly recommended: use pictures for reference):
- Solder the two resistors to the perfboard, each resistor should have one leg in its own hole and one leg in a shared hole (look at pictures if confused).
- Solder 3 wires one hole down (or up depending on orientation) from each hole with a resistor leg (look at picture again if confused)
- Bridge the connection with solder on the back of the perfboard (pictures will help to understand).
- Wire connected to middle hole (hole with two legs) is the signal wire, power wire connects to one end of the 27k ohm resistor, and ground connects to one end of the 16k ohm resistor (outside legs, use multimeter to measure which is which).
- Splice (solder+heat shrink, same procedure as before) signal and ground wires to the 3 pin female connector, do not solder the voltage wire to the connector, leave the middle pin on the connector empty (look at picture).
- Mount the voltage divider with the M2 screws, spacers and nuts using the corresponding holes behind the power switch.
- Make sure the spacers go between the Chasis and the voltage divider a you have done when using all other spacers.
- Everything will be wired in the next step.
Step 6: Wiring
Tools:
- Lots of jumper wires (female to female and male to male jumpers)
- Zip ties (optional for neatness)
Instructions:
- Follow wiring diagram (above).
Step 7: Code and Examples
- Tools:
- Computer
- Arduino IDE software, download using link: https://www.arduino.cc/en/software
- Android phone
- Joystick app
- USB Upload cable
Arduino IDE download:
- open link
- select version for your computer
- download
Joystick app and Phone:
- download the app (pictured above)
Joystick Code:
- Open joystick app and select your Bluetooth module under the Bluetooth connections tab in the app.
- this code allows control of the bot using the joystick app
- download code
- make sure pin numbers on the bot match the code
- upload to bot
- test
Roomba Code Example:
- Download code and open using Arduino IDE
- upload and run code
- this code runs the bot automatically and it uses the ultrasonic sensor to avoid obstacles
make sure pin numbers on the bot match the code
Step 8: Drive and Have Fun!!!
Using the joystick code from the previous step, you can now control the robot using your phone. Test it out and have fun!
Step 9: Bill of Material/Drawings to Help With Assembly
BOM/Drawings:
- Callouts on drawings match with the part on BOM with corresponding number
- BOM lists all parts required for assembly