The most basic questions about programming LEDS.

Hello, everyone. I would like to start out by saying that I am completely inexperienced when it comes to programming, and I was hoping to get a start with Arduinos.

The project I am working on is very simple - conceptually.
I would like to install a trim of LEDS along the perimeter of the ceiling in my bedroom, which simple enough.
However, I would like to program them to turn on automatically around 8:00 am and off again at 8:00 pm.
Ideally, there would be a grace period of about 30 minutes where they would gradually increase in brightness to simulate sunrise, and again at 7:30 to simulate sunset.

Would this be possible using an arduino controller? How difficult would it be to program? Are there any alternatives that you might suggest?

Thank you in advanced.

For sure.

Power supply for LEDs (make sure you know what kind of LEDs you're getting - either WS2812's, which are individually addressable and more expensive, and run on 5v or straight up RGB LED strings, which are not individually controllable, and typically run on 12v).
If using 12v strips, you need a trio of appropriately sized MOSFETs (hey, funny thing, I happen to sell just such a thing >.> ) to switch the strips on and off with.

If using individually addressable LEDs, you can't do more than 500 or so with an Uno, since you need to keep a 3 byte per led frame buffer), but that's probably more LEDs than you'd ever want (and is enough that supplying them would become challenging)

Yes this is possible with arduino.

you can use a RTC (Real Time Clock) or a Ethernet shield and get the time from the internet.

Pros RTC:
Easy to work with
cons RTC:
time will shift each day with a Sec or so.

pros Ethernet shield:
you can get Time from the internet and compensate with summer and winter sun rise.
but i realy dont know how, but it should be possible. if you know the right server to connect to.
Cons Ethernet shield:
its harder to program everything.

Pros RTC:
Cheap

Cons Ethernet shield:
Not even close to cheap

PaulS:
Cons Ethernet shield:
Not even close to cheap

$15

DrAzzy:
Power supply for LEDs (make sure you know what kind of LEDs you're getting - either WS2812's, which are individually addressable and more expensive, and run on 5v or straight up RGB LED strings, which are not individually controllable, and typically run on 12v).
If using 12v strips, you need a trio of appropriately sized MOSFETs to switch the strips on and off with.

Would it be possible to use surface-mount LEDs?

Or, possibly, to apply the same concept to a panel of through-hole LEDs?

I agree that a real time clock module is the way to go. These keep accurate time (as accurate as a typical watch/clock) and they have a backup battery so they don't have to be reset if you loose power. You can find examples of reading the clock with the Arduino.

The Arduino by itself can be used to take some action every 12 hours, but the time will tend to drift more than a RTC module. And unless you add a battery backup, the time will reset if you loose power.

Dimming an LED is straightforward and there are examples, but you'll have to modify the example for your desired 10-minute dim period.

You'll also need to decide how you are going to program the time and dim-actions. The hardware & software is easier if you use a computer. If you want to make a stand-alone system (like an alarm clock), you'll need an LCD display, some buttons, and all of the supporting software.

Would it be possible to use surface-mount LEDs?

Or, possibly, to apply the same concept to a panel of through-hole LEDs?

You said you were going to use LED strips... If you are using LED strips, they will usually have surface mount LEDs inside, but that's not important...

Different LEDs & different LED strips have different electrical requirements -

Standard individual LEDs (surface mount or through-hole) are normally driven directly through a current-limiting resistor. The Arduino can only power about one LED per I/O pin, so with several LEDs around the ceiling you'll need a transistor or MOSFET.

With transistors/MOSFETs you can power multiple LEDs (each with a resistor) in parallel, or with higher voltage in a series-parallel configuration.

LED strip sometimes just have series resistors. Other LED strips have transistors/MOSFETs built-in. Some have daisy-chained drivers so that all of the LEDs are individually addressable.

If it only has resistors, you need a power supply and a transistor/MOSFET (or 3 transistors/MOSFETs for RGB strips).

If the strip has active electronics built-in, you just supply power and you can control it directly from an Arduino I/O pin.

High power LEDs (1W or more) are generally run from a "constant current" power supply which you can build or buy. Commercial dimmable constant-current LED power supplies use a 0-10 VDC control-voltage (or 10V PWM) for dimming. With the Arduino, you need a 10V power supply and a small (low power) transistor or MOSFET to boost the Arduino's 5V PWM.

LED "light bulbs" from a hardware store usually run from 120/240 VAC or 12VAC. Some are dimmable, and some are not. They have active electronics built-in, and even the dimmable ones are not easily dimmable with the Arduino. They are normally dimmed with a phase-controlled dimmer (a normal AC light dimmer).


Many years ago, I built a "sunrise dimmer" with a different microcontroller. I'm still using it. The AC power is turned on & off with an [u]X-10[/u] relay and a programmable X-10 controller (part of my home automation system). The part I built doesn't have a real-time clock. It simply plugs into the X-10 controlled outlet and it starts dimming-up a regular AC powered incandescent light as soon as power is applied. (And mine doesn't dim-down... It stays on for about an hour 'till the master X-10 controller switches off power.)

JamesMatthews:
Would it be possible to use surface-mount LEDs?

LED strips are almost universally done with SMD leds - but electrically it doesn't matter how the LEDs are mounted - if you're buying LED strips, that's typically not something you need to be concerned with. Just make sure you're getting the type of strips you want (individually addressable - either WS2811/2812/2812B, eg, neopixel, or APA102, eg, adafruit dotstar - or non-individually addressable), and that you know what the operating voltage and current requirements are.

Are you doing something different than what you actually described above? Because your question doesn't seem to make sense otherwise.

Well, since I've had my initial idea of placing these LEDs along my ceiling, I thought it would be neat to give one of my smaller aquariums a similar lighting system, that could dim at night and brighten in the morning. For that, I would probably want to use some high power LEDs, which is why I was wondering if the same effect could be achieved with those.