Motion activated light box
- Raspberry Pi Zero (or Zero W)
- Pimoroni Automation hat
- Connecting cables & jumper leads
- PIR sensor
- Cheap light box
Step 1 - Strip out the light box internals, keeping the LEDs
Step 2: I wanted to check that the LEDs would operate on the 5V output from a Raspberry Pi so I hooked it up to my bench power supply. I could go as high as 6V if needed.
Step 3: Remove all the insides from the light box including the battery compartment.
Step 4: Connect up the LED strip to the output (1) and 5V supply on the automation pHAT. The outputs are actually switchable connections to the ground and can be controlled with the Python library.
Step 5: Connect up the PIR and calibrate.
The PIR is relatively easy to use and has a very simple python command if using GPIO Zero, as I'm using the automation pHAT I decided on a different approach to detecting if the PIR had been triggered. I connected the VCC and Ground input to the automation pHAT. The signal was then connected to analogue input 1 and the incoming voltage read. The voltage would swing between 0.2V (no motion detected) to 3.31V (motion detected). By looking for this voltage on analogue input 1 a motion detection could be triggered.