LUMOS: Smart Lamp for Better Sleep

169,521

730

54

About: I'm an Electronics Engineer who likes to make Doze Lamps, Lumen Powered Thingamajigs, Almighty Brainy Buttons, Tweeting Weather Stations and share them on Instructables.

There are plenty of smart lighting systems out there that let you change light colors and dim with just your smartphone (or even your voice), but this Open Source lamp called Lumos is a smart lighting system that works to benefit your health.

Lumos mimics the natural light of the sun as it passes overhead each day, generating bright blue light in the morning and warmer amber light in the evening.

Decades of research from Harvard Medical School , NASA , and leading institutions around the world have revealed a great deal of information about how light impacts and regulates our health. They explain that blue light aids in the production of cortisol, which is important to give the human body energy in the morning, and red light aids in the production of sleep-inducing melatonin.

Almost 20% of the world's population is sleep deprived & possibly spends more than 8 hours a day under an unnatural light, which can throw off the body’s internal clock and prevent it from performing at optimum levels.

The Lumos smart lamp aims to change that by pairing with WiFi and uses Machine Learning to adjust the light to match your sleep schedule.

Develop:

Are you a programmer, engineer or designer who has a great idea for a new feature in Lumos? Maybe you have a good idea for a bug fix? Feel free to grab our code, schematics & CAD files from Github and tinker with it.

LUMOS Repository Github

Step 1: Parts & Materials

Electronic ComponentsSpecificationsQuantityBuy
Raspberry Pi Zero WWLAN/WiFi1

Amazon

ArduinoNano/Pro-Mini1

Amazon

RGB LED Strip12VDC, 5m1

Amazon

5V Voltage Regulator

LM78051

Amazon

MOSFET

IRF540

3

Amazon

AC-DC Adapter

Mains AC to 12VDC

1

Amazon

MaterialsDimensionsQuantityBuy
MDF Sheet

5mm, 60cm*60cm

1
Frosted Acrylic Sheet

5mm, 60cm*60cm

1
Mica Sheet

1mm, 2m*1m

1

Step 2: Mechanical Design

Specifications:

MDF Base: Outer Radius: 26 cm, Inner Radius: 20 cm.

Frosted Acrylic Diffuser: Outer Radius: 26 cm, Inner Radius: 20 cm.

Mica Support Rings: Width: 4 cm, Thickness: 1 mm, Outer Ring Length: 164 cm, Inner Ring Length: 126 cm.

The circular lower base of the lamp is made out a 5mm MDF Sheet whereas the top circular diffuser is made out of a 5mm Frosted Acrylic Sheet. The laser cutter files for both the base & diffuser are in the PDF below. The base & diffuser are supported by two rings made out of 1mm Mica Strips. The distance between the diffuser & the base is 4cm. Using a Mica cutting blade, cut the two Mica strips which will form the Mica support rings. The inner circle from the remaining MDF sheet once laser cut can be used to laser cut the Electronics Enclosure Box.

Step 3: Mechanical Assembly

Start by marking the drill holes on the ends of each mica strip using the template attached below. Once the holes have been marked & drilled, bring both ends of the mica strip together such that the holes on each end are aligned. Do this for both of the mica strips which form the two support rings.

Using the leather string, weave a knot between the holes in order to securely join the two ends of the mica strips. Do this for both of the mica strips which form the two support rings. You will now have two Mica support rings: Outer & Inner Ring with a radius of 52 cm & 40 cm respectively.

Using a mixture of Super Glue/ Instant Adhesive & Baking Soda, stick the support rings to the inner & outer edges of the MDF Base. Drill a hole for the power & control wires at the bottom of the MDF base.

Remove the protective layer from the RGB LED Strip & begin sticking the strip to both support rings. Stick the LED Strip as close to the base as possible. This will ensure that the light is evenly diffused & that individual LED outlines are not visible. Ensure that the 4 wires (Power & Control) are connected to the LED Strip & are routed through the hole made in the MDF Base.

Step 4: Electronic Assembly

The Raspberry Pi uses Wi-Fi to get the location specific time zone & also uses its internal Bluetooth Module to analyze RSSI values of a Smartphone in order to calculate proximity of the smartphone

The Arduino is used to control & test the analog values which control the intensity of the RGB LED Strip. By changing the analog value using PWM we can control the color produced by the LED Strip.

The Arduino can only supply a maximum of 5V, 20mA through its I/O pins. Whereas the RGB LED Strip generally requires a power source of minimum 12V, 1A.

