⚠️ Very Important: ⚠️ You must power down your Pi before plugging in the electronics for this experiment.
Power down your pi.
Plug in your “T-Cobbler Plus” connector, as shown.
Make sure you get the connector plugged in exactly over the pins as shown! Do not twist the cable/miss any pins, or it will not work.
Connect the wires from the sensor to the breadboard in this configuration:
Pi 3V to sensor VIN (red wire)
Pi GND to sensor GND (black wire)
Pi SCL to sensor SCL (yellow wire)
Pi SDA to sensor SDA (blue wire)
Install this essential library from the command line (terminal) of the Raspberry Pi:
sudo pip3 install adafruit-circuitpython-veml7700
if that doesn't work, try:
sudo pip3 install adafruit-circuitpython-veml7700 --break-system-packages
Open the editor “Thonny Python IDE”
Open the file from your downloaded examples: light_intensity.py
You may want to save a copy so you have the original.
Press “Run” in Thonny.
When you press the button you should see "button pressed" in the debug window.
Press “stop” to stop running the file.
Challenges
Have an LED light up when the device is in the dark.
Create an empty array that is appended with the light intensity every 10 seconds.
Can you hook two sensors in a row, combine the code and get multiple environmental data points? (hookup image below)