First up is plugging the light sensor into the breadboard.
The next step is connecting the sensor to the Arduino:
- Sensor GND pin - black wire – Arduino ground pin
- Sensor VCC pin - yellow wire – Arduino 3.3v pin
- Sensor SCL pin - green wire – Arduino analog pin 5 (i2c clock line)
- Sensor SDA pin - blue wire – Arduino analog pin 4 (i2c data line)
The LCD can now be added to the circuit. Since this project uses SPI mode to talk to the LCD, make sure the SPI solder enable jumper has been soldered.
- LCD backpack GND pin - black wire – Arduino ground pin
- LCD backpack 5V pin - red wire – Arduino A5V pin
- LCD backpack LAT pin - orange wire – Arduino digital pin 4 (SPI latch pin)
- LCD backpack DAT pin - blue wire – Arduino digital pin 3 (SPI data pin)
- LCD backpack CLK pin - green wire – Arduino digital pin 2 (SPI clock pin)
For my project, I’m gathering data at reasonably high light levels; so, I went with the following settings:
tsl.setGain(TSL2561_GAIN_0X); tsl.setTiming(TSL2561_INTEGRATIONTIME_13MS);
tsl.setGain(TSL2561_GAIN_16X); tsl.setTiming(TSL2561_INTEGRATIONTIME_402MS);
snprintf_P(output_buffer, 6, PSTR("%5d"), (full_spectrum - ir_spectrum));