Xmas lighting relay

5 views
Skip to first unread message

Tom Merry

unread,
Nov 20, 2009, 4:22:39 AM11/20/09
to Connected Community HackerSpace
hi all,

i am trying to control 3-35v Xmas lighting.

i need to find a good relay, i have tried solid state relays but they
leaked and the light would only dim when the circuit was meant to be
open.

i can use 12v relays through a smaller read relay.

advice would be great thanks,

Tom

Nic Jones

unread,
Nov 20, 2009, 4:46:04 AM11/20/09
to Connected Community HackerSpace
If you're working with DC, consider using a FET. You can drive it
(via a resistor) directly from a microcontroller or 555.
Altronics:
http://www.altronics.com.au/index.asp?area=item&id=Z1123
Connect your light(s) between your positive and the drain of the FET,
connected the source of the FET to your negative. Connect the gate to
a small resistor (less than, say, 50Ω, but it's not at all critical,
and you'd probably even be okay without it) and connect the other side
of the resistor to whatever you're controlling it with. (An Arduino
PWM pin, for example, which would allow you to not only switch on and
off but do dimming)

If you're really set on relays, I've used these a lot:
http://www.altronics.com.au/index.asp?area=item&id=S4160B
But you're not likely to be able to drive them directly from a small
microcontroller / parallel port pin. You'd need a transistor (and,
for good measure, a diode)

What are your trying to drive the relays from?

Nic Jones

Tom Merry

unread,
Nov 20, 2009, 5:16:51 AM11/20/09
to Connected Community HackerSpace
thanks, i am driving from an arduino,
do you know if jaycar sells them?
im not to sure about using a FET i would be afraid of blowing somthing
up, but if you can show me a wiring diagram i might give them a try
but thanks for the advice on the relay

thanx, Tom

Nic Jones

unread,
Nov 20, 2009, 6:26:01 AM11/20/09
to Connected Community HackerSpace
I'd say it depends on the Jaycar - they seem to be moving further away
from what they now call "hardcore electronics" and which FETs they
carry depend on which Jaycar you go to.

You're after an N-channel Power FET, though. The cheapest in their
catalog that seems suitable is the STP16NE06 (Part number ZT-2277)
but part numbers ZT-2225, ZT-2466, ZT-2467 and ZT-2468 would all work.

The schematic is pretty simple:
http://bayimg.com/IaECcAacP

GND is the ground of your power supply (and, if you're powering the
Arduino from a separate source like the USB cable, should also be
connected to the GND on the Arduino board.) V+ is your power supply
for the lights. PWM is connected to one of the PWM pins on the
Arduino.

I don't think you run much more risk damaging something with a relay &
relay driver than a FET. You could damage your Arduino if you wire
your supply voltage to one of the pins, but that's just as easy to do
(or, to avoid doing) in both cases.

Nic Jones

Clint Phillips

unread,
Nov 20, 2009, 9:36:37 AM11/20/09
to connected-commu...@googlegroups.com
I got some new relays in.... $1.50 with a 5 v coil clint
--

You received this message because you are subscribed to the Google Groups
"Connected Community HackerSpace" group.
To post to this group, send email to
connected-commu...@googlegroups.com.
To unsubscribe from this group, send email to
connected-community-h...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/connected-community-hackerspace?hl=.


Mitch Davis

unread,
Nov 20, 2009, 4:09:07 PM11/20/09
to connected-commu...@googlegroups.com
2009/11/21 Clint Phillips <cphil...@internode.on.net>:
> I got some new relays in.... $1.50 with a 5 v coil clint

Can they be driven directly by an Arduino output, or is a transistor needed?

Tom, do you know what current flows through the light string?

Mitch.

Tom Merry

unread,
Nov 20, 2009, 6:01:59 PM11/20/09
to Connected Community HackerSpace
around 1.45 amps max and 35 volts.

thanks

On Nov 21, 8:09 am, Mitch Davis <m...@afork.com> wrote:
> 2009/11/21 Clint Phillips <cphillip...@internode.on.net>:

Mitch Davis

unread,
Nov 20, 2009, 9:16:51 PM11/20/09
to connected-commu...@googlegroups.com
On Sat, Nov 21, 2009 at 10:01 AM, Tom Merry <to3...@gmail.com> wrote:
> around 1.45 amps max and 35 volts.

Hi Tom,

Leaving aside other issues (such as solving your problem!) I want to
point out one important difference between FETs and relays. A relay
can only be on (very low resistance, which means a lot of current, but
miniscule voltage drop) or off (very high resistance, which means a
huge voltage drop, but miniscule current). In either of these cases,
the power dissipated in the relay is going to be quite small, which is
what you want.

