First Project: Sunrise Alarm Clock

Thread Starter

awessel

Joined Oct 5, 2019
1
Hello,

This will be my first venture into an engineering project, and I am posting this to track my progress and also garner some input and advice from some more experienced individuals. I am a student in computer science, so I have a basic understanding of logic and programming(I would think a sufficient level to complete this project). However, I have zero experience with the electronics side of this project. I have done a bit of research on basic concepts like voltage vs. amperage vs. resistance, as well as different types of components like resistors, transistors, microprocessors, etc. but as far as connecting all of these pieces goes, I am clueless. I would say I have a fairly weak understanding of these concepts at the moment, but I'm continuing to conduct further research.

The idea: Make an "alarm clock" that will use light to gradually wake me up instead of being jolted awake by a loud noise or bright light.

I live in Minnesota, and during the winter season I have a very difficult time getting out of bed in the morning. In the dead of winter, the sun does not rise until almost 8 am, so it is very difficult and disorienting to wake up to complete darkness.

I have tried other solutions like smart outlets and switches in the past, but the problem is that the light is either too dim to wake me up, or too bright resulting in a type of reaction similar to a "falling dream"(jolting and flailing as I'm being forced from my slumber. Not an ideal way to begin my day).

I want to use an LED Light Strip that I can mount along the perimeter of my window that will slowly increase in brightness over the course of maybe half an hour. There are a few reasons that I want to use an LED Light Strip over a single high-output led:
  1. Light diffusion. Having the light diffused over a large area should make the source of light(my window perimeter) feel more natural.
  2. Pre-soldered. Most LED Strips come attached to a flexible PCB that can be subdivided at particular intervals to fit a desired length. I'm certainly not opposed to buying a soldering iron and learning how to solder, but I figured this is one less thing that I'd like to worry about.
  3. "Dimmability." I will discuss this in the section below.
In the limited research I have done, I have discovered that dimming LED lights and strips is not as easy as it should be in theory. If this ends up being the case, I figured that I could use an LED Strip with individually addressable lights that I can gradually toggle on to achieve my desired level of light.

Here is a list of components I plan on using. I will include my reasoning for including them on some of them. I would appreciate if you could point out any issues with my understanding of what some of these components do.

  • Arduino Uno. I will use this as the main controller of my circuit. It will drive the display, keep track of the alarm set time, and control the voltage being passed to the LED Strip.
  • LED Light Strip. I am first going to try and use something that is marketed as dimmable(maybe, not sure if necessary), but does not have individually addressable LEDs. I will be using something in the 2400-4000K color temperature spectrum to simulate the sun's color temp at sunrise. Most of these come in 16ft rolls which I will then divide into three pieces to mount to the top, left, and right side of my window's trim.
  • Clock Module for the Arduino. I am not sure if this 100% necessary, as I am unsure of whether or not the Arduino is capable of keeping time on its own. This will be set to the current time and the Arduino will use this value to output the current time to the display. The Arduino will also check the alarm time against the current time to determine whether or not to begin the sunrise simulation process.
  • Buttons and a switch for the display. The switch will toggle between the current time and alarm time, the buttons will be used to adjust the hour and minute of the time that is currently being displayed.
  • LCD or OLED Display. I think this project could definitely be done without this, but it will make it much easier to interact with as I will not need to alter my code and interface through my PC to change the current time(DST) or alarm time.
  • 12v Power Adapter. This will be used to power the system. I have questions about this....
  • Some type of variable resistor, this is where the confusion begins. I know I need some type of resistor to control the current flowing through the LED Strip. I will continue below.
On the subject of resistors:
I am aware of the fact that the Arduino has PWM I/O pins and it is my understanding that these pins can be used to essentially control the brightness of something like an LED by manipulating the pulse width. I am unsure of how this would work in a strip of 300 LEDs. My intuition says it would work fine, but I have no experience to base that on. Some else that I've encountered in my research is a MOSFET. I am not sure if a MOSFET would be needed, and while I am not entirely sure how they work I understand that they can be used a variable resistor which is what I think I need.

Main concerns and questions I have:
  1. How can I use the PWM I/O pins on the Arduino to control the brightness of the LED Strip? The PWM pins on the Arduino only output 5v and the LED strip I plan to requires 12v to run. Do I need to use these to manipulate a more powerful resistor that can pass 12v or should I go a different route entirely?
  2. How big of an issue will heat be? I am brand new to electronics so I am unfamiliar with how heat is dissipated from a system. I would assume that a resistor that is a resisting 12v while the light is off could produce heat. Could it be a dangerous amount of heat, and how do I deal with that?
  3. Will a 12v power supply be enough to power the Arduino, clock, and LED Strip? The specifications for the Arduino Uno says that its operating voltage is 5v. Does that mean that 5 of the 12 volts supplied to it will be consumed by the Uno itself?
  4. How would you recommend I connect these parts? I would think a breadboard would be the best way to do it while testing it, but do you know of any more permanent solutions to making this a neat and compact package once the project is completed?
  5. Would it be helpful if I drew a circuit schematic? How would I go about this?
  6. Are there any resources that have helped you understand electronics that you would recommend to others?
That's about all I have for now. I am looking forward to hearing your feedback and criticism. I am aware that I could just buy a sunrise alarm clock, but I think that curiosity, desire to learn, and affinity for tinkering are all sentiments that members of this forum share. I will continue to update this thread and post as I progress through the project and gather feedback. Hopefully this can one day serve as a starting point for others interested in building something similar.

Thank you for your time.

tl;dr: Move closer to the equator.
 

SamR

Joined Mar 19, 2019
1,293
Edit: Welcome to AAC. Couple of ideas. Hack a cheap alarm clock to trigger the Arduino. Give the time setting, alarm on/off availability easily. You will use the Arduino to program PWM Voltage to "dim" the LEDs either up or down. So if you don't know how to PWM learn it on a breadboard with a single LED to learn the concept and how it is programmed.

Not variable resistors, PWM programmed in the Arduino.
 
Last edited:

jpanhalt

Joined Jan 18, 2008
8,070
I live in Minnesota, and during the winter season I have a very difficult time getting out of bed in the morning. In the dead of winter, the sun does not rise until almost 8 am, so it is very difficult and disorienting to wake up to complete darkness.

Move closer to the equator.
I survived in MN for 17 years. Just set your alarm for 4 AM. Never a problem. You get used to it. Now, almost 30 years later and retired, I still wake up at 4 AM with no alarm.

Or, move out of god's country and go South. If an alarm clock going off while it is still dark ruins your day, you are going to have a tough time.
 

SamR

Joined Mar 19, 2019
1,293
LOL I lived in Maine for a while. In the winter the sun came up at 10 and went down at 2. The only time I saw the sun was at lunch break for a couple of months. Now that I am retired I sleep when I need to not when I have to so I can get up to go to work.
 

crutschow

Joined Mar 14, 2008
23,494
I agree with SamR to use PWM to control the light intensity.
You will likely have to experiment with the rate of PWM duty-cycle change, since the light output is likely not linear with the duty-cycle.
 

djsfantasi

Joined Apr 11, 2010
5,684
Search for “Arduino RTC”. There are inexpensive modules which you can use as a clock. The Arduino alone is good for timing; not so good as a clock.

While you can use 12V to run an Arduino, the microprocessor runs on 5V (or 3.3V depending on the Arduino model). It has an onboard voltage regulator which drops the 12V to 5V.

You won’t need resistors for the LEDs since they are a designed to run on 12V directly. All the necessary resistors are built into the strip.

To use 12V LED strips, you’ll need to use a p-channel MOSFET to switch the LED’s 12V power. That introduces one more problem as the gate voltage necessary will be greater than the 5V Arduino pins supply. So you’ll need a gate driver (as simple as a 2N7000 MOSFET) before the p-channel MOSFET. You will need resistors for the MOSFET drivers.

To select the p-channel MOSFET, it should handle 12V or more. And the current rating must be greater than the current drawn by the entire strip.

By using an Arduino PWM pin on the gate of the driver, you should be able dim the LED strip. Without any variable resistors.

I have a completed project that uses a 5V Arduino to run 12V LED strips. I’ve documented how to do this in Instructables project: Electronic Simulated Sports Scoreboard. Check out the schematics for the LED strips.

As far as creating a schematic, it’s more than suggested; it practically required. You can use the pencil on paper approach. Or there are several tools. A couple I could recommend are both free. ExpressSCH and LTSpice. I’ve listed them in order of complexity. As a side note, you’ll eventually want to learn LTSpice (or compatible) as that software can simulate your completed circuit and thus perform an initial test. By simulating before building, you’ll save a lot of time.

But first things first. Start with pencil on paper:)

I hope I’ve covered most of your questions... Remember, baby steps.
 
Top