Motion activated light box

Making a motion activated Light box

Equipment:

  • 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

IMG_20181028_090657

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.

IMG_20181028_091408

IMG_20181028_091411

Step 3: Remove all the insides from the light box including the battery compartment.


IMG_20181028_092702

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.

IMG_20181028_093947

IMG_20181028_093956

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.



IMG_20181028_110351




IMG_20181028_115045

blog comments powered by Disqus