Vacuum Cleaner Hack

Components of a robot:
  • Arduino Leonardo
  • Arduino Pro Micro
  • Arduino Motor Shield (or L298 dual full-bridge driver)
  • MinIMU-0 v2: Gyro (L3GD20), Accelerometer and Compass (LSM303DLHC)
  • Bluetooth BTM-222
  • Analog Distance Sensors: GP2Y0A21 (10-80 cm) and GP2Y0A41 (4-30 cm)
  • Raspberry Pi
  • RPI camera board
  • Pan/Tilt Bracket
  • Two servo motors
  • Chassis of cheap robot vacuum cleaner
robot vacuum cleaner hack pi camera

Download my Android application to control a robot

To use this Android application you need:
  • Arduino (e.g. Leonardo)
  • Arduino Motor Shield
  • Bluetooth (e.g. BTM-222)
  • Chassis of a mobile robot
The sample code for the Arduino Leonardo board can be found at

Most of the connection is done through the Arduino Motor Shield:
const int MotorR = 13; // H bridge control Input for the right motor
const int MotorL = 12; // H bridge control Input for the left motor
const int BrakeR = 9;
const int BrakeL = 8;
// SDA = 2
// SCL = 3
const int pwm_L = 5; // pwm output - default PWMA pin is 3!
const int pwm_R = 11; // pwm output
Wiring description:
  • connect your bluetooth to Arduino Rx and Tx line (not forgetting about power supply),
  • plug the motors to the Arduino Motor Shield,
  • I've changed the default PWMA pin from pin3 to pin5 (const int pwm_L =5), 
  • so you should short these two pins on the Arduino Motor Shield

If you like this project and you want it to be developed, please donate (any amount counts).