Saturday, May 30, 2009

Daylight measurements

The next project, now that the door bell growls in the mac and the power orb is orbing like mad, is to make a small weather station, with a wind speed meter and a daylight meter in order to control the sun shade in the kitchen.

In the late afternoon the kitchen gets a lot of direct sun, and while that is a good thing in the winter months, it is not as nice in the summer, as it makes it very hot and the refrigerator has to work overtime.

I have an electric sun shade, of the extending type, which is connected to an ELV device making it controllable from the server. However, I cannot lower it automatically, since if it is raining or windy or simply cloudy, it is not a very wise thing to do. I do raise it automatically every day at 20:30, which should cover it most of the year, and in case I need to go out of the house and don't come back till late while the shades are off.

So I started the weather station by getting an LDR and connecting it to the arduino. Using the standalone temperature logger I made a few months back I could leave the arduino in the kitchen the whole day logging the amount of light.


The results are great I think! with the steep rise around 14:00 which is when the sun comes around the bend, and a clear difference between the times when the sun shines and when it doesn't. I think a threshold at around 800 will do the trick.
Furthermore I am quite happy with the excursion of the sensor, going from 0 to 916 at least, which is a 89% coverage of the 5V conversion range!
Now, off to the wind speed! Already spent the night disassembling an old VCR, and got some promising parts out of there!

One more note. I thought a lot about how to make a rain sensor. Not necessarily measuring it, but just to detect if it is raining or not, but concluded that if it is rainy, the sky will be overcast, so it won't be necessary to lower the shades!

Tuesday, May 19, 2009

Growling door bell



In my quest to complicate things, but to use the available technology, as you might remember, I connected the doorbell to the computer.
So, if someone rings, the internal beeper makes a little funny noise, not very loud, and the power orb turns purple!
The problem arises when I am upstairs, probably at the computer and do not hear the little beep, so, I thought of making some kind of listener daemon for the mac that would listen to messages in the network, only to find out that it already exists (technology advanced a lot while I was not looking...) and it is called Growl. After that and almost by accident I found a php library for growl, which is great, because all my server and home automation stuff is done in php, including the eternal cycle of checking if there is an additional line in the doorbell rings databse and sound the beeper if so. From there to a growling doorbell was just a few lines of code.

Even cooler is to setup the messages from the doorbell application to be spoken! Then the mac tells me that there is someone at the door! That is why the message is so verbose - it makes it cool when spoken! I managed to record it! The only way I found to get it here was to make a little movie out of it...so here it is!



As usual, if you want the code, just drop a line!

Power Orb complete

Finally!! you might say!
I fact, it has been a while since it is operational and running on the wall, but I had no time to report.
So here they are, the photos! where you can also see my home made home server enclosure.






The little black dot at the right, where the balls hit the wall (not the screw) is a little piece of metal that pushes the push button when the ball is touched, and it also helps keeping the ball in place, as it is pivoting on the other side on one screw only!

During the day it is not very visible, as the led is not very high power (on the contrary), and there is plenty of light coming in through the door, but the red and the purple are quite visible, even during the day, which is good, because those are the colors that it is relevant to see.

So for details. The processing is pretty simple: if there are more than 2 pulses from the gas meter in 20 seconds (0.03 cubic meters per minute) or 2 pulses from the electricity meter in 10 seconds (6Wh per minute) the light glows red. As soon as that doesn't happen, it turns back into green.
It is in my plans to make it average the consumption, so that it gives a better indication, since now we will probably not see it while it is red, since by then we are either in the shower (spending gas) or in the kitchen (spending electricity). Also should change the amount of glow depending on the amount of consumption. But all that is for later!

As for the purple, it comes up when someone rings the doorbell, and overrides all other indications. To reset, all you have to do is press the ball lightly, and it will turn the the appropriate color, indicating the consumption.

The code will come soon, I guess in a google code acount. If you want it, just drop a message!