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.

6 thoughts on “Arduino Uno to the rescue

  1. I’ve just purchased a SI1145 for my Raspberry Pi. I’m rather hoping I can get it working fairly easily in C++. I’m also hoping to use the IR and visible light to go along with my Irradiance meter which has worked very well.

    If you ever find out more information about this sensor please let me know, I’ve searched high and low for someone who has hooked it up to the Pi without finding anyone yet. My sensor hasn’t arrived but it will Monday / Tuesday so I’ll be coding as soon as it arrives.

    1. Hi Andy,

      I found most of the code for the SI1145 by way of the raspberry pi forums. I used python when it was connected directly to the pi. It is a rather new sensor, probably why your not getting a lot of hits, I would suggest asking on the raspberry pi forums http://www.raspberrypi.org/forums/

      Any reason why you are using a pi rather than an arduino board? you could get a tiny arduino and interface that with the pi to gather the readings.

      1. It was to get my boy into programming and electronics and school will be using the PI. I’ve just quit my job also and am hoping to make custom built circuits for people, starting with my ex boss, have just got my first commission which is to make an electric gate controller. I’m a Linux man and the PI puts me right in my comfort zone as soon as it powers up.

        ….also hadn’t heard of the arduino until I bought the PI.

    2. Did you find the code to connect the UV sensor to Paspberry Pi in the end? I’m trying to connect it , but not very successful as there is nothing on the net that is working. Please, let me know if you found anything or wrote the code yourself. Thank you.

  2. Did you get you UV sensor working? …and on the Pi?

    If you are interested I have managed to get it working in C++ on the Pi, and I’m in the process of writing an include file for it.

    You mentioned that the readings were all over the place…yes, so were mine to begin with. You can’t just read the UV index without setting up the VIS and IR (at least I don’t think you can).

    The Adafruit learn page for the SI1145

    https://learn.adafruit.com/adafruit-si1145-breakout-board-uv-ir-visible-sensor/wiring-and-test

    also seems to show values all over the place as well. My values vary but only by a tiny amount, not enough to change the index. I took their code as an example and modified it slightly. I never actually tested their code because I only have the Pi.

Leave a Reply to Andrew Cancel reply

Your email address will not be published. Required fields are marked *