1

I just bought this IR-detector+lamp device: http://www.biltema.se/sv/Bygg/Belysning-och-lampor/Arbetslampa/Halogenstralkastare-med-IR-detektor-46191/

It turns the light on for a certain time when motion is detected. I want my Raspberry Pi to detect when there is a motion sensed by this device. What is the best way to achieve this? Can I have some sort of power measure device in the circuit(on the power cable) connected to the pi unit?

This could be expensive - I want a simple solution that is cheap as well.

What are my options?

migrated from electronics.stackexchange.com Dec 31 '13 at 14:33

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

1

What are my options?

  1. Measure the current used by the lamp. The way you asked your question means that you probably don't want to deal with mains voltage. So better go for an option like this, see how to interface here.

  2. Use your own IR detector, connect it to your Pi, let the Pi do the switching. This means that you will need some kind of driver that deals with mains voltage. Unless you find some kit for the Pi that is meant to switch mains voltages, stay away.

  3. Find two photodiodes and connect them to the Pi. Point one in the direction of the lamp, another to pick up the ambient light level. Compare the two in software to find out wether the lamp turned on.

  4. Variation of 3: Skip the ambient light sensor, write piece of software that looks for sudden changes in light levels to detect the lamp turning on. This way you account for changes of lighting because of night/day or cloudy vs. clear sky.

  • I will try option 1 because the pi will be indoors. Option 2 would maybe be the best but I have never done something similar before. If I could decouple the detector from my lamp/detector device in an easy way, and use it separately it would be very cool. Thank you for the suggestions – The D Merged Dec 30 '13 at 22:04
  • @TheDMerged: You can buy separate IR sensors like this one: adafruit.com/products/189 and relays like this adafruit.com/products/268 or this sparkfun.com/products/11042. This tutorial explains how to use the second kit in a safe way: sparkfun.com/tutorials/119 – 0x6d64 Dec 31 '13 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy