Category Archives: Planning

Arduino Uno to the rescue

Basically I was having all types of trouble trying to get the sensors working on the Pi, different versions of python (mainly due to library limitations) and probably just poor coding. The Lux sensor was the biggest headache, the returning values were all over the place.

So I decided to try the Arduino Uno, since most of the Adafruit tutorials use a Uno to get them working and it uses C programming language, which is a lot less annoying than python. Basically in the space of the weekend I have all four sensors working and even have the interrupt programming done for the rain sensor.

2014-05-04 12.43.15I also order the UV sensor from Pimoroni, which simply returns values for the UV index, which is something I also wanted to capture data for, to see if the index is slightly raising, which might be a sign of global warming/ozone depletion.

SI1145The SI1145 can also read visible light and IR but those returning values are not calibrated, so I am not going to bother with those.

Although I have found out that my RGB Leds that I have are around the wrong way, the common anode needs to be positive and not neutral, so ebay to the rescue again.

Got a little more work to do with code, then I can figure out how to get the Pi talking to the Uno and get the values posted to the web, so I can start getting that sorted.

Moon Phases, Sunrise and Sunset

So I want the web front end to give some other data, that might be of use to people.

Since I am also into astronomy, I would like to know what phase the moon is in (not that we’ve seen all that much of it recently). Turns out some clever bloke has written a php class to tell you what phase the moon is in, source is available via github.

PHP 5.1+ contains functions for calculating sunrise and sunset. As far as I can see there’s 3 functions, date_sunrisedate_sunset and date_sun_info. The latter looks like the best bet as you don’t have to supply as many variables.

Now I just need to get the GPS coords for my flat.