Inverse the natural ambient lighting in a room. This project consists of a light sensor (VCNL4040 connected to an ESP32) and any number of ESP32s connected to 30 LED NeoPixel strips. The light sensor broadcasts ambient lighting data on UDP which is received by the LED strips.
The project uses the following components:
- ESP32 dev board
- VCNL4040 (https://www.sparkfun.com/products/15177)
- Qwiic cable with female pins (https://www.sparkfun.com/products/17261)
- USB to Micro USB
- Power source (in my case a power bank)
- ESP32 dev board
- NeoPixel strip with 30 pixels (must be WS2812) (https://shop.m5stack.com/products/digital-rgb-led-weatherproof-strip-sk6812)
- Female to male jumper cables
- USB to Micro USB
- Power source (in my case a power bank)
See this page for wire color coding on the Qwiic cable.
- GND > GND
- 3V3 > 3V3
- GPIO16 > SDA
- GPIO17 > SCL
- GND > GND
- 3V3 > 3V3
- GPIO16 > data in
Prepare the open source Toit language by following the steps here.
Compile an ESP32 image from the light sensor program and flash it with:
cd <path-to-toit-lang>
make flash ESP32_ENTRY=<path-to-repository>/src/als_sensor.toit ESP32_WIFI_SSID=<wifi-ssid> ESP32_WIFI_PASSWORD=<wifi-password> ESP32_PORT=<device-port>
Connect the ESP32 that controls the light sensor to your computer and flash the program by pasting the output from make esp32
into the terminal.
Compile an ESP32 image from the pixel strip program and flash it with:
cd <path-to-toit-lang>
make flash ESP32_ENTRY=<path-to-repository>/src/pixel_strip.toit ESP32_WIFI_SSID=<wifi-ssid> ESP32_WIFI_PASSWORD=<wifi-password> ESP32_PORT=<device-port>
Connect the ESP32 that controls the light sensor to your computer and flash the program by pasting the output from make esp32
into the terminal.
Once the programs have been flashed, they will start running every time the ESP32s are powered on.