This tutorial will take you through the steps of building an automatic lamp with motion control.
This project will be built using a Raspberry Pi Model B with the GrovePi expansion board from Dexter Industries along with their Ultrasonic sensor and Relay module. We’ll be using a custom Raspbian disk image for this project, running on the latest “jessie” build.
The goal of this tutorial is to demonstrate a working prototype and show you the steps you need to test and revise this design in order to refine and deploy to fully execute your idea.
Recipe for This Project
Computer: Lenovo T420 Windows 10
SD Card: Sandisk DHCD 8GB
Microprocessor: Raspberry Pi Model B Revision 2.0 (512MB)
VGA Adapter: Generic HDMI Input to VGA Adapter Converter For PC
Power Supply: Generic Powered USB 2 4-port HUB
Cables: USB Type-A / Micro-B; and USB Type-A / Type-B
Keyboard: Generic USB Keyboard
Mouse: Generic USB Mouse
WiFi Router: Generic WiFi Router
Plug: Straight Blade Extension Cord
Light: Generic Lamp <= 100 watts
Box: CAT5 Surface Mount Jack
SD Formatter v4
Dexter Industries Modified “jessie”
Win32 Disk Imager 0.9
Screw Driver Set
From Idea to Deployment
There are many steps in the development of a project from concept to deployment.
STEP I – Concept
When I come home I have a foyer that’s pretty dark. I often have my hands full and I want the lamp in the room to automatically turn on when I enter. Motion control is the perfect solution.
STEP II – Design
You can use a simple python program to test for a specific distance variable from an Ultrasonic sensor and control a high voltage relay when the sensor variable is triggered. Plug a lamp into the relay and it will turn on when someone enters the room.
STEP III – Prototype
This prototype uses the GrovePi expansion board from Dexter Industries to manage the RaspberryPi GPIO pins. I like using this expansion board because of its plug & play design and the modified Raspian disk image from Dexter Industries that has a whole host of troubleshooting tools, which comes in handy during the testing phase.
4) When the RaspberryPi boots the program should load
5) Go test your motion control creation on your favorite lamp
STEP II – Testing
1) I’ve hooked the Raspberry Pi up to my hallway lamp to test it in the field.
This was a fun project without too many moving parts. I’m excited to be able to expand the programming of this motion control lamp and put in a socket condition that will allow a connected smartphone or tablet to also control the lamp. I hope you enjoyed this tutorial and please send me us any modifications you’ve made to this project.