(Ra)Spy-Bot - the Mini Video-Recording Robot

by g3holliday in Circuits > Robots

482 Views, 2 Favorites, 0 Comments

(Ra)Spy-Bot - the Mini Video-Recording Robot

DSCN5645.jpg

This robot has been a dream of mine for a while now, and it's finally done!

Features:

  • Records video for a adjustable amount of time
  • Super small size
  • Ultrasonic sensor controlled - fully independent
  • All-terrain design

Supplies

  1. Raspberry Pi Zero W - here at Adafruit
  2. Arduino Nano - here at Newark
  3. TT Gearbox Motor - here at Adafruit
  4. Super small Cardboard Box
  5. Male/Female Jumper Wires - here at Newark
  6. Female/Female Jumper Wires - here at Newark
  7. Male/Male Jumper Wires - here at - you guessed it - Newark
  8. DRV8833 Motor Driver - here at Adafruit
  9. Raspberry Pi Camera Module - here at Newark
  10. Slide Switch - here at Newark
  11. 9V Battery
  12. 9V Battery Clip - here at Newark again
  13. USB Li-Ion Battery Charger - here at Adafruit
  14. 2 Li-Ion Batteries 1200mAh - here at Newark
  15. Caster Wheel - here at Adafruit
  16. Raspberry Pi Zero to Camera Adapter Ribbon Cable - here at Adafruit
  17. USB to Micro-B Cable - here at Ebay

Apps:

  1. Raspberry Pi OS - here at Raspberry Pi
  2. Arduino Create Web Editor - here at Arduino

Tools:

  1. Rotary Tool - here at Dremel
  2. 3D Printer - here at Amazon - I have an Ender 3, and it's awesome - #notsponsored


Chassis Design

This is where the 3D Printer comes in. If you want, you can print a chassis base for your box.

First, get out your hot glue gun and heat that up. (Don't worry, the hot glue is only temporary.) After it is heated, get whatever you used for a chassis base and glue the TT motors on it. Then, glue the box on top.

Battery Mounting

DSCN5652.jpg

Use a double sided adhesive tab and secure the 9v battery on the side, and use another to secure the 3.7v battery on the side. Put 2 normal jumper wires in the 3.7v battery holes. Put 2 M-F jumpers on the 9v battery wires. Drill a hole in the side of the box and put the 3.7v battery wires through.

The 3.7v battery is for the Arduino, and the 9v battery is for the motors.

Motor Driver Mounting

DSCN5652.jpg
DSCN5445.jpg

Cut a DRV8833-sized hole in the box with your rotary tool. (I advise you to measure it.)

Hot glue the DRV8833 in around the edges. I said hot glue because you might need to make changes.

Sensor Mounting

Take your HC-SR04 and measure it. Get the length and width, then draw lines of the corresponding distance on the chassis enclosure, to make a cutting template.

Cut on the lines with your rotary tool.

Put the ultrasonic sensor through the hole. If it fits, great! If it doesn't, adjust accordingly. Make sure the "beams" are not obstructed.

Glue around it like you did with the DRV8833.

Wiring

RSCN5468.JPG
DSCN5460.JPG

This is the hardest part.

Because there are so many wires, I didn't make a circuit diagram, but the list below shows the pin numbers.

Pin Numbers:

  • Trig of your HC-SR04 to pin 9
  • Echo of your HC-SR04 to pin 10

DRV8833 Pins:

  • AIN1 to pin 4
  • AIN2 to pin 5
  • SLP to 3.3 V
  • BIN2 to pin 6
  • BIN1 to pin 7
  • AOUT 1 to Left Motor RED
  • AOUT 2 to Left Motor BLACK
  • BOUT 2 to Right Motor BLACK
  • BOUT 1 to Right Motor RED

Put the power wires to their respective places, as always. I recommend breaking out each power pin to a breadboard strip. Put the Nano in the box (you can't wire it if you don't).

Plug the red of the 1st battery into the VIN of the Nano, then when you are ready to roll, put the black of the battery into GND.

Coding

Download the code for your Arduino here at GitHub. Upload it to your Nano.

Run the .py file on your Raspi Zero on boot like this:

Run this command in Terminal :

  • sudo nano /etc/rc.local

Add this line right before the exit0 line:

  • python /home/pi/Desktop/(Ra)Spy-Bot Cam.py &

Press ctrl + x, then y, then enter.

That's it!

Camera Mounting

RSCN5446.jpg

Drill a hole through the front big enough for your camera, then put your camera with the adapter cable into your Raspi Zero's connector.

Put the camera through the hole, then glue the edges. Put your Zero in the chassis enclosure. Put the USB to battery converter in your box, then when ready, plug er' in and watch it record!

Done!

Make sure nothing is shorted in the enclosure. Turn it on. If it works, congratulations!!! You did it!

Do a test mission to celebrate, then kick back and watch your 1 1/2 minute show!

Thank you for viewing my project!

Until next time,

Merry Making from g3holliday