Let there be light ...
When God separated light from darkness, light became an essential part of our lives. Our life today is driven by light and darkness, most of us get up in the morning and sleeps sleep at night. We work during the day and sleep at night. But we must not forget about the colour of light too. If we would live in a black and white world we would be restless and nervous. The colors have different effects on people's emotions. The reactions and attitude towards certain shades of color are caused by the power that the colors exerts on our psychic: they can soothe, relax or heal us, they can make us sad, they can induce a state of nervousness, influence us in a way that even today is not fully understood. Hundreds of studies have been carried out by the scientific community regarding the decisive influence of color. You can read about this at:
- ScienceDaily - Lighting color affects sleep, wakefulness;
- NCBI - Effect of Color Light Stimulation Using LED on Sleep Induction Time;
- OSU - What Color is Your Night Light? It May Affect Your Mood;
- Nature - Healthy, natural, efficient and tunable lighting: four-package white LEDs for optimizing the circadian effect, color quality and vision performance - very interesting article with many useful resources;
- The New York Times - Can Orange Glasses Help You Sleep Better?...
and many many more...
There are many commercial applications that try to highlight the influence of colour, without having the intention to advertise, I would like to enumerate some of them:
- Auraglow Mosaic Glass LED Flameless Flickering Candle;
- Mi Bedside Lamp;
- 27 Mood Lights to Keep You Happy, Relaxed, or Focused;
- Somneo Sleep and Wake-Up Light;
- UP - The Smart Light for Healthier Sleep/Wake Cycle.
Also, hobbyists, amateurs, professionals, or instructabelists have come up with a number of accomplishments:
- Satisfying LED Mood Lamp - 3D Printing and Arduino DIY;
- $10 DIY WiFi RGB LED Mood Light with ESP8266 (Step by Step);
- RGB Lamp using the ESP8266 running a custom Wi-Fi web server and WS2812B LED strip;
- How to Make Orbeez Mood Lamp ! DIY Orbeez LED Mood Light;
- Nano Pocket Mood Lamp (USB)(Attiny85);
- Watch How I Used a Smart LED Bulb in the Making of a Lamp;
- Turn Me On, an ATtiny RGB Mood Lamp;
and still many other projects ...
With this project I tried to bring a small contribution from my turn of my own in this field.
The Soothe&Refresh Smart Lamp is a device that connects to the Internet, takes the exact date and time, and then, based on a supplied location, it calculates when the sun rises, sets and the twilight time. During twilight, the lamp switches on gradually by using colors that help induce sleep and switches off after a scheduled period. It then starts at a certain time, at awakening hours, using different colors, colors that lead to an easier wakening and that charge you with positive energy which provide a GOOD MORNING !!!
Also, during the night, you can schedule hours for the lamp to shine with a particular color, so if you wake up during the night you know how much you have to sleep until the morning... :)
I tried to make the project as easy as possible and the final device to be a decorative object that looks good.
The electronics for this projects are very simple. There are only a few and very cheap components I have used:
- An ESP-01 microcontroller module;
- A 5v to 3.3v stabilizer module;
- A WS2812 RGB LED strip 1m (60 led/m, self-adhesive);
- A 5.5x2.1mm DC Power female jack with 10cm cable;
- A 2pin screw PCB terminal block;
- A 5v/2A power adapter;
- An USB type A female adapter - I used an USB to mini USB adapter (optional).
For the lamp itself:
- A glass vase from JYSK;
- 3D printed cylindrical plastic support piece (to be designed...) or a cylindrical wooden support piece;
- 3 bags of decorative transparent acrylic stones;
- White paper, tracing paper, cardboard, glue, wires…'
links are for informative purposes only, please do not consider them as ads
Step 1: Construction
The schematics is in the picture above, also you can see in the photos how the soldered parts actually looks.
I used a cardboard piece, the support from some paper towels, a cylinder about 45 mm in diameter and about 120 mm height, glued some white paper (xerox paper) on it to be more reflective. You can make the cylinder, if you want, from a cardboard piece. Now the hard part… I split the LED strip in two, each with 30 LED’s and stuck those two pieces on a spiral line starting from the opposite ends of the base of the cardboard roll. You can see in the photos how I have done this. To be easier, I first made some tries and with a pencil I drew some guide lines. I glued a “cap” on the superior part of the LED cylinder. I made all the soldering, like in the pictures above, programmed the ESP-01 module and made some tests. After, I glued a cardboard piece to the base of the LED cylinder for supporting the LED assembly. I made a hole at the base of the glass vase for power wires to pass through and screwed into the PCB terminal block. Then, I assembled the wooden base, glued to the vase and soldered all the wires to the PCB terminal block. Next, I made a cylinder from tracing paper to act as a light diffuser. I set the LED cylinder and the tracing paper cylinder in the middle of the vase and filled it with the acrylic rocks. All done!
Step 2: The Software
For controlling the lamp, I installed on the ESP module a standalone Web Server. The code is based on BVB_WebConfig_OTA_V7 from Andreas Spiess and ESPBASE from Pedro Albuquerque but the very original piece was written by John Lassen – ESP 8266 Arduino IDE WebConfig. My opinion is that his work is the best to be used as a webserver for configuring the ESP8266 microcontroller even today. I used this code in my other project here on instructables, the "VERBIS" wordclock. I modified the interface a little bit and added some new menu entries ( more about this in the next part “using the lamp” …)
To find the latitude and longitude where the lamp will be used, I registered with ipstack.com and obtained an API access key, you must do the same and insert your own access key in the code.
The calculations for sunrise, sunset, twilight are made offline. I adapted a code in C that I found on “The Snippets Collection” and it is called sunriset.c. I compared the results of this routine with some online data from dedicated websites (like suncalc.org) and they are pretty the same, I obtained no more than tens of seconds of difference.
The default color palettes I found with the help of PaletteKnife on cpt-city website where there are hundreds of gradient palettes you can choose from for this (and other) project(s).
The colors effects used I found in Mark Kriegsman Gist snippets namely the following routines:
- soft, warm twinkles, for no wifi effect;
- animated, ever-changing rainbows , for no NTP effect;
- animated, shifting color waves, for soothing and refreshing coors effect;
The programming of the ESP module I have made like in my previous instructable VERBIS - Desktop 8x8 RGB LED Matrix Word Clock, look at step 3.
The source code for the project is on github.
Step 3: Using the Lamp
I can briefly describe how the lamp works in the following way:
- Power up the lamp, find on the phone a wifi access point named as “S&R_SMART_LAMP” and an ID, connect with the password (the default one is “admin1234” but you can insert your password in the code, it must be a minimum of 8 characters long);
- Start Chrome and navigate to 192.168.4.1, go to “Network Configuration” menu point, wait for the scanning to finish, choose your router, enter the router's password and push “Save”;
- Wait in the wifi interface for the “S&R_SMART_LAMP” to reappear, connect to it and go in the browser to 192.168.4.1 again and enter “Network Information”. Note the IP from there.
- Restart the Lamp (power down - power up), with your phone connect to your router, then navigate to the IP found in “Network Information”;
- Verify at “Manual Time Setting” if the date and time are ok, then go to “Geolocation”;
- Push “Locate”, wait for the latitude and the longitude to appear, then push “Save”. The sun data will be calculated and displayed;
- Now the Lamp is prepared to work and when you access “Schedule Settings” you can pick some other settings: you can change the default palette with your own, change the delays (after twilight and wake up), change the alarm and the night hour colors, test the lights, skip some of the features.
I hope the attached video will clarify how the lamp can be configured.
Step 4: Some More Info...
- You can enter manually the latitude and longitude values and calculate sun data;
- You can use the lamp without internet connection but you must enter manually the date a time;
- If you use the lamp without internet you must remake the settings at every restart (power outage)
- From ipstack.com can be also acquired the timezone, the daylight saving and the current time, maybe the code can be made simpler without the ntp client part;
If you have any question or need some more info I will try as much as possible to answer them.
I hope my project will be accepted as an entry in the "Rainbow" contest and that it will be voted by as many of you.
This is an entry in the
Colors of the Rainbow Contest