MySensored 230v motion sensor with light level
-
So I replaced the LM393 Light Sensor with an LDR according to the previous picture.
I had to make a small change to the sketch since the reading was inverted. High value at low light and vice versa:
Replaced:
int lightLevel = 1023 - analogRead(LIGHT_SENSOR_ANALOG_PIN);with:
int lightLevel = analogRead(LIGHT_SENSOR_ANALOG_PIN);I now get way better sensitivity at low light level, I'm happy :D
Now to PLEG some lights according to Light level in Vera.
-
Be careful using cheap Chinese iPhone charger clones. They are definitely not safe to use: http://www.righto.com/2012/03/inside-cheap-phone-charger-and-why-you.html
-
Be careful using cheap Chinese iPhone charger clones. They are definitely not safe to use: http://www.righto.com/2012/03/inside-cheap-phone-charger-and-why-you.html
@Anticimex Yeah, I know. This is why I added a small glass fuse to the 230v of it all. I hope this will be sufficient if something does go wrong.
-
@Anticimex Yeah, I know. This is why I added a small glass fuse to the 230v of it all. I hope this will be sufficient if something does go wrong.
@korttoma Yes, that's a good ide. Just wanted to mention it in case someone decides to read partial parts and go ahead and do "crazy stuff". You would not believe what people do given a little encouragement :)
I plan to, at some point, do a bit checkup on the availablility of AC/DC converters, "battery eliminators" that could be suitable with respect to cost, but most of all, efficiency. Not nice to have something that goes too warm and waste energy for powering a device that itself draws next to nothing :)
-
@korttoma Very interesting project. Nice work! I'm just curious does it dim the lights in response to varying ambient light levels or is it a ON/OFF setup?
@jeylites At the moment I turn on a light from the motion detected but only if the light level is under a certain limit. My plan is to adjust the light level in the room according to the sensor but for this I will need another dimmer device for the main light in the room.
The device from this thread only sends motion and light level to my main controller (Vera) where the logic for light control is done by using a plugin called PLEG.
-
@jeylites At the moment I turn on a light from the motion detected but only if the light level is under a certain limit. My plan is to adjust the light level in the room according to the sensor but for this I will need another dimmer device for the main light in the room.
The device from this thread only sends motion and light level to my main controller (Vera) where the logic for light control is done by using a plugin called PLEG.
@korttoma Nice!
That will be great to have the the lights dim in response to varying ambient sensor light levels. I'm still researching on AC triac based PWM dimming which I'm planning to use My Sensor LED Dimmer run it.
-
@jeylites At the moment I turn on a light from the motion detected but only if the light level is under a certain limit. My plan is to adjust the light level in the room according to the sensor but for this I will need another dimmer device for the main light in the room.
The device from this thread only sends motion and light level to my main controller (Vera) where the logic for light control is done by using a plugin called PLEG.
-
Cool, I tried do do "crazy stuff" on this one, without encouragement...
https://www.mrosupply.com/electrical/signaling-visual-audio/2487583_21104634000_pfannenberg-inc/ -
@korttoma love this and works great! But is there any way to remove the relay from the equation so you don't get that clicking noise each time the sensor goes off?
Thanks!
-
Hi @Cameron-Payne I'm not sure how to replace the relay in a safe way but maybe an optocoupler could do the trick if you can find one that can handle 230VAC.