Aquarium Moonlighting.

Hello everyone,
this will be my first real project with my arduino UNO. This is going to just be a basic start with around 24 5mm blue leds to moonlight the aquarium at night. to get started i just want to setup the basic hardware and make sure it's enough to light up the aquarium. Then move on to the arduino itself being aware of the time and acting accordingly. Then finally moving on to full aquarium automation.

LED specs:
MCD: 4000~5000
Wave Length: 457~460nm
Angle: 25 degree
Forward Voltage: 3.2~3.4v
Current: 20mA

so my questions that come to mind are:

  • first i'm not sure how to even power this setup can i just plug the arduino into a power outlet and let the 3.3v rail power all the leds in parallel, or does the arudino not provide enough current for all the leds? if not what would be a good power supply to use?
  • And what would be the best way to wire the LEDS, i guess this depends upon my power supply?
  • And i'm guess a 2n2222 transistor would work for this situation?
  • What are the ways to make the arduino aware of the time, would a rtc be the cheapest/easiest path?

i'm sorry if i left something out this is my first post and i don't really know what else would be relevant. Thanks for your help in advance. :slight_smile:

The following has things I would guess you need, concerning the LEDs...

Okay so at the moment I onlypwer the arduino with USB. But I think I've decided on a 3x8 array using 12 volts and drawing 160 ma. So should any wallwort work? As long as it has the proper voltage and at least 160 ma.

And as far as ethe clock I want the clock to be at trake seconds.

Also a 2n2222 should work for only 160 ma right?
And I calculated the resistance for the base resistor to be 312.5 so should I use a 330 ohm or 220 ohm?

sorry i was typing on my iPad and wasn't paying attention. haha
i would like to be able to tell time down to the second.

any by power the whole thing to me plugging the wall wart into the UNO and then using the vin to power the leds or will this give enough juice to the leds? not sure how much current the UNO uses at 12v, and also should i try to find a regulated supply if a 12v regulated is even easily available

so i went out to radioshack and bought a wall wart that as adjustable voltage and 1 amp. then i came home and found a laptop power supply that's 12v and 4 amp. i tested them both and they had around 12.2ish voltage this means they're both regulated correct?

i understand but the difference between powering and controlling.. but i was under the assumption that the vin pin on the UNO just putout the source voltage with only a 1 amp diode limiting the current.

also would the laptop power supply work just as well as the wall wart? if so i'll just take the wall wart i bought back.

and i suppose the seconds aren't quite necessary would cutting back to minutes make the circuitry simpler?

by power connector do you mean the plug i guess? it's a 2.1mm center positive jack same as the arduino.

okay i understand why involve more circuitry then is necessary by powering it through vin and risking the arduino.
what would be the best way to power the two then? can you power the arduino through one of it's mounts?
also do you know how much current at max and arduino can use so i can factor that into my max current?

would you happen to have a source for coding the arduino to keep time? i guess i could use that and then just incorporate an rtc if i find it too inaccurate.

cool so to use it as a 24 hour clock i would just do something like
if (millis() == 86400000) {
timer0_overflow_count = 0;
}

and assuming the time was started at 24:00:00 it would reset every day at midnight.

if (millis() == 86400000)  {
  timer0_overflow_count = 0;
}

...is a bad idea for four reasons...

  1. millis sometimes advances by two. 86400000 may get skipped.

  2. The code around that if may take longer than 1 millisecond to execute. This would also result in 86400000 being skipped.

  3. timer0_overflow_count is a multi-byte value shared with an interrupt service routine. Interrupts must be disabled while timer0_overflow_count is read or written.

  4. The millis counter is composed of three parts: timer0_overflow_count, TCNT0, and the state of the timer. Unless all three parts are considered when resetting the value, an error is introduced.

yeah when i woke up this morning i started thinking about what if it was skipped so i would just change it to >=

i'm not sure how to fix the other problems haha.

well it's free day at spark fun so hopefully i can just buy a rtc and be done :slight_smile:

well i ended up getting little money so it'll definitely help with my project.

well i ended up getting little money so it'll definitely help with my project.

Oh, good. Go buy a real time clock to use. Much easier than guessing what time it is.

i agree. haha
but now i'm trying to decide if i should buy the breakout board from sparkfun or adafruit or just buy the chip a crystal and a battery.

that is true and that rtc has a built in crystal and keeps time longer.
is it worth it paying the extra money for the breakout board vs getting free samples?

well i got them both coming as samples from maxim