CASA0014, UCL 2025
This project is an MQTT-based IoT device with four modes—Timer, Weather, Idle, and Music—and built-in LED visualizations.
- Timer (WIP): Receives timer commands over MQTT. LEDs gradually turn off as time passes; when the timer ends, they flash until the button is pressed.
- Weather: Detects the current city via IP and fetches weather data from wttr.in. It first shows a 5-second “weather info chart,” then an animation of the current condition.
- Weather info chart:
- Humidity: blue; higher humidity = brighter blue.
- Wind speed: white moving dot(s); faster wind = faster motion; up to 3 dots for high wind.
- Visibility: white brightness scaled from 5 km to 20 km; off below 5 km; full on above 20 km.
- Temperature color:
- < 0°C: white
- 0–10°C: blue
- 10–20°C: green
- 20–30°C: yellow
- > 30°C: red
- Feels-like temperature: aqua if lower than actual; orange if higher than actual.
- Cloud cover: brown; higher cloud cover = brighter brown.
- Condition animation: animations for clear, cloudy, rain, snow, thunderstorm, and fog.
- Weather info chart:
- Idle: Breathing light effect with configurable color.
- Music: Captures ambient audio via a Max9814 microphone and analyzes it with ArduinoFFT. The on-device NeoPixels map sound intensity to color and height, and the 72-LED array renders a spectrum.
- Arduino MKR WiFi 1010
- Max9814 Microphone Amplifier
- Neopixel LED Strip (8 LEDs)
- NC (normally closed) push button
- Micro USB cable
- Breadboard and jumper wires
- Optional: 3D-printed enclosure
- WIFININA by Arduino
- Adafruit NeoPixel by Adafruit
- Arduinojson by Benoit Blanchon
- arduinoFFT by Enrique Condes
-
git clone https://github.com/iiishop/Aura_Light -
Install Arduino IDE and the libraries mentioned above.
-
Open the
Arua_Light.inofile in Arduino IDE. -
Create a
arduino_secrets.hfile in the same directory asArua_Light.inowith the following content:#ifndef ARDUINO_SECRETS_H #define ARDUINO_SECRETS_H struct WiFiCredentials { const char *ssid; const char *password; }; const WiFiCredentials WIFI_NETWORKS[] = { {"YOUR SSID 1", "YOUR PASSWORD 1"}, {"YOUR SSID 2", "YOUR PASSWORD 2"}, {"......", "......"}, }; const int WIFI_NETWORK_COUNT = sizeof(WIFI_NETWORKS) / sizeof(WIFI_NETWORKS[0]); #define SECRET_SSID WIFI_NETWORKS[0].ssid #define SECRET_PASS WIFI_NETWORKS[0].password #define MQTT_SERVER "YOUR MQTT SERVER ADDRESS" #define MQTT_PORT 1884 #define MQTT_USERNAME "YOUR MQTT USERNAME" #define MQTT_PASSWORD "YOUR MQTT PASSWORD" #define MQTT_USER "YOUR DEVICE IDENTIFIER" #endif
-
Modify the
SECRET_SSID,SECRET_PASS,MQTT_SERVER,MQTT_PORT,MQTT_USERNAME,MQTT_PASSWORD, andMQTT_USERmacros in thearduino_secrets.hfile with your own information. -
Connect the hardware as per the wiring diagram.
-
Select the correct board and port in Arduino IDE.
-
Upload the code to the Arduino MKR WiFi 1010.
-
Open the Serial Monitor to see the debug information.
-
You can use the button to control this device.
- Short press (<0.3s): Switch between modes (Timer -> Weather -> Idle -> Music -> Timer ...)
- Long press (>=2s): To toggle the light on and off
- Double press (two presses within 0.6s): To change the local and lumi mode
-
If you want to use some modern method, you can use the Dashboard in this project to control the device, by a http server running on your computer.
- Important: Sensitive MQTT connection information (broker, port, username,password) is now stored in
dashboard/js/config.secret.js. You must create and editthis file with your own server details. Example:
// dashboard/js/config.secret.js export const MQTT_SECRET = { broker: 'YOUR_MQTT_BROKER', port: 1884, username: 'YOUR_USERNAME', password: 'YOUR_PASSWORD' };
- Do not commit this file to public repositories.
- The Dashboard will automatically use these credentials.
- Then open the
index.htmlfile in theDashboardfolder in your web browser.
- Important: Sensitive MQTT connection information (broker, port, username,password) is now stored in
Base Topic Format: student/CASA0014/{username}
Replace {username} with your device ID (defined in arduino_secrets.h as MQTT_USER).
Arduino device subscribes to the following topics to receive control commands:
student/CASA0014/{username}/status- Device on/off state (on/off)student/CASA0014/{username}/mode- Light mode (timer/weather/idle/music)student/CASA0014/{username}/controller- Controller selection (local/luminaire)
student/CASA0014/{username}/debug/#- All debug topics (wildcard)student/CASA0014/{username}/debug/color- Debug color (e.g.,#FF0000)student/CASA0014/{username}/debug/brightness- Debug brightness (0-255)student/CASA0014/{username}/debug/index- Debug LED index (0-71)
student/CASA0014/{username}/idle/color- IDLE mode custom color (e.g.,#0000FF)student/CASA0014/{username}/audio/volume_range- Audio volume rangestudent/CASA0014/{username}/info/weather- Weather JSON data (for Luminaire weather visualization)student/CASA0014/{username}/refresh- Refresh request (info/all)
Arduino device publishes to the following topics to report status and data:
student/CASA0014/{username}/status- Current state (Retained)student/CASA0014/{username}/mode- Current mode (Retained)student/CASA0014/{username}/controller- Current controller (Retained)
student/CASA0014/{username}/info/wifi/ssid- WiFi SSID (Retained)student/CASA0014/{username}/info/wifi/ip- IP address (Retained)student/CASA0014/{username}/info/wifi/rssi- WiFi signal strength (Retained)student/CASA0014/{username}/info/wifi/mac- MAC address (Retained)student/CASA0014/{username}/info/lighter/number- LED count (Retained)student/CASA0014/{username}/info/lighter/pin- NeoPixel pin (Retained)student/CASA0014/{username}/info/system/version- System version (Retained)student/CASA0014/{username}/info/system/uptime- Uptime in secondsstudent/CASA0014/{username}/info/location/city- Current city (Retained)student/CASA0014/{username}/info/idle/color- IDLE mode color (Retained)student/CASA0014/{username}/info/weather- Weather JSON data (Retained)student/CASA0014/{username}/info/audio/data- Audio spectrum data
student/CASA0014/luminaire/{id}- Luminaire RGB data (216 bytes raw data, 72 LEDs × 3 bytes RGB)student/CASA0014/light/{username}/- Local controller RGB data
Dashboard interacts with the following topics via browser MQTT client:
Dashboard subscribes to these topics to monitor device status:
student/CASA0014/{username}/status- Listen for status changesstudent/CASA0014/{username}/mode- Listen for mode changesstudent/CASA0014/{username}/controller- Listen for controller switchesstudent/CASA0014/{username}/debug/#- Listen for all debug messages (wildcard)student/CASA0014/{username}/info/#- Listen for all system information (wildcard)
The wildcard subscriptions automatically receive messages from these subtopics:
- Debug subtopics:
/debug/color,/debug/brightness,/debug/index - Info subtopics:
/info/wifi/ssid,/info/wifi/ip,/info/wifi/rssi,/info/wifi/mac,/info/lighter/number,/info/lighter/pin,/info/system/version,/info/system/uptime,/info/location/city,/info/idle/color,/info/weather,/info/audio/data
Dashboard can publish to these topics to control the device:
student/CASA0014/{username}/status- Control device on/offstudent/CASA0014/{username}/mode- Change light modestudent/CASA0014/{username}/controller- Switch controllerstudent/CASA0014/{username}/debug/color- Send debug colorstudent/CASA0014/{username}/debug/brightness- Send debug brightnessstudent/CASA0014/{username}/debug/index- Send debug LED indexstudent/CASA0014/{username}/idle/color- Set IDLE mode colorstudent/CASA0014/{username}/refresh- Request device to republish info
Assuming MQTT_USER is set to ucfninn, the topics would be:
Subscribe Examples:
- Control topic:
student/CASA0014/ucfninn/status - Mode topic:
student/CASA0014/ucfninn/mode - Weather data:
student/CASA0014/ucfninn/info/weather
Publish Examples:
- WiFi info:
student/CASA0014/ucfninn/info/wifi/ip - System version:
student/CASA0014/ucfninn/info/system/version - Luminaire data:
student/CASA0014/luminaire/16
- Retained Messages: Most
info/*topics use the retained flag to ensure newly connected clients immediately receive the latest state - Wildcard Subscriptions:
debug/#matches all debug topicsinfo/#matches all info topics
- Audio Data:
info/audio/datadoes not use retained flag to avoid stale data - Bidirectional Communication: Some topics (like
status,mode) support both subscribe and publish for bidirectional synchronization


