Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

12v Relay help please

Status
Not open for further replies.

Nemo1966

New Member
Hi,

I am trying to build a circuit that will turn on (and off) a 12v 2.0A (max output 24W) device using a 5v control line.

The 5v control is from a USB interface connected to my PC. I have been trying to search for and answer and *think* I may need a 12v Relay (5v control) and perhaps a diode to stop feedback through the 5v line???

However I am not fully sure hence asking for help here. I have a Maplins book but there are a lot of relays in there of different types and I am also unsure of what exactly which one I would need.

Any help would be greatly appreciated

Regards
nemo

PS this is the second post of this item, the first one didn't *seem* to get published.
 
A solid state relay should do the job. They are generally triggered by a 3 to 32 volt DC level. If you are in the US I can help you with a selection from some of the US distributors. I assume you are turning on a 12V DC device. If it is 12V AC we can still do it.
 
k7elp60 said:
A solid state relay should do the job. They are generally triggered by a 3 to 32 volt DC level. If you are in the US I can help you with a selection from some of the US distributors. I assume you are turning on a 12V DC device. If it is 12V AC we can still do it.

Thanks very much for the reply, however I am in the UK.

AC or DC mmmmm good one. The power supply shows "Output 12V" and under the 12v is a single black line with a dotted line under it... is that ac or dc?
 
You'd want a 5v relay, a 12v one requires 12v at the coil to switch and will not be able to switch with 5v from the USB. You are correct about the diode, use a rectifier (1N4001 etc). You'll need to use on with a low coil current requirement since USB can't supply much safely.

I'd be tempted to use a logic level MOSFET for this. It should be cheaper and silent but the computer and load will need to share a ground to do it.

This should be suitable for a relay, the coil requires 50mA (5v model) which should be permissable providing you don't have too many devices connected:

**broken link removed**

However, I re-read your post and it sounds like the 5v from the USB is not the power line, but a signal line? If that is the case you will need to use a MOSFET to switch or a transistor/MOSFET to switch the relay since a signal line cannot supply the current for a relay coil directly.

Logic level MOSFET's don't appear to be available from Maplin. Have a look here;

**broken link removed**

VNP7N04 should do. It'll need to be used as low side switch since it is N-Channel though. What is the device to be switched? Remember, if the grounds need to be isolated you'll need a MOSFET (small one though) AND a relay.
 
Dr.EM said:
What is the device to be switched?