A FET, on the other hand, can be in that high resistance state, or the
low resistance state, or anywhere in between, depending on the voltage
on the gate pin. It's the "in between" state that you have to worry
about, because in this state, you can be passing a lot of current with
a large voltage drop, which means the FET will be dissipating a lot of
power.

Speaking from experience, in my work we have a FET controlling several
hundred LEDs, not unlike your Christmas tree scenario. I had a
situation during the week where the FET was unintentionally in that
half-way state. Let's just say that there was a room full of acrid
smoke, and a mad dash for the power switch.

So, in high power situations, you generally want to avoid that
half-way state, as you want the FET to more closely emulate the
behaviour of a relay. How do you do that? Well, the conductivity of
a FET is dependent on the voltage on its gate pin. So you want to
make sure that the voltage is either "high" or "low", but not in
between.

The cheapest way to do this is to program your Arduino properly: If
your Arduino software sets the mode of the pin driving the FET to be
an output, then you'll be pretty safe. But if there's a software
fault and it's not set to output, or the wire between the Arduino and
the FET breaks, that gate pin could find itself at any voltage and you
potentially have that half-way power problem.

The easiest way to solve the problem (as compared to the cheapest way)
is to have a 100k ohm resistor which connects between the gate, and
the ground, or the gate and the power supply. In the event where the
Arduino is not pulling the gate pin voltage high or low, the resistor
will ensure that the gate pin voltage is not "floating", and will
"pull" the voltage high or low, and out of that danger region.

Note, I'm not an electrical engineer. Others may jump in and give you
alternative advice. Ask around, enjoy learning.

Mitch.

Tom Merry

unread,
Nov 21, 2009, 2:01:13 AM11/21/09
to Connected Community HackerSpace
thanks all, i went with the fets and after a few minutes the where
working fine, (including dimming),

i posted the code im using on my web site (very new site) if any one
would like to see it.
i am also using processing to control the arduino

thanx

Tom

Tom Merry

unread,
Nov 21, 2009, 2:03:20 AM11/21/09
to Connected Community HackerSpace
sorry, my site is, to3000.is-a-geek.com

Clifford Heath

unread,
Nov 22, 2009, 10:30:58 PM11/22/09
to connected-commu...@googlegroups.com
It's normally a good idea to put a 10-100 ohm resistor directly in
series and close to the gate also. This prevents EMI and overheating
caused by VHF oscillations during the transition through the linear
region, which are rife in layouts that lack this resistor.

Look at the gate capacitance to determine what the RC time constant
will be before choosing a resistor, because too large a value will
increase the time spent in the linear region (and could cause
overheating
and power wastage) when you implement high-frequency PWM.

Clifford Heath.

AJ

unread,
Nov 20, 2009, 6:39:19 AM11/20/09
to connected-commu...@googlegroups.com

if what you are looking for is a complete box.. that can switch upto
240V from a single 5V (parallel port line)...
I have built some.. in nice little jiffy boxes.
As used here: http://fourspace.ath.cx\aj\projects\web_control_power/
i've written a web server, so i can control power via a web page.

if this interests you, let me know.. and i'll take some pictures of it
and add to the web page.

aj.
>>> a small resistor (less than, say, 50οΏ½, but it's not at all critical,
>>> and you'd probably even be okay without it) and connect the other side
>>> of the resistor to whatever you're controlling it with. (An Arduino
>>> PWM pin, for example, which would allow you to not only switch on and
>>> off but do dimming)
>>>
>>> If you're really set on relays, I've used these a lot:http://www.altronics.com.au/index.asp?area=item&id=S4160B
>>> But you're not likely to be able to drive them directly from a small
>>> microcontroller / parallel port pin. You'd need a transistor (and,
>>> for good measure, a diode)
>>>
>>> What are your trying to drive the relays from?
>>>
>>> Nic Jones
>>>
>>> On Nov 20, 8:22 pm, Tom Merry <to30...@gmail.com> wrote:
>>>
>>>> hi all,
>>>>
>>>> i am trying to control 3-35v Xmas lighting.
>>>>
>>>> i need to find a good relay, i have tried solid state relays but they
>>>> leaked and the light would only dim when the circuit was meant to be
>>>> open.
>>>>
>>>> i can use 12v relays through a smaller read relay.
>>>>
>>>> advice would be great thanks,
>>>>
>>>> Tom
>>>>
>

Tom Merry

unread,
Nov 25, 2009, 2:55:14 AM11/25/09
to Connected Community HackerSpace
thanks all for the great help and advice on the hardware side, now its
time for the software side.


i need some sort of program that can ether take music and from that
control the arduino (over serial)

or i can "play" the light in my keyboard to the music and them play it
back over serial.

i could also use hardware to do this, i think at the last at weekend
meting i saw to someone was taking the sound out form there computer
and controlling a stage light with it, a miniature version of that
would be good.

thanx

Tom
Reply all
Reply to author
Forward
0 new messages