Arduino Forum

Using Arduino => Motors, Mechanics, and Power => Topic started by: Endevor on Jan 11, 2013, 02:09 am

Title: Controlling and dimming outlets for aquarium lights
Post by: Endevor on Jan 11, 2013, 02:09 am
I have two of these lights: http://innovative-marine.com/skkye-light/clamp-8-watt-white.html specifically model 6106

Each light comes with two non-dimmable drivers, one for the day and one for the night lights.

I have an arduino R3 with a LCD Keypad Shield from SainSmart. I want to be able to control all my outlets so I can turn anything off when I want to or with a timer. I'd also like to display a time/water readings from a few sensors on the LCD screen. I'd also like to make my LED lights dimmable in order to program sunrises and sunsets.

I'm currently looking at this for an outlet setup:
http://www.mikerags.com/node/24

But I don't think that helps as far as dimmability.
I'm fairly new to electronics as far as circuitry and making my own circuits, but programming is more my expertise.

Overall, here is my goal:

Control 7 outlets:
- 4 of which control the lights (2 outlets day/2 outlets night)
- 1 pump
- 1 skimmer
- 1 heater
Make LED lighting dimmable in order to program sunset/sunrise and clouds/storms
Read a temperature sensor

Can I do all this with a R3?
My biggest concern is making the LEDs dimmable and if it's even possible.

I'm looking at this to get for keeping real time:
http://www.amazon.com/SainSmart-DS1307-AT24C32-Clock-module/dp/B006J4FZW4/ref=wl_it_dp_o_pC_S_nC?ie=UTF8&colid=CJR7UR57UTOI&coliid=I2MTJDEUDQUMA6

And I'd prefer to get a pre-made board than making my own, simply because I know it'll work and not blow something up or electrocute myself with 120v.
I was looking at this:
http://www.amazon.com/gp/product/B009T215UY/ref=s9_simh_gw_p60_d0_i1?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=1BS40T9GKTB4FT824A9H&pf_rd_t=101&pf_rd_p=1389517282&pf_rd_i=507846
but I don't think that's what I need...

Also looking at possibly these for dimmable drivers, but I don't know if these will work with arduino. The 27P works for 5-8 LEDs. Each light has 6 Day LEDs and 4 night LEDs. The more I think about it, I'm curious if I can run both days (12 LEDs) I could use 48P for both and the 27P for the nights (8 LEDs), though I have no idea if it would work wattage/voltage wise.
http://www.rapidled.com/dimmable-drivers/

Any advice on where to start or any tutorials for something like this I can run through?
Thanks in advance!
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Krodal on Jan 11, 2013, 03:14 am
The "R3" is a version.
I hope you have a Arduino Uno (version R3), that is the most common Arduino.
http://arduino.cc/en/Main/arduinoBoardUno

The outputs and sensors can be handled by the Arduino Uno.
The DS1307 is a very common chip for time and date.
Also the relay shield is okay, but you need 12V. There are also relays for 5V.

To be able to dim the leds, you have to know what is inside.
Is it only leds, or also resistors and capacitors ?
Are those rapidled dimmers compatible with the skkye light leds ?

Normally the Arduino uses PWM to dim leds.
http://en.wikipedia.org/wiki/Pulse-width_modulation
But you have to be sure that the leds can handle a PWM frequency of about 450Hz.
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: SouthernAtHeart on Jan 11, 2013, 03:15 am
Quote
I'm looking at this to get for keeping real time:
http://www.amazon.com/SainSmart-DS1307-AT24C32-Clock-module/dp/B006J4FZW4/ref=wl_it_dp_o_pC_S_nC?ie=UTF8&colid=CJR7UR57UTOI&coliid=I2MTJDEUDQUMA6



Search for DS1307 on EBay.  $24 seems about $18 dollars too much.
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Endevor on Jan 11, 2013, 03:29 am
Yes, sorry, forgot to add the "Uno"  :P

I honestly don't know what kind of LEDs are in the lights...
Only thing I can find is that Days are 1w and 350mA
Nights are 1/2w and 60mA

I have no idea if the rapidLED drivers will work with the LEDs and I don't really know how I can find out.
Sorry, this probably isn't really helping anything, and it doesn't help that I don't really know a lot about circuits.

My other idea is to just get rapidLED LEDs...
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Krodal on Jan 11, 2013, 05:35 am
Quote
Search for DS1307 on EBay.  $24 seems about $18 dollars too much.

Still too much. They are 2 dollars or 1.50 euros (total actual costs).

Those leds are a problem. Bare leds need a constant current. And lights with a rectifier and capacitor or other circuit inside cannot be dimmed with PWM.
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Endevor on Jan 11, 2013, 10:20 am
I figured as much... Well, I should be able to at least control the outlet for on/off. Perhaps that'll be easier to tackle for starters, then I'll work up to getting dimmable LEDs.
Would the relay board I found on amazon work or would you suggest a different board to relay 120v wall outlets?
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Krodal on Jan 11, 2013, 10:41 am
If you have 12V, use the 12V relay.
If you have 5V, search for : relay shield 5V
The 5V from the Arduino Uno is not enough to power a few relays.

A relay shield with four 12V relays is about 8 dollars on Ebay.
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Endevor on Jan 11, 2013, 10:49 am
Yea, just noticed the voltage differences.
I found this:
http://item.mobileweb.ebay.com/viewitem?itemId=300749445346
Since it's 5v, it should work fine with the arduino right?
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Krodal on Jan 11, 2013, 11:31 am
Both the 12V relay and 5V relay will work with the Arduino.
They both have inputs of a 5V digital signal to switch the relays.

