Sometimes it is not enough to use a photoresistor to measure the brightness or the darkness: then Adafruits TSL2561 is used.
It comes with I2C and can be easily connected to the photon at D0 (= SDA) + D1 (= SCL). I did not even bother with Jumper Wires, but plugged it directly onto the mini breadboard. Since D4 is not addressed, I can easily create GND here and ensure the power supply via VIN or 3V3 via photon.
In the Particle WebIDE already the necessary Adafruit-Libary (in several options) was available (search for ADAFRUIT_TSL2561_U) so I decided to flash the existing example on my photon. Functioned without problems with adaptation of the PIN assignment. Otherwise you will receive the provided error message.
The values increase with increasing light influence: on a nice, sunny day on the terrace I could measure up to 38.000 lux. According to the datasheet, up to 40, 000 lux can be measured at maximum; The 17, 000 lux during initialization are hard-coded from the Libary and come from a test by the publisher (see at the end of Adafruit_TSL2561_U.h).
Start in terminal your Particle CLI with the command
particle serial monitor
You should get the following information at serial output start:
Light Sensor Test
------------------------------------
Sensor: TSL2561
Driver Ver: 1
Unique ID: 12345
Max Value: 17000.00 lux
Min Value: 0.00 lux
Resolution: 1.00 lux
------------------------------------
------------------------------------
Gain: Auto
Timing: 13 ms
------------------------------------
3279.00 lux
3261.00 lux
... and more values
Interesting for photographers who want to set the right exposure time for the photo, or just to set thresholds. As usual, your imagination and creativity have no limits in the DIY environment.
Of course, the values can be reported via Blync or other service providers to your smartphone or recorded in databases.
Comments