I am using many sensors in this project and I am not really happy with the sensitivity of them.
This sensor should get the value of the light similar to the human eye. The output goes from 0V (night) to 5V (direct sun light). In a room, if some clouds are present, the output is 0,01V. This is not what I want! The range on the Arduino is from 0 to 1024 and this sensor gives me always a value from 0 (night) to 16 (day) instead of 500 like what I expected. The value 16 can be reached also with some LEDs, not only with the day light!
This module arrives with a 10k resistor to GND. So we are always measuring 0V because the sensor has a high impendence with low light.
I replaced the 10k resistor with a 680k resistor. Now I get a value of 0 to 20 in the night and a value of 100 (out of 1024) on a cloudy day. It is not perfect, but now I can find out if it is night or day thanks to this sensor.
LM393 mini sound sensor
This sensor has a digital output, used to detect the double clap on the room. The output is connected to an interrupt in the Arduino, to get the sound immediately. It has also a LED that will light up if a sound is detected (fantastic feature!)
My problem is the potentiometer. It is a 10k potentiometer and the LED is always on. After rotating the potentiometer, you will see the LED powering off. The range is so small that it is impossible to set a reference… You have 0,2° to set the right trigger level.
Replace the potentiometer? At the moment I don’t know how to solve it in a easy way. Maybe replacing the potentiometer with a 1k and adding 2 resistors on each endpoint with a value of 5k. I will add here the description if I the double clap will not work like expected.
The library on the Arduino is really stable and works very well with every remote on the world, also the one you use for your TV!
Because the timing is critical, the library use a timer with interrupts. The problem here is not directly the remote, but the led strip. Because the LED strip need pulses of exactly 70ns, the library will disable interrupts when updating the LEDs. This will cause a malfunction of the remote when an animation on the sky is playing.
To solve this, the remote can work only if there isn’t any LED animating. Once the IR-library is detecting a code I check if the code is one of the programmed one. If the code is not one of them or has an invalid code, the roomsky will automatically stop the current animation (like panic-button function). I am using is since some weeks now and works really good! The IR will never detect signals with the room light, sun light or with the LED animations. But even if the LEDs are updated every 20ms, the IR is still detecting the remote (even if not right).
Shortly: once you start an animation, you can’t use anymore the remote. If you press any button on the remote, the animation will stop. Once you know it, this will not be a problem anymore 🙂