Daniel Macías Perea
Published © MIT

Roomberry Surveillance Robot: Roomba + Pi Zero + Camera

Roomberry is a surveillance robot based on Roomba using a Raspberry Pi Zero W and a camera module.

IntermediateFull instructions provided4 hours11,986
Roomberry Surveillance Robot: Roomba + Pi Zero + Camera

Things used in this project

Hardware components

Mini Din 7 male connector
×1
Roomba 700
×1
Raspberry Pi Zero Wireless
Raspberry Pi Zero Wireless
×1
Pimoroni Raspberry Pi Zero Camera
×1
Step-Up Voltage Regulator - 5V
SparkFun Step-Up Voltage Regulator - 5V
×1
Level Shifter Board
SparkFun Level Shifter Board
×1
Raspberry Pi Zero Case
×1

Software apps and online services

Maker service
IFTTT Maker service

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Rotary Tool

Story

Read more

Schematics

Roomberry HAT

Code

Code snippet #1

Plain text
# Get the current video output type and strip away the unimportant bits
video="$(tvservice -s | sed "s/^.*\[\([^ ]*\) .*$/\1/" )"
 
if [ "$video" != "HDMI" ]; then
        printf "HDMI not detected. Turning off.\n"
        tvservice -off > /dev/null
else
        printf "HDMI detected.\n"
fi

Code snippet #2

Plain text
# Set the Pi Zero ACT LED trigger to 'none'
echo none | sudo tee /sys/class/leds/led0/trigger
 
# Turn off the Pi Zero ACT LED
echo 1 | sudo tee /sys/class/leds/led0/brightness

Code snippet #10

Plain text
import serial
import time
 
# Open a serial connection to Roomba
ser = serial.Serial(port='/dev/serial0', baudrate=115200)
 
# Assuming the robot is awake, start safe mode. Note that 0x83 in hexadecimal corresponds to 131.
ser.write('\x83')
 
time.sleep(.1)
 
# Start cleaning - 135
ser.write('\x87')
 
# Stop (back to off mode) - 173
ser.write('\xAD')
 
# Close the serial port; we're done for now.
ser.close()

Code snippet #14

Plain text
python3 /usr/local/lib/python3.5/dist-packages/irobot/console_interfaces/create2.py
Launching REPL
Serial Port> /dev/serial0
BRC Pin> 27
Enable quirks> No
 
Create2 attached as robot on /dev/serial0
May it serve you well
 
robot.clean()
 
robot.stop()

Code snippet #15

Plain text
#Send a clean command to Roomba
curl roomberry/roomba/?op=clean
 
#Drive Roomba straight at 20 mm/s
curl roomberry/roomba/?op=drive&velocity=11&radius=32768
 
#Set camera saturation to 65
curl roomberry/cam/?op=cam&saturation=65
 
#Download picture taken 20180810 at 102849
wget roomberry/cam/20180810/20180810-102849.jpg

Code snippet #16

Plain text
wget https://github.com/danimaciasperea/Roomberry/archive/V1.0.0.tar.gz /tmp/
tar -xvf /tmp/Roomberry-1.0.0.tar.gz
 
 
#Before doing next step, adapt the code to your environment (serial port used, IFTTT Key, etc.)
sudo cp /tmp/v1.1/roomberry/roomberry.py /usr/local/bin/
sudo cp /tmp/v1.1/roomberry/roomberry.service lib/systemd/system/
 
sudo systemctl enable roomberry.service
system roomberry start

Github

https://github.com/julianpistorius/irobot

Github

https://github.com/danimaciasperea/irobot

Github

https://github.com/danimaciasperea/Roomberry

Credits

Daniel Macías Perea

Daniel Macías Perea

1 project • 5 followers

Comments