← All projects in the gallery

Mood Light

by jonathan harrocks

The one that makes the board do something. The CYD already has an RGB LED on GPIO4, GPIO16 and GPIO17. It is common anode, so each pin sinks its colour and the outputs here are configured active-low to match - tap a colour and all three channels are set at once, so what you see is always the whole state of the LED. A BH1750 on CN1 reads the room. When it drops below 20 lx an automation turns the lamp on by itself. The only part to buy is the light sensor. Everything else is already soldered to the board. Three pins that are each on or off make eight states, and all eight are here. The lamp on screen is a disc that takes the colour, two fainter ones behind it for the glow, and a picture of a highlight on top that never changes - so one sprite makes a lit sphere of any colour.

About this design

Mood Light is an LVGL interface for the ESP32-2432S028R "Cheap Yellow Display" (ILI9341 320 x 240, XPT2046 touch), with 1 screen and 19 widgets, made for Arduino (C++) on LVGL 9.

Screens

  • Screen1

Hardware and build

Board
ESP32-2432S028R "Cheap Yellow Display"
MCU
ESP32 (WROOM / WROVER)
Display
ILI9341
Resolution
320 x 240
Touch
XPT2046
Graphics library
TFT_eSPI
LVGL
v9
Exports to
Arduino (C++)
Peripherals
BH1750 (light)
Libraries
lvgl, TFT_eSPI, BH1750

Notes from the author

Drive the CYD's onboard RGB LED from the touchscreen, and let it turn itself on at dusk.

Using it

Open a copy in the designer and it is yours to edit: restyle the screens, move it to another board, and export the Arduino (C++) project. Designing is free, and a copy needs no account. Open the designer.