Wednesday, April 16, 2014

LED dimmer part 2: motion activated

My PIR motion sensors finally arrived today. I added one to the LED dimmer from the previous post. The motion sensor acts like an on/off switch that you can override using the touch sensor.

The motion sensor detects movement using infrared and it outputs a high signal when it does. This triggers the dimmer into its on state. A couple of seconds after the signal goes low (no motion) the dimmer goes into off state.


While the dimmer is on (caused by the motion sensor), you can force it off using the touch sensor. There are two potentiometers on the sensor; one for sensitivity (I left it at center position) and one for time. The time pot controls for how long the sensor will output a high signal after detecting motion. I use the lowest setting and handle the rest of the timing in the micro controller since tuning the pot is really inaccurate and annoying. There appears to be a forced 4 second delay between two high signals. No idea if that can be trimmed or not.
There's also some space allocated on both sides of the sensor board for a light sensor, so it will only detect motion when it's dark.

The Arduino program can control up to 6 output channels (could be more, but it doesn't look like I need more) and has 8 inputs, any of which can be motion or touch sensors. There are 256 levels of brightness, but the distribution of actual brightness does not seem to be very linear, it looks more logarithmic to me; it ramps up to full brightness really fast and doesn't do much after that. I'd like to have better control in the low brightness region...

No comments:

Post a Comment