The solution to this is using a MOSFET as a switch. The Gate pin of the MOSFET can be used to control the ON/ OFF state of the MOSFET. The Source pin is connected to LED Strip while the Drain pin is connected to Ground. Each Gate pin of a MOSFET is controlled by a separate PWM pin on the Arduino. The LED Strip has 4 pins: +12V, R, G & B. The +12V is connected to the +12V of the 12V power adapter. The R, G & B pins are connected to Source of each MOSFET respectively.

The Arduino makes it easy to calibrate the colors of the RGB LED Strip. Calibration of the RGB values varies with the manufacturer & model of the RGB LED Strip. If calibration is achieved, the cost can be reduced by using an appropriate Digital to Analog Converter(DAC).

The Raspberry Pi & Arduino communicate using the I2C protocol.

The Eagle CAD files & Schematics are attached below.

Step 5: Software

The Raspberry Pi is used to detect the presence of a human being & monitor & track the sleeping habits of the human being. Depending on the sleeping habits of the human being, the color changing sequence will be adjusted.

The Raspberry Pi is running the latest version of NOOBS OS. It has to be configured to the location specific time zone. The MAC address of the Bluetooth Module of the user's Smartphone is verified when tracking the presence of the human being. When the human being is asleep, their smartphone should be placed as close as possible to the lamp. Hence it is recommended to place the lamp close to the bedside table. The RSSI strength will vary depending on the distance between the Raspberry Pi & the Smartphone. Once the location of the Raspberry Pi in the room is fixed, a threshold value can be set to configure the Sleep tracking.

For the first two weeks, a pre configured lighting sequence is initialized while the users sleeping habits are tracked. Once sufficient data is collected to determine the sleep & wake up times the system calculates the length & time of the Color Lighting sequence. Typically the light initializes the Sunset phase an hour before sleep is expected and Sunrise phase half an hour before a wake-up/ rising is expected.

Since there are multiple software files, the code for this Instructable can be found here:

LUMOS Software Files

Step 6: Open Source

All the files including code, electronic circuits & schematics, CAD & design files are Open Source & are available on the Github Repository.

LUMOS: Open Source Repository

The software & electronics is regularly updated & modified.

The initial design, software & electronics was created with the help of two of my friends Callum & Mark.

We encourage other Engineers, Developers, Designers, Architects, etc to help us by contributing to the Repository.

If you have any alternate design layout that you would like to make, you can upload the CAD & layout files to the repository, so that others can recreate it too. If you think that we can use an alternate Microcontroller to control the lighting sequence, you too can contribute to the Electronic Circuits & Software.

Explore Science Contest 2017

Runner Up in the
Explore Science Contest 2017

Home Improvement Contest 2017

Second Prize in the
Home Improvement Contest 2017

Invention Challenge 2017

Second Prize in the
Invention Challenge 2017

