Now that I have all the parts I need, I decided to do some work on ππ
. Soldering took longer to gather all the pieces than to actually put on the connector. I quick look at the pin out and I had the digital luminosity
sensor connected to the Raspberry Pi. Programming was a little more tricky. The documentation for the device wasn't great, and the example code was written for an Arduino but a Raspberry Pi. However, it didn't take too long to figure out how Linux deals with the I2C bus (guess what? It's a file!). Looking at some example code I was able to reverse engineer it so I could setup and poll the device. Soon I had numbers on the screen that reacted to light. And after more work I had them in the units of Lux
using the example code's conversion function. I used their function because I assumed they verified the math was correct. I have nothing to use as a calibration test, so I didn't want to change anything I don't need to.
After getting the input, it was time to log the data. I setup my program to sample as fast as the device would obtain the data and average those results over a minute. Each minute the data is saved to a CSV file. This will allow me to see what kind of light I can reasonably expect from a location I plan to place a solar panel. Knowing how much light is available will allow me to select a solar panel of sufficient size to power ππ.