Temperature Reactive Breathing Light - Seeed Studio XIAO RP2040 - Carla Guo - CodeCraft Hub
Scene: Smart Home. Edge AI application on CodeCraft Hub for Smart Home use cases.
Devices / BOM: Seeed Studio XIAO RP2040, Grove - Temp & Humi (DHT20), LED Driver Board for XIAO, WS2812/ WS2813/ WS2815 waterproof LED strip, Power Adapter, 12V/2A/24W, American Standard Plug, DC Output, 1.5m
Smart Home application on CodeCraft Hub. A simple temperature-controlled light using a DHT20 sensor and a WS2812 LED strip. It visualizes temperature changes with a blue-to-red color gradient and a smooth breathing brightness effect. Built with a soft light and waterproof LED strip, it can also be placed in aquariums to add ambient color.
Deploy steps
- Hardware Connection
Connect Seeed Studio XIAO RP2040, DHT20, and LED Driver Board for XIAO and waterproof WS2812 LED as show below:
- Firmware Flashing
C onnect your XIAO RP2040 to your PC, click Flash Firmware , and select your port.
Flash firmware to your device (in-app tool on CodeCraft Hub).
- Powering On and Usage
After Flash Firmware and power LED Driver Board, you can see measured temperature is mapped to a color gradient ranging from blue (cool) to red (warm), while a smooth sine-wave algorithm drives a breathing effect between predefined brightness limits.
The current default temperature range is 20–30 degrees. If you are not satisfied with this range, you can adjust it by sending a command via the serial port.
Near the baud rate setting in the serial monitor, locate the “Line Ending” drop-down menu. The default setting may be “No Line Ending.” Please change it to one of the following: LF (Line Feed), CR (Carriage Return), or Both NL & CR (Line Feed and Carriage Return). In the send box, enter min=25 or max=29.1, etc., to adjust the temperature thresholds.
- Future Expandable Directions
Future applications can extend this system to smart home ambient lighting, aquarium mood lighting, plant growth monitoring displays, workspace environmental feedback, and educational IoT demos, providing real-time visual feedback of temperature in different living and experimental environments.