Pages: [1]   Go Down
Author Topic: Help with relay circuit  (Read 5906 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.

I'm trying to build a circuit to switch a 5v relay that will operate an appliance plugged into the wall, but am having trouble understanding the schematic shown in the playground:

http://www.arduino.cc/playground/uploads/Learning/relays.pdf

I am using Relay http://us.100y.com.tw/pdf_file/LU-SERIES.pdf (LU-5), transistor BC 548B  http://www.philohome.com/sensors/gp2d12/gp2d12-datasheets/bc548.pdf, and have tried a 1k and 2k2 resistor, on the diode it says '1N4004 938'. I'm brand new to electronics so am sure it's something simple that I've missed, but have been trying to make it work for a couple of days now unsuccessfully. It's doing my box in!

I am trying to run the circuit from the blink example (to check i've got the circuit right before worrying about the code), but nothing happens. I've tried various wiring configurations. The relay works fine when all other components are removed, and attached to pin13/gnd or 5v/gnd.

I tried to attach a photo, but just got 'img', so here is my circuit at the moment:

5V-RESISTOR-TRANSISTOR BASE

FROM TRANSISTOR: EMITTER TO GROUND, COLLECTOR-DIODE-RELAY-GROUND

Both transistor and relay are grounded to the GND pin next to 5V on the Arduino.



Help appreciated,

Ben.
« Last Edit: January 14, 2011, 09:41:41 am by bngllghr » Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8474
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
5V-RESISTOR-TRANSISTOR BASE
What is controlling the base then? That is permanently on.

Quote
COLLECTOR-DIODE-RELAY-GROUND
Wrong,

COLLECTOR-RELAY-VOLTS

with DIODE in parallel with the relay coil.

Is it a 5V relay?
______
Rob


« Last Edit: January 14, 2011, 09:57:48 am by graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Rob,

Thanks for the reply. I think I've cracked it (almost). Sometimes it helps to write things down. After I posted, I followed the diagram and code at http://tronixstuff.wordpress.com/2010/04/20/getting-started-with-arduino-chapter-three/ and the program seems to run fine.

Excuse my ignorance, but am not sure what is meant by 'in parallel'.

I had changed the circuit to:

5V-Relay-Diode-Collector(Emitter to GND)-Base-Resistor-Digital Out and it seemed to be working fine.

Should it instead go:

5V-Relay AND Diode-Collector(Emitter to GND)-Base-Resistor-Digital Out? This works fine too. Is this better? In Parallel? Less likely to blow something up?

If so, am I ok to go ahead and attach the Live wire from a three core extension cable to the relay, ignoring the ground and neutral?

Cheers,

Ben.
Logged

Sussex UK / CT USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1028
Forums forever
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

See also...

http://www.arunet.co.uk/tkboyd/ec/ec1relay.htm

And consider....

http://www.makershed.com/ProductDetails.asp?ProductCode=MKPS01&Show=ExtInfo
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8474
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
5V-Relay AND Diode-Collector(Emitter to GND)-Base-Resistor-Digital Out?

That's about right.

Diode anode to + (and 5v) on coil, cathode to - (and collector)

check tkbyd's first link, it shows how to put the diode. There's got to be a 100 threads about this, try search for "snubbing" or "fly back" diode.

Quote
am I ok to go ahead and attach the Live wire from a three core extension cable to the relay, ignoring the ground and neutral?

No way I'll advise about mains voltage stuff smiley but I'm sure there's people here that are qualified to do so.

______
Rob

« Last Edit: January 14, 2011, 12:04:35 pm by graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Lancashire, UK
Offline Offline
Edison Member
*
Karma: 9
Posts: 1991
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

My opinion is if you need to ask how to connect mains stuff, you shouldn't be doing it.  It doesn't give too many second chances....

Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's brilliant, guys. Thank you both. This circuit has been driving me crazy. I'm in England, so will have to have a look to see if I can find one of those power switches to fit a 3 pin 240v socket. Looks just what I need.

Cheers,

Ben.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ben ------
It is real real really easy if you use a PowerSwitchTail (by Adafruit for $20).  Don't hesitate to call me at 951-461-0757.
                                     ------  nickynichols
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
to use the arduino to switch an extension lead connected to 240vac)
The contacts are only rated for 1A at this voltage so an extension lead no, it is possible to plug 13A into it and that would weld the contacts shut or cause a fire. Look for contacts rated at least 20A if you want to switch 13A. It will be a much bigger relay than this.

You shouldn't be messing about with mains if you have to ask these questions.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't worry. I'm not a moron. I'm not going to connect the mains until I know what I'm doing. I want to get the components together before I go back to uni and can get a hand from the workshop technician.

How about 16a:

http://uk.rs-online.com/web/search/searchBrowseAction.html?method=getProduct&R=0366287
« Last Edit: January 18, 2011, 07:56:47 am by bngllghr » Logged

Sussex UK / CT USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1028
Forums forever
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Don't worry. I'm not a moron.


Good! But one never knows who's going to read these posts... after all... half the world is of below average intelligence. And only half the world... 1 in 10... understands binary.

ANYWAY... besides getting the right components, it is also important to get the physical assemblage of them right. Fires start from the most IMPROBABLE things. Probable or not... they happen. Not you you, if you get the right advice!

(This posted not just for bngllghr, but for the many, we hope, people who will visit the thread in the future)
« Last Edit: January 18, 2011, 08:07:19 am by tkbyd » Logged

Pages: [1]   Go Up
Jump to: