This is a small project implementing remote controllable background light for a TV.
The software has a set of themes that can be set at compile time. A theme consist of four colors, one per each corner of the TV. The software calculates linear gradient between the corners.
SK6812 programmable LEDs are used as a light source. These chips consist of red, green, blue and white LEDs.
TSOP34838 IR receiver is used to remotely control the selection of color theme and to set the overall brightness of the theme. The settings are written to EEPROM on Atmega328 microcontroller to persist the selection even when the power is off.
Here is a prototype of the project using Arduino Nano, connected to a small breadboard
and here is second prototype using minimal ATmega328P configuration
PlatformIO is used to build the project.
Following libraries are used:
- light_ws2812 to control the LEDs
- IRLib2 to receive remote control codes
Execute following command to compile the program and upload it to Arduino Nano:
platformio run -e nanoatmega328
Execute following command to follow the debug logs:
platformio serialports monitor -b 115200
This example uses USBasp programmer over ICSP (in-circuit serial programming).
First check the connectivity by reading default fuse values from the microcontroller. It should respond with Fuses OK (E:FF, H:D9, L:62)
.
avrdude -patmega328p -c usbasp
Next program the microcontroller to use external 16MHz oscillator:
avrdude -patmega328p -c usbasp -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0xFD:m
Compile and flash the program by runnig command:
platformio run -e 328p16m