Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prakrititz/circidianlightning-eyantra
This project implements circadian lighting using an ESP32 and NeoPixel LEDs, with a Gaussian-based color temperature model for natural day-night transitions. Features include automatic lighting adjustments based on location, manual and auto modes via a Flask web interface, and real-time color temperature correction for comfortable lighting.
https://github.com/prakrititz/circidianlightning-eyantra
ardui esp32 flask iot location-based-lightning smart-lighting
Last synced: 18 days ago
JSON representation
This project implements circadian lighting using an ESP32 and NeoPixel LEDs, with a Gaussian-based color temperature model for natural day-night transitions. Features include automatic lighting adjustments based on location, manual and auto modes via a Flask web interface, and real-time color temperature correction for comfortable lighting.
- Host: GitHub
- URL: https://github.com/prakrititz/circidianlightning-eyantra
- Owner: prakrititz
- Created: 2024-09-02T21:38:14.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-12-08T22:24:03.000Z (about 2 months ago)
- Last Synced: 2024-12-08T23:22:31.451Z (about 2 months ago)
- Topics: ardui, esp32, flask, iot, location-based-lightning, smart-lighting
- Language: JavaScript
- Homepage:
- Size: 8.96 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🌈 RGB Simulator for Circadian Lighting 🌙
## 🛠️ Installation
Before starting, install the required Python packages:
```bash
pip install -r requirements.txt
```## 🌟 Technical Overview
This project implements circadian lighting using a sophisticated color temperature conversion process:1. **Color Temperature Distribution**
- We model the daily color temperature variation using a Gaussian (normal) distribution
- The distribution is optimized to fit the given color temperature and time data
- This ensures smooth transitions throughout the day2. **Color Temperature to RGB Conversion**
- The conversion process follows multiple steps to ensure accuracy:
1. Use Planck's laws to convert color temperatures to wavelengths
2. Filter through L, M, and S cone responses
3. Convert to CIE 1931 color space using color matching functions
4. Transform CIE 1931 values to RGB using a conversion matrix3. **Color Correction**
- Due to known limitations in the CIE 1931 color space (which tends to produce bluish values)
- We implement a "warmness" correction using a custom matrix in `step2.py`
- This correction helps achieve more natural and comfortable lighting**Note:** While this implementation provides a close approximation of natural color temperatures, small margins of error may exist due to inherent limitations in color space conversions.
## 🚀 How this works
### 📊 Step 1: Get the color temperature data (Optional)
Use any available sources to obtain color temperature data throughout the day. This step can be skipped as default values are provided.### 💡 Step 2: Hardware Implementation with ESP32 + NeoPixel
#### Hardware Requirements
- ESP32 development board
- NeoPixel LED ring
- Common WiFi network
- Computer to run the Python server**Important:** Both the ESP32 and the computer running the Python server must be connected to the same WiFi network.
#### Hardware Connections
1. Power the ESP32
2. Connect 5V and GND to NeoPixel
3. Connect NeoPixel ground to ESP32 ground (ensures common ground level)
4. Connect ESP32's GPIO 13 to NeoPixel's DI pin#### Software Setup
1. In `esp_integration` folder, modify the ESP32 code:
- Enter your WiFi SSID and password
- Upload to ESP32
- Note down the ESP32's IP address
- After modifying the code, upload it to the ESP32.2. On the Python server:
- Update `master.py` with ESP32's IP address
- Run `master.py` with `python master.py`
- Now ensure both Python server and ESP are on the same WiFi.#### Features
- Flask web interface for:
- Manual RGB value control
- Circadian rhythm simulation control
- Return to automatic mode
- Automatic circadian rhythm when left unattended
- Location based Circadian Lighting
- ![image](https://github.com/user-attachments/assets/7a2a45dc-441c-4ebf-aa03-d74a9b7bce40)#### Other Implementation Options
Arduino and Simulation modes are planned for future releases.## Demo
This demo was run by clicking the `Test_CSV` button in the website, which rapidly goes through lighting over the course of the day.
https://github.com/user-attachments/assets/86c8f049-f758-451c-9e58-4bdbbcfdf267
## 🔜 Next Steps
* Integration with sunset/sunrise by location API to automatically configure circadian lighting for any location/timezone [DONE].
* Introduction of various color specific matrices to offer color-targeted Circadian Lighting for different rooms. For example, green-ish circadian lighting in hospital operating rooms, warm or natural in cosy areas, blue-ish in areas which need more productivity.
* Deployment on Docker or Creation of a Mobile App.