(Ra)Spy-Bot – the Mini Recording and Streaming Robot

This spy 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

Step 1: 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.

Step 2: Battery Mounting

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.

Step 3: Motor Driver Mounting

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. I recommend hot glue for temporary uses most.

Step 4: 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.

Step 5: Wiring

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.

Step 6: 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!

Step 7: Camera Mounting

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. Place 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!

Step 8: 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! For more projects, click below:

Until next time,

Merry Making from g3holliday

Leave a Comment

Your email address will not be published.