Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:45 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : drive a relay

Author Message
heppy36

Regular Member

Joined: 29/07/2011
Location: Australia
Posts: 54
Posted: 01:06pm 18 Jan 2013
Copy link to clipboard 
Print this post

Hi again (sorry for been a noob)I built my little project and it does what its ment to (with a LED) turns off when pin1 =1,but when I connect a relay thinking power one side of relay pin1 other nothing happens?do I need a transistor to drive it?

SETPIN 1,8
Pin(1) = 0
setpin 2,1
setpin 3,1
setpin 4,1
setpin 20,2
DO
CLS
Font #2
print "Fuel Main " FORMAT$((pin(2) / 3 * 100), "%4.1f")"%"
print "Fuel Reserve " FORMAT$((pin(3) / 3 * 100), "%4.1f")"%"
PRINT "Battery " FORMAT$((pin(4) * 4), "%5.2fV")
if pin(2) > 1.8 then
pin(1) = 1
print "Pump OFF"
else
pin(1) = 0
endif
if pin(20) = 0 then
PRINT@(0,90,2) "BRAKE Fault"
else
endif
pause 500
loop
Heppy
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 01:25pm 18 Jan 2013
Copy link to clipboard 
Print this post

You sure do need a transistor or mosfet




That is from the original Maximite article

Regards

John
 
heppy36

Regular Member

Joined: 29/07/2011
Location: Australia
Posts: 54
Posted: 04:41pm 18 Jan 2013
Copy link to clipboard 
Print this post

Thanks can I use a transistor,as its only a 12V relay?(I also have a lot of transistors)
Heppy
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3802
Posted: 03:11am 19 Jan 2013
Copy link to clipboard 
Print this post

You need the diode etc as well.
 
heppy36

Regular Member

Joined: 29/07/2011
Location: Australia
Posts: 54
Posted: 10:22am 19 Jan 2013
Copy link to clipboard 
Print this post

Thank you ,that work great
Heppy
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 11:41am 19 Jan 2013
Copy link to clipboard 
Print this post

Hi Heppy

Take a look at this web site
Drive a realy with a PIC

Regards

John
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1425
Posted: 02:12pm 19 Jan 2013
Copy link to clipboard 
Print this post

Here for reference is a relay shield on a CGCOLORMAX1.



And controlling the relay with MMIDE 3.



Micromites and Maximites! - Beginning Maximite
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9307
Posted: 02:20pm 19 Jan 2013
Copy link to clipboard 
Print this post

@ jman: That's a nice little link.

Something to bear in mind, is that not all 12v relays are equal in terms of what their coil current is.

While it is certainly true that you can drive small DIL PCB relays with a single transistor such as a BC548 as their coil current is so small, for larger relays(like a 12v car "Horn relay") that have a much higher coil current, you have to use a Darlington transistor with much higher gain and current rating - or use two discrete transistors in a Darlington arrangement. ALWAYS test this on the breadboard BEFORE you make your PCB's like I DIDN'T at one stage, then found that the single transistor could not switch the large relay...

I always prefer to configure my relay switching so that the transistor sinks the coil current rather then sourcing it, but as the page that jman linked to states, you can do it the other way, you just need extra parts.



Edited by Grogster 2013-01-21
Smoke makes things work. When the smoke gets out, it stops!
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 02:29pm 19 Jan 2013
Copy link to clipboard 
Print this post

  Quote  for larger relays(like a 12v car "Horn relay") that have a much higher coil current, you have to use a Darlington transistor with much higher gain and current rating -


I have often used a BC337 to drive 12v car type relays with no problems, mind you, a good darlington or mosfet doesn't go astray.

David M.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9307
Posted: 02:33pm 19 Jan 2013
Copy link to clipboard 
Print this post

It's funny you should mention 337's - I was going to do an edit along those lines, but you beat me to it.

Generally, it is not mission-critical if you put the wrong transistor in, as in MY case where the single 548 would not switch the relay, I replaced it with a suitable Darlington in the same pinout as the 548, and away it went.
Smoke makes things work. When the smoke gets out, it stops!
 
TinkersALot
Regular Member

Joined: 20/11/2012
Location: United States
Posts: 72
Posted: 03:06pm 19 Jan 2013
Copy link to clipboard 
Print this post

here is a sampling of relay boards:

http://winfordeng.com/products/cat_rly.php

http://www.futurlec.com/InterfaceBoards.shtml

http://arduino-direct.com/sunshop/index.php?l=product_list&c =38
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024