Skip to content
SDB
02Technology

Meet my home surveillance

A Waveshare Alphabot-based home robot on Raspberry Pi + Arduino — remote web/mobile drive, pan-tilt camera with MJPEG streaming, line tracking, IR remote, obstacle avoidance, and Axelta sensors for climate, light, reed and PIR.

Subhendu Datta Bhowmik4 min read

A small home robot built as an extension of the Waveshare Alphabot kit — used as a mobile surveillance and sensing platform around the house. Raspberry Pi handles the web UI and camera; Arduino (USB) reads the sensor board and feeds a simple status page.

Home surveillance Alphabot robot with camera and sensors
Alphabot-based home robot — Pi, camera and sensor pack for mobile surveillance

Alphabot base features

  • Raspberry Pi & Arduino interface
  • Servo motor interface for two drive wheels
  • Obstacle-avoidance module interfaces
  • Battery holder for 18650 cells (this build also used additional external power)
  • Speed measuring interface
  • UART interface
  • Line-tracking module interface
  • IR receiver for remote control

On top of the kit I added a RasPi camera with pan/tilt, plus humidity, temperature, light and smoke sensing (Axelta board and related sensors).

What it can do

  • Drive from anywhere — the Pi has a fixed URL reachable from a browser or phone when internet is available
  • Camera control — move the camera unit on X/Y/Z from sidebars or touch; drive the chassis with left / right / forward / back / stop
  • WebIOPi on the Pi for GPIO/web control; M-JPEG streamer for the live camera feed
  • Line tracking — thick black tape path; the robot can follow the guided track
  • IR remote maneuvering
  • Continuous stills and video — usable as a lightweight CCTV alternative
  • Dual obstacle sensors — detect walls/obstacles and correct motion automatically
  • Axelta sensor board — humidity, temperature, light level and related readings
  • 5 V power bank compatible for untethered runs
Web UI for robot movement and camera controls
Main page — camera axes and chassis drive controls in the browser
Mobile or desktop view of the surveillance robot control interface
Same controls on phone or desktop — WebIOPi + MJPEG camera stream

Sensing stack (Arduino)

Arduino talks to the Pi over USB. A small Python program on the Pi reads the serial stream and writes a sensor.html page for the dashboard.

Pins used in the sketch:

SignalPinRole
R5Reed switch
P6Power switch
X7PIR motion
TA2Temperature
HA5Humidity (DHT11)
LA4Light level
#include <dht11.h>
 
int R = 5; // reed switch
int P = 6; // power switch
int X = 7; // PIR
int T = A2; // Temperature
int H = A5; // Humidity
int L = A4; // Light
 
float CELSIUS, HUM, LIGHT;
dht11 DHT11;
 
void setup() {
  Serial.begin(9600);
}
 
void TEMPERATURE() {
  int value_temp = analogRead(T);
  delay(10);
  value_temp = analogRead(T);
  delay(10);
  float millivolts_temp = (value_temp / 1023.0) * 5000;
  CELSIUS = millivolts_temp / 10;
  Serial.print(" TEMP: ");
  Serial.print(CELSIUS);
}
 
void HUMIDITY() {
  DHT11.read(H);
  HUM = DHT11.humidity;
  Serial.print(" HUMIDITY: ");
  Serial.print(HUM);
}
 
void LIG() {
  int value_lig = analogRead(L);
  delay(10);
  value_lig = analogRead(L);
  float volts_lig = (value_lig / 1023.0) * 5;
  LIGHT = 500 / (4 * ((5 - volts_lig) / volts_lig));
  Serial.print(" LIGHT LEVEL: ");
  Serial.print(LIGHT);
}
 
void POWER() {
  Serial.print(digitalRead(P) == LOW ? " POWER: OFF" : " POWER: ON");
}
 
void REED() {
  Serial.print(digitalRead(R) == LOW ? " REED: OPEN" : " REED: CLOSE");
}
 
void PIR() {
  Serial.print(digitalRead(X) == LOW ? " MOTION: YES" : " MOTION: NO");
  delay(2000);
}
 
void loop() {
  TEMPERATURE();
  HUMIDITY();
  LIG();
  POWER();
  REED();
  PIR();
  delay(5000);
  Serial.println("");
}
Sensor dashboard link on the robot web UI
Sensor link on the Pi UI — opens the generated sensor.html page
Live sensor readings for temperature humidity light reed and PIR
Live sensor readout — temperature, humidity, light, power, reed and motion

Next step (then)

At the time of writing I was planning BLE tag tracking so the robot could help locate tagged items around the home — an automatic inventory pass on top of the camera patrol.

References

This piece was first published on 4 May 2017 as Meet My home surveillance, and is carried here under Technology as part of the digital journey archive.

Filed under

  • IoT
  • Raspberry Pi
  • Arduino
  • Sensors
  • Surveillance
  • DIY

Keep reading

Technology3 min read

The honest case for AI in the enterprise

Most enterprise AI programmes fail for the same reason enterprise search failed in 2008: nobody owned the data. Here is what actually has to be true before a model earns a place in production.

Read essay →
Technology5 min read

Visualize NodeMCU-plugged MPU6050 realtime movement on OLED

NodeMCU ESP8266 + MPU6050 gyro/accelerometer with SSD1306 OLED readout, optional DHT11, InvenSense teapot packets over serial, and a Processing 3D visualiser — motion on the bench and on the screen.

Read essay →