I have an external HD that I use for backups for my work server (12v 2.0A 24W max). At present I have to do this manually, I wanted to be able to turn this device on and off using a USB interface connected to my PC. I would do this through a software app. (I'm a programmer by trade). The USB interface has 5v inputs and outputs. **broken link removed**

Hope this helps
 
Last edited:
I assume your using one of the "8 digital open collector output switches" for it? It specifies 100ma max, so it can pass the current for the relay. I reckon the neatest way would be to use the USB power line and switch it with the interface output switches. The relay I originally suggested is suitable. Alternatively, you could use a small plug in power supply to power the relay coil.
 
Dr.EM said:
I assume your using one of the "8 digital open collector output switches" for it? It specifies 100ma max, so it can pass the current for the relay. I reckon the neatest way would be to use the USB power line and switch it with the interface output switches. The relay I originally suggested is suitable. Alternatively, you could use a small plug in power supply to power the relay coil.

Yes but your original post is way over my head :(
 
Ok, for simplicity mabye we'd better go with using a plug in supply for the relay coil. From here:

**broken link removed**

the

AC/DC UNREG PLUGTOP PSU 12V DC 300MA RC code 85-2913

is fine for 12v relays such as:

**broken link removed**

32.21 12V DC MINIATURE SPDT 6A RELAY RC code 60-4087

You then use the switch output from that board to switch the current from the plug in supply into the relay coil. This will close it's contacts and, with the external drive connected through them, switch it on.

This shows how to connect up the relay. It is a PCB model and will need to be soldered. If that is an issue, you could use one of these with push on connection:

**broken link removed**

Anyhow, this shows how to connect up the PCB relay:

**broken link removed**

I attached a diagram which should help. The only thing i'm not sure on is that board and how it's outputs work, so this may not be everything :( . I'm treating it as a switch, but don't think it's as simple as that.
 

Attachments

  • connection diagram.gif
    connection diagram.gif
    169.1 KB · Views: 407
wow!!! thats brilliant!! thanks very much for your time.

However :eek: I am a bit confused on why we are using a separate 12v power supply. I was hoping to switch a relay using the 5v from one of the outputs on the USB board.

The reason I have this idea is here: https://www.flickr.com/photos/simplesimon/163384734/in/set-72157594160190785/

This guy seems to be switch 120/240v with 5v from USB, so I guess the question is... why can't I?

I'm not trying to be argumentative *honest* I just really want to understand.

thanks again
Nemo
 
Interesting. Yeah, that is a solid state low voltage relay (bit expensive) and that could probably be switched by a USB signal alone. The thing is with that board is i'm not sure it actually outputs a signal voltage, rather it's output is a switch? The analogue outputs may work, since they can go to 5v. If you programmed one of them to change to 5v it may have enough current to switch a 5v solid state relay like in that project; it says 1.5k output impedance so you'd need to check.
 
Hi I've found a diagram (on ebay of all places) and was wondering if you would cast you eye over it and see if its viable. The parts are a lot cheaper than a solid state device as you mentioned.

**broken link removed**

thanks in advance.
 
Last edited:
I would do it via a 4N35 or equivalent opto isolator,
Drive the input via the USB, and the open collector output can drive via a driver transistor the relay, to have a safety barrier between the USB and the relay as well as the mains in case something fails.
For the sake of a little more work, it is a lot cheaper to do it this way then blowing up your PC in case something goes wrong.
 
RODALCO said:
I would do it via a 4N35 or equivalent opto isolator,
Drive the input via the USB, and the open collector output can drive via a driver transistor the relay, to have a safety barrier between the USB and the relay as well as the mains in case something fails.
For the sake of a little more work, it is a lot cheaper to do it this way then blowing up your PC in case something goes wrong.

Completely over my head :confused:

I'm not an electronic type person as you can probably tell from my earlier posts in this thread. Having said that if I have a circiut I can usually build it. e.g I've built plenty of PIC circuits.

Any chance you could should me on the diagram what you mean?

thanks

PS I am fairly technically minded, Im a programmer by Profession.
 
Last edited:
Free big tits blonde movies

All images deleted and link removed --- sad smutty loser - go play elsewhere !

Yours, the Moderators
Mechie
 
Last edited by a moderator:
frbigblmov: The morons who are responsible for posting crap like this should be hunted down and have their fingers cut off.
 
Nemo,
If your Velleman board sends out 5v when you want it to, then I see no reason why the 'eBay' circuit can't be used. To be honest, that's the way I'd do it.
I'm thinking of getting one of thoes things myself. However, I have just done a stock check with Maplin, and they ( typically ) don't have one in the local branch.
 
House0Fwax said:
Nemo,
If your Velleman board sends out 5v when you want it to, then I see no reason why the 'eBay' circuit can't be used. To be honest, that's the way I'd do it.
I'm thinking of getting one of thoes things myself. However, I have just done a stock check with Maplin, and they ( typically ) don't have one in the local branch.

Luckily they have 3 in at my local branch.

Looking at the diagram again, is the +12 marked on the circuit supposed to be the +5 v from the velleman?

On the 12v I want switching, would I switch the +12v or the -12v? (on 240v would you switch live or neutral?)

and where would I connect the velleman to? I ask because on a previous post Dr EM very kindly posted a diagram where he connected to a digital output of the velleman, then also to the ground. Yet the diagram i listed seems to have 3 connections. 0 -5v in, 12+ and ground.

Sorry if I am being a little slow...... I just want to be 100% sure I'm not going to blow my PC up :eek:

thanks

**broken link removed**
 
Hi
why any doubt
10k resistor takes care
12V used for relay coil should be isolated , that is the only case.
 
I've been looking at the manuals for the k8055 USB board, and on page 19 of the assembly manual is a diagram of just what you are looking for. ( Mind you, personally speaking, I'd include a diode in parallel with the relay, as in the diagram you have in your post ). :)
 
mvs sarma said:
Hi
why any doubt

Perhaps little snippets in my posts may have given you clues.. e.g

However I am not fully sure hence asking for help here. I have a Maplins book but there are a lot of relays in there of different types and I am also unsure of what exactly which one I would need.

Yes but your original post is way over my head

I'm not trying to be argumentative *honest* I just really want to understand.

To put in simply, if I didn't have any doubt, I wouldn't be asking the question. The fact that I am asking the question in the first instance should have already answered your question :rolleyes:
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top