DIY Robot With Wheels

by dwong21 in Circuits > Gadgets

207 Views, 0 Favorites, 0 Comments

DIY Robot With Wheels

Screenshot 2023-11-27 015214.png

The DIY Robot with wheels is a device that is designed to move, make sounds, and light up utilizing the adafruit CPX device. The device has been coded to spin the servo motors allowing for the wheels to function and move the robot around. The CPX has also been coded to light up and drive forward for 2 seconds once button A is pressed, once the robot stops moving forward the device will sleep for 2 seconds, then play two different tones. Once button B is pressed, the CPX device will light up a different color then when button A was pressed, then the robot will move backwards for two seconds and then sleep for two seconds. Once the sleep time is done, the CPX will produce 3 different tones produced at different hertz levels. After, the CPX device will acknowledge a flashlight with the light sensor, once the light hits the sensor it will light up a third different color, and then spin the robot in one direction for 3 seconds.

This Project is Remixed From:

OTTO with Wheels


Supplies

20231127_130553.jpg
20231127_130814.jpg

Materials:

Tools:

  • 3D Printer
  • Small Phillips head Screwdriver
  • Hot Glue Gun & Sticks
  • Metal File (If using continuous servo motors)

3D Printing

20231127_125350.jpg
  1. Download the zip file
  2. Extract the following files from the zip file
  3. Body (we need to edit, make it just a box)
  4. Head
  5. Wheels (figure out where/what file)
  6. Support
  7. 3D Print Each Structure individually, using best practice for specific device
  8. Device pictured was printed on a Makerbot sketch

Assemble Body

20231127_131832.jpg
20231127_132609.jpg
20231127_132547.jpg
20231127_132551.jpg
20231127_132707.jpg
20231127_133235.jpg
20231127_132704.jpg


  1. Place servo motors on the bottom of the body with their gears sticking out of the allocated holes
  2. Holes may need to be filed in order for servos to fit
  3. Attach servo horns to wheels using hot glue
  4. Attach support to the back of the body using screws.
  5. Attach each wheel to body by placing the servo gear within each horn

Connect Servos to CPX

Screenshot 2023-11-27 133450.png
Screenshot 2023-11-27 133547.png
  1. Each wire on the servos has a corresponding port it should be connected to, they are as follows:
  2. Servo 1
  3. A1 ⇄ Servo 1 Signal (Orange)
  4. VOUT ⇄ Servo 1 Power (Red)
  5. GND ⇄ Servo 1 Ground (Brown)
  6. Servo 2
  7. A2 ⇄ Servo 2 Signal (Orange)
  8. 3.3V ⇄ Servo 2 Power (Red)
  9. GND ⇄ Servo 2 Ground (Brown)


Set Up CPX to Run CircuitPython

Screenshot 2023-11-27 135901.png

Follow Adafruit's instructions for installing CircuitPython on a CPX: Installing CircuitPython

This project can also be coded using Adafruit Makecode, however this version is coded in CircuitPython

Program CPX

Screenshot 2023-11-27 140203.png

This project uses Adafruit's CPX and Servo libraries. An example program is attached below.

The Example Code Includes:

  • Light up and drive forward for 2 seconds once button A is pressed
  • once the robot stops moving forward the device will sleep for 2 seconds, then play two different tones.
  • When Button B is pressed, the CPX device will light up a different color
  • Next, the robot will move backwards for two seconds and then pause for two seconds.
  • Then, the CPX will produce 3 different tones at different hertz levels.
  • Device will acknowledge a flashlight with the light sensor, once the light hits the sensor it will light up a third different color, and then spin the robot in one direction for 3 seconds.

Downloads

Attaching Battery Pack & Final Assembly

20231127_133728.jpg
Screenshot 2023-11-27 015214.png
  1. Attach the battery pack to the port on the CPX
  2. This can then be placed along with the CPX within the body of the robot.
  3. Finally place the head on top of the other components, it should latch into place.

Decorate (Optional)

20231127_134315.jpg

The robot should be fully operational at this point, but the addition of googly eyes, stickers, or other fun decorations is a great way to add some character.