It depends on what kind of power supply you rather would like to use.
If you have 12V, use the 12V relays.
If you have 5V, for example from an adapter or DC-DC converter, use the 5V relays.
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Chagrin on Jan 11, 2013, 11:34 am
5V signals from the Arduino should work with either of those boards. The difference is that the 5V board needs a 5V power supply (on the VCC pin) to drive the coils and the 12V board needs a 12V power supply. There should be about a 30% leeway though; e.g. a 9V supply should still work with the 12V board.

Here's a tutorial for relay boards (http://arduino-info.wikispaces.com/ArduinoPower).

Note that your 8 relay board has optoisolation (the small, black, 4 pin rectangles on the board). The 4 relay board does not. See above tutorial for more details on that.

(overlapping Krodal's reply but too lazy to adjust the parts of mine that restate what he said ;)
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Endevor on Jan 11, 2013, 03:37 pm
Thanks for the help and the tutorial. I ordered a real time module (ended up being 3$ including shipping, haha!) And the 8 channel relay.

The tutorial helped a lot too! Although it did raise a question. When I hit the relay to switch off to on, the and vice versa, the article spoke about a build up of electricity and a sudden brief burst to my electronics, which I don't really feel like replacing if I fry. Is there a way to prevent that surge or at least reduce it to a safer level? Or does it really not matter as much?
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Chagrin on Jan 11, 2013, 05:33 pm
When I hit the relay to switch off to on, the and vice versa, the article spoke about a build up of electricity and a sudden brief burst to my electronics, which I don't really feel like replacing if I fry. Is there a way to prevent that surge or at least reduce it to a safer level? Or does it really not matter as much?


Yes, back EMF does matter and will occur strongly in any type of coil that is switched off rapidly.... but these boards already include a diode to take care of that.
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Endevor on Jan 11, 2013, 06:34 pm
This sounds like it should be fairly easy then. Thanks to everyone for the help, I'm just waiting for parts to come in from China now. Hopefully this will come together without a hitch.
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Wmtasker on Apr 11, 2013, 03:30 am

When I hit the relay to switch off to on, the and vice versa, the article spoke about a build up of electricity and a sudden brief burst to my electronics, which I don't really feel like replacing if I fry. Is there a way to prevent that surge or at least reduce it to a safer level? Or does it really not matter as much?


Yes, back EMF does matter and will occur strongly in any type of coil that is switched off rapidly.... but these boards already include a diode to take care of that.


Hello everyone. I am having a similar problem.
I am using an Arduino Mega 2560 to control several PWM LED Drivers and a 8 channel relay board for my wavemaker and heater. Whenever one of the relays disengages, I get a blink on LED lights.  I believe this is caused by the surge produced when the relays discharge. On the relay board you talk about above, I see where each relay has a D1, D2, D3, etc .... Is this the diode across the coil that is needed for surge suppression?

I have this Relay Board and I don't see D1, D2, D3, etc, next to each relay.  So I assume I don't have surge suppression  :( http://www.ebay.com/itm/110983062639?var=410149497719&ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

I would rather find a 12vdc 8 channel relay board.  Any thoughts on which board I should use with a diode suppression?  I found this one on eBay and each relay has a D1, D2, D3, etc .... Is this the diode across the coil that is needed for surge suppression?
http://www.ebay.com/itm/221207713757?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1423.l2649

Thanks everyone
Billy
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Chagrin on Apr 11, 2013, 05:05 am
On your relay board, the second largest-sized chip on that board marked "M7" on it is the diode. The stripe next to the "M" indicates the cathode, FWIW.

With respect to your LED blinking problem I would bet that it is the driver itself (assuming it's an AC driver?) acting inappropriately. Can you provide more details on that driver?
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Wmtasker on Apr 11, 2013, 05:29 am

On your relay board, the second largest-sized chip on that board marked "M7" on it is the diode. The stripe next to the "M" indicates the cathode, FWIW.

With respect to your LED blinking problem I would bet that it is the driver itself (assuming it's an AC driver?) acting inappropriately. Can you provide more details on that driver?


So what you are telling me is that my board has the diodes on them for surge suppression? Now I'm more confused about what could be causing this.

Here is my drivers

http://www.meanwell.com/search/LDD-H/LDD-H-spec.pdf

Thanks for your help.
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Chagrin on Apr 11, 2013, 05:34 am
Do your LEDs blink if you stop/start a high current appliance (e.g. a vacuum cleaner) on the same circuit?
Title: Re: Controlling and dimming outlets for aquarium lights
Post by: Wmtasker on Apr 11, 2013, 05:46 am

Do your LEDs blink if you stop/start a high current appliance (e.g. a vacuum cleaner) on the same circuit?


No. It only reacts when the relays discharge.  I have a 48 VDC 5A power supply to run my LED drivers and a 12vdc 3A power supply to run my arduino and cooling fans. I am using a 5v regulator that stepsdown the 12vdc to give power to my relay board.  In order for all PWM drivers and fans to work, everything is on a common ground. I think I might have to isolate the relay board with its own 5vdc power supply that doesn't share the same common ground. I don't know if I can do that since my relay board doesn't have the VCC JD-VCC jumper on it.

This is my basic setup. I have added a few thing since this pic.
(http://i841.photobucket.com/albums/zz336/wmtasker1016/JBJ%2028g%20Nanocube/0B242B1F-3DB7-458C-A8E4-4036084FEF56-2354-0000031B040B3102.jpg)