Share

    Recommendations

    • Plastics Contest

      Plastics Contest
    • Optics Contest

      Optics Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018

    54 Discussions

    0
    None
    HeATThER

    Tip 4 months ago

    How about a timelaps video of the light cycle?

    0
    None
    dushyantahuja

    Question 7 months ago on Step 5

    Was just going through the GitHub repository and could find the actual software that controls the LEDs. Can you please point me in the right direction.

    0
    None
    Arpitsh

    1 year ago

    Great project .

    0
    None
    Matlek

    1 year ago

    That is an excellent article! And congrats for the 3 contests you won ;)

    1 reply
    0
    None
    zaid697

    1 year ago

    Could it be possible to replace the wifi with a clock? I have no wifi

    7 replies
    0
    None
    ПавелП23zaid697

    Reply 1 year ago

    of course, you even need no raspberry. you may use gps receiver to get time and location. but anyway you should change avr's firmware.

    0
    None
    zootalawsJonathanrjpereira

    Reply 1 year ago

    Depending on the level of GPS support you need, you can get an I2C GPS with breakout for >$10: https://www.aliexpress.com/item/For-GYNEO6MV2-GPS-Module-NEO-6M-GY-NEO6MV2-Board-with-Antenna-R179T-Drop-Shipping/32815376782.html

    Not that I would consider building a lamp with GPS :) But they are great for playing with.

    0
    None
    Jonathanrjpereirazaid697

    Reply 1 year ago

    You could use an RTC, but you would be misssing out ona couple of updates and features.

    0
    None
    SilkeC2zaid697

    Reply 1 year ago

    Arduino has a built in timer (although it's reset every time the power unplugs), not sure about the Pi but probably has it as well. You could reset the time once a day by connecting to the smartphone's clock to ensure accuracy.

    Alternatively you could use an RTC module to keep track of time.

    0
    None
    agr00mzaid697

    Reply 1 year ago

    You definitely could. It would then just change color based on time and not have all the extra features.

    0
    None
    NikyN2

    1 year ago

    and here I am, with just a smart bulb (yeelight) automatically controlled by tasker. the phone even detects when I'm on the light sleep phase then triggers a sunrise light alarm.

    I guess I could put a sunset profile too , but since I go to bed at different times, I prefer to just manually set the brightness and color as I'm getting sleepy.

    nice instructable, but IMO too complicated (arduino + raspberry?! I'm too poor for that!!) and with not enough functions (... since my setup includes sleep phase detection and trust me - the difference in waking energy is HUGE).

    PS: not trying to be negative - this can also be viewed as "ideas to improve the project" (ESPECIALLY the sleep phase detection! ... no alarm clock should be without that anymore. )

    5 replies
    0
    None
    BillDauteriveNikyN2

    Reply 1 year ago

    Woah, looking them up, some of the Yeelights don't look cheap. I haven't been paying much attention to what's on sale in this area.

    Which Yeelight did you get/are they good?

    + Does tasker talk to it directly over local Wifi, or via a cloud service?

    ---

    Something I've been working on (tinkering really) uses an ESP8266 wifi chip, but the addressible LEDs I'm using aren't that cheap.

    I'm still simplifying set up, have no enclosure for it and it's really a testbed right now), but it is largely a "slave" device accepting commands to give max flexibility (with sensory & time context available)...

    ...BUT a highly focused device like the OP's could be made cheaper than mine (possibly single colour LED sets, RPi zero, or an RPi-free version just using an ESP8266). Since it's open source, it's potentially everyone's project to contribute code & design to, not just his.

    0
    None
    NikyN2BillDauterive

    Reply 1 year ago

    I paid like $20 for an RGB yeelight bulb (NOT a lamp, but why would I want a full lamp? I already have the thing, I just needed a nice bulb for it). you gotta get it on sale or you may pay a bit more (less than $30 still). anyway, they have sales pretty often. pages like banggood, gearbest or dealextreme are where I usually buy that kind of stuff.

    the official yeelight app (NOT MiHome) supports tasker (it just installs a plugin), and, my bulb at least, connects via wifi. no clouds required.

    as for whether they're good, I'm very happy with it, but I have to admit, sometimes it doesn't respond too well/in time. I think it also has something to do with my router and the way it manages DHCP, since changing some addresses seems to have mostly solved the problem (... the phone wouldn't detect it was on so it wouldn't do anything). I also had problems connecting from the laptop (to the router), so it's probably all the router's fault. but still, it's something that I do have to resolve.

    good thing with the bulb, it's rated at 600 lumens (IIRC), and I'd think it delivers. so e.g. for alarm clock, you just need one. though, as "ceiling lamp" for a smallish room, I would get two. but I like lots of light. :)

    0
    None
    BillDauteriveNikyN2

    Reply 1 year ago

    i think I've found the one now:

    https://www.banggood.com/Original-Xiaomi-Mi-Yeelig...

    Interestingly they're using 550 lumens of warm white LED to make up most of the max brightness figure, with the RGB LEDs on their own maxing out at 275 Lm. May well just be RGBW LEDs.

    I found a teardown of the plain white version:

    https://hackernoon.com/inside-the-bulb-adventures-...

    ------

    For comparison to self-builds (this example uses more expensive, pre-wired addressable LEDs as that's what I've been working with recently):

    The lumens rating for the NeoPixel type LEDs (WS2812) is (according to one seller) 18-20 Lm per chip, so 14 should match the Yeelight RGB output and 30 or so would match the peak output of the warm white.

    An ESP8266 (can be used as a wifi Arduino) dev board can be picked up for $2-$3. A 30LED WS2812 strip ~$6 pre-wired

    https://www.banggood.com/1M-WS2812-IC-SMD5050-Drea...

    So call it $10 with wiring, components & board. Still needs a bit of coding, maybe a few dollars on a diffuser, a power supply, an enclosure for the electronics and then some work to mount it.

    vs. $20 plug and play into an existing light fitting.

    The home build has room to reduce the cost further and has loads of potential features through addressable LEDs, but the Yeelight bulb price is pretty impressive and it's a finished product :)

    0
    None
    NikyN2BillDauterive

    Reply 1 year ago

    yeah, DIY is always more flexible, and of course more fun. but I have ZERO experience with arduino or even microcontrollers, so I would have to learn first. for roughly $20, I have a bulb that I can manage from android. add tasker to the equation, and you can do pretty impressive things with it (and the official yeelight app has tasker support).

    I guess it all depends on whether you want to learn, and *maybe* save a few bucks, or just get the work done.

    I'm totally a DIY person, but microcontrollers are still quite advanced stuff for me, haha. someday I'll have the money and the time to learn. :)

    0
    None
    JonathanrjpereiraNikyN2

    Reply 1 year ago

    I'm working on reducing the total cost now. Both alternate materials & electronics.