Sunlight Simulating Window
Preliminary
Hey everyone! I'm Steven Hatcher, and this is my first time participating in an event like this! This community seems wonderful. From the glance I've taken at different blog posts, I am motivated by everybody's unique ideas and brilliant project executions!
I have created a False Window that simulates the current sunlight of your location using an ESP32 microcontroller and WS2812B lightstrip. I live in an active household, so my workstation is tucked away in a quiet corner in the basement. This would typically be an ideal spot to get work done; however, there are no windows around me! As a person who faces time blindness, I've found myself hyperfixated on projects way too late into the night (or next day, yikes), because I don't "feel" the current time like others might.
Spring Clean Theme
My project had been years in the (thinking about) making, however, I had only started the initial prototype a year ago - the core of this design was an old monitor with the LCD panel removed, leaving just the backlights and diffuser panel. This, however, generated an intensity of light that I could not humanly comprehend, let alone withstand. I wish I had taken a photo to demonstrate exactly how bright it was - I worry that even just seeing a photo of it might turn you to dust. Instead of becoming discouraged by this result, I grew motivated to reach the solution I desired, so I began to brainstorm new ideas. This fascination led me to a topic I had always wanted to learn: Arduino. I've always been intrigued by Arduinos, but felt overwhelmed whenever I'd watch tutorials. These tutorials tend to expect you to learn everything before attempting to build anything for yourself. Ultimately, I decided to develop a solution to a problem I was facing and to learn in an applied manner. I quickly found out that the ESP32 was a much better choice for my project, and fell in love with the idea of my coding directly affecting something tangible. I am grateful I held on to this project idea and believed in myself to put it all together from scratch, learning with every step and mistake. I'd like to extend my warmest thanks to this community and the Spring Clean initiative. I wouldn't have taken this leap of faith had I not heard about this event.
Software
The heart of this project is an ESP32 microcontroller running the software I wrote, which can be found here. Its WiFi capabilities are utilized at the beginning of each day to retrieve the times for dawn, sunrise, sunset, and dusk for the current location in UTC format using the SunriseSunset API.
At dawn, the light produced by the WS2812B lightstrip fades in gradually as a warm orange and increases in brightness as the current time approaches sunrise. Using a custom FastLED color palette defining 256 color indices, golden hour is simulated in both the morning and evening, with the light fading from orange-to-white, and white to orange, respectively. Here are a couple of photos showing the golden-hour transition while I was prototyping the RGB values to use:
Initially, the brightness would increase from 0% to 30% from dusk to sunrise, respectively, then increase linearly up to 100% at noon. I have since updated the lighting to follow a sine wave, and I find that the hastened change during the first and last 1/6th of the day replicates the current sunlight more accurately!
The x-axis of the graphs represents the time of the day, and the y-axis represents the brightness of the lights. The graph on the left demonstrates how I had originally coded the brightness to increase and decrease throughout the day using linear functions. The graph on the right represents how brightness is currently coded as a sine wave. As the graphs illustrate, the transition in brightness is now much smoother.
Hardware
Electronically, this project is straightforward. The parts are:
- ESP32 Microcontroller
- WS2812B Lightstrip
- 20AWG Wire
- 5V DC connectors (Male & Female)
- Inline 5V DC switch
- 16V 1000uf Capacitor
- Diffuser sheet recycled from a monitor
- 2x Picture frame & hinges
Here is the wiring diagram - This is my first time putting together a diagram for a project, please let me know if any changes should be made:
It looks equally simple off-paper too. I'm going to continue polishing the way it's built, I just lack the time at the moment. It functions as it needs to anyhow! The lightstrip lines the inside of the rear frame, and a second frame is stacked on top of it to create the required space for the diffuser sheet!
The ESP-32 is mounted on the back, with the WS2812B's Data line (green wire) run to GPIO 23 and a shared ground run to GND. It is powered via USB-C, whereas the light strip is powered by its own 5V DC power supply.
Conclusion
I'm grateful that I came across this competition initiative. It was the brief kickstart that I needed to start playing around with microcontrollers. This project opened a whole new world for me. I went into it with the hopes of learning to use an Arduino, and came out of it with a basic understanding of a more complex microcontroller. This project serves its purpose incredibly well. I have it mounted on the wall that I look at while working, and the sunset simulation helps me feel naturally tired as the sands of evening gently fall from between my fingers.
I'm quite shy, so this is a good opportunity to step out of my comfort zone as well. I'm happy to receive any critiques you may have! If you'd like to take a look at more of my recent projects, feel free to take a peek at my portfolio here!