PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

12V relay schematics

Wed Dec 13, 2017 8:39 pm

Hi.

https://ibb.co/hJkRX6
An using this schematics with great success but i didn't try it with 12v relay.

Question:
If i change 5v with 12V relay and apply 12v instead 5v, this should work without a problem ?

Am opening electro lock with this relay setup.

PIN

User avatar
davidcoton
Posts: 4251
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: 12V relay schematics

Wed Dec 13, 2017 8:54 pm

Yes. That circuit properly isolates the 3V3 GPIO output from the relay coil voltage, so there is no effect on the Pi from using a different relay and its associated supply voltage.
Signature retired

PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

Re: 12V relay schematics

Sun Dec 17, 2017 8:59 am

Sorry for late reply.
I have tested this electronics with 12V supply and i can hear click ON / OFF but there is no 12V on NC / C terminals ?

GND of RSP is connected to 12V GND of power supply
SIGNAL -- Triggger line ( pin 8 )
VDC --> 12V

I can see 3,3V / 0V between SIGNAL and GND lines and i can hear click, but there is no output...

PIN

User avatar
davidcoton
Posts: 4251
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: 12V relay schematics

Sun Dec 17, 2017 9:09 am

The whole point of relay contacts is that they are isolated. If you want them to switch 12V, you have to wire the 12V to them. Something like +12V to Common, NO to load, load to 0V.
Signature retired

PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

Re: 12V relay schematics

Sun Dec 17, 2017 3:18 pm

hi.
https://ibb.co/hJkRX6

I have connected
12V on 5V pin
GND on GND
GND to RSP GND
//////////////////////////////////////////////////
Are you suggesting that i leave this
5V pin on 5V
GND on RSP GND

and put

12V on NC2 and
GND to Common

Is this correct ?

User avatar
davidcoton
Posts: 4251
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: 12V relay schematics

Sun Dec 17, 2017 3:40 pm

No! That would short out the 12V supply, even before you turn the relay on.

First bit is right -- there is no way you should have 12V on the 5V pin. That is likely at least to shorten the relay's life. (i didn't look closely enough before. The diagram clearly indicates it is a 5V relay coil).
EDIT: Relay has been changed, 12V relay coil so 12V supply here is correct.

Like I said, connect 12V the the relay output common. Connect the load (12V lock or whatever) to NO. Connect the other side of the lock to the 12V supply's ground. There is no need to connect the Pi ground to the 12V supply ground, but it won't hurt either.

The relay output between Common and NO is just like a switch, which comes on when the Pi closes the relay. NC is opposite to NO, it is on when the relay is open.
Last edited by davidcoton on Tue Dec 19, 2017 10:26 pm, edited 1 time in total.
Signature retired

User avatar
Burngate
Posts: 6095
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: 12V relay schematics

Sun Dec 17, 2017 5:15 pm

Your first post implied you'd changed the 5v relay for a 12v one, and put 12v on the pin labelled "+5v", everything else the same.
And later you say the relay clicks, so that bit is correct.

But ... the voltage in the relay's spec. sheet is just the voltage the coil inside needs, nothing to do with the voltage you want it to switch.

So put the original 5v relay back, revert to using 5v on the "+5v" pin.
Then wire the NO and COMMON (or NC and COMMON) between your 12v supply and your electro lock.

PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

Re: 12V relay schematics

Sun Dec 17, 2017 7:19 pm

Your first post implied you'd changed the 5v relay for a 12v one, and put 12v on the pin labelled "+5v", everything else the same.
And later you say the relay clicks, so that bit is correct.
****
Yes, i changed 5 to 12V relay and i hear click.

But ... the voltage in the relay's spec. sheet is just the voltage the coil inside needs, nothing to do with the voltage you want it to switch.
**** OK

So put the original 5v relay back, revert to using 5v on the "+5v" pin.
**** i can not do that because PCB board is done and installed on place. I can make new connections but i can not change relay. So we will use 12V relay.

@burngate && @david
It's better to see this on photo or schematics and it would help bunch of others :-)

Is this correct ?
https://ibb.co/kYAFVR

Btw. when there's no power on electro lock, lock is closed. When i apply 12V, lock opens itself...

PIN

Paul Hutch
Posts: 412
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: 12V relay schematics

Sun Dec 17, 2017 8:17 pm

PI_newbee wrote:
Sun Dec 17, 2017 7:19 pm
Is this correct ?
https://ibb.co/kYAFVR
You need to connect 12V to the Relay's switch common terminal too, like this.

Image

User avatar
davidcoton
Posts: 4251
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: 12V relay schematics

Sun Dec 17, 2017 8:54 pm

Paul Hutch's diagram is correct.

Except NC will power the lock while the Pi output is inactive (low).
If you want the lock to be powered when the Pi output is high, use the NO terminal instaed.
Signature retired

User avatar
DougieLawson
Posts: 36552
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: 12V relay schematics

Sun Dec 17, 2017 9:34 pm

davidcoton wrote:
Sun Dec 17, 2017 8:54 pm
Paul Hutch's diagram is correct.
Does it really need the 12V supply's (on the load side) GND connected to RPi GND. Keep the GPIO signalling circuit seperate from the load that's being switched. Keep the 12V supply for the relay coil away from the 3V3 Raspberry.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
davidcoton
Posts: 4251
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: 12V relay schematics

Sun Dec 17, 2017 10:27 pm

DougieLawson wrote:
Sun Dec 17, 2017 9:34 pm
davidcoton wrote:
Sun Dec 17, 2017 8:54 pm
Paul Hutch's diagram is correct.
Does it really need the 12V supply's (on the load side) GND connected to RPi GND. Keep the GPIO signalling circuit seperate from the load that's being switched. Keep the 12V supply for the relay coil away from the 3V3 Raspberry.
Yes it is needed, because the relay coil supply ground is common to the signalling ground. The circuit was designed for a 5V relay coil, which has been changed to 12V. The 12V ground could be isolated with 5V relay coil (using the Pi 5V), but not when the 12V supply has to drive relay coil and load.
Signature retired

PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

Re: 12V relay schematics

Mon Dec 18, 2017 3:09 pm

It's working without problem. Thank you all !

PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

Re: 12V relay schematics

Tue Dec 19, 2017 9:00 pm

But not :-)

I have just test it by adding plus from power supply and the lock clicked so i was thinking that's it.
But today i went to install this so i connected again the 12 power supply to COM.
I see some sparks, so i though that something is wrong and maybe there is some short.
But anyhow i connected it and of course, power supply burned out ( 12V / 1A power adapter ).
I have re checked the connection and it's 100% connected like in schematics.
The only thing that i did not connect is GND to RSP.

----------------------------------------------------------------------------------------------------------------------------
Btw, i dont know if this matters but am not using "pure" DC electro lock.
Installed lock is standard "AC" but when i test it ( 5 sec hold ), it was correctly opened and turned off.
----------------------------------------------------------------------------------------------------------------------------
Where's the problem ?
PIN

User avatar
Mortimer
Posts: 924
Joined: Sun Jun 10, 2012 3:57 pm

Re: 12V relay schematics

Tue Dec 19, 2017 9:56 pm

What lock is it?
I be surprised if 12V 1A supply is sufficient to operate it.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

Re: 12V relay schematics

Wed Dec 20, 2017 7:35 am

i was thinking about that too because AC locks need more power, but i test it before ( directly conecting 12VDC to electrolock ) and it was working. You think that longer open state would draw too much current ?

If this would be case, power supply would not burn out....
Or ?

User avatar
Mortimer
Posts: 924
Joined: Sun Jun 10, 2012 3:57 pm

Re: 12V relay schematics

Wed Dec 20, 2017 9:38 am

I may be the existing PSU has sufficient surge capacity to initially throw the lock using energy stored in smoothing capacitors, but insufficient to hold the lock continuously. I don't know, without knowing the spec of the lock.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

Re: 12V relay schematics

Wed Dec 20, 2017 1:12 pm

I have made few additional tests and this is the result.
Instead of AC lock i have used DC one
Instead of power adapter i have used 12V/7Ah battery.

When i connect like in the upper diagram, lock opens itself but i can not control it.
It stays opened, regardless if PIN state is 3,3 or 0V...

PIN

User avatar
Mortimer
Posts: 924
Joined: Sun Jun 10, 2012 3:57 pm

Re: 12V relay schematics

Wed Dec 20, 2017 1:25 pm

Are you using a magnetic lock something like this:
Image

Or a solenoid released lock:
Image
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

Re: 12V relay schematics

Wed Dec 20, 2017 1:37 pm

I have one 12 DC lock ( red / black wires ) but i can use it just for test.
The one that is installed on door uses AC. Am sure of that because, on previous installation user has used standard com phone unit (inner/outer unit )....

Nevertheless, why do i get always open when i apply 12V to lock.
I mean, why isnt relay triggered from GPIO state ?

PIN

User avatar
Mortimer
Posts: 924
Joined: Sun Jun 10, 2012 3:57 pm

Re: 12V relay schematics

Wed Dec 20, 2017 2:28 pm

The schematic looks to me like the lock is wired to a normally closed (NC) contact. I.e. when the GPIO output is low, the circuit is closed and the lock is fed 12V and activates.

If the RPi outputs a high on the GPIO then the relay should switch over and disconnect the 12V supply from the lock.


Things to think about:
(1) What state does the GPIO enter when the RPi is powered up?
(2) Are you sure you are controlling the GPIO pin you think you are? Have you measured it?
(3) Do you want power going to the lock when the GPIO pin is high or low?
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

Paul Hutch
Posts: 412
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: 12V relay schematics

Wed Dec 20, 2017 4:04 pm

When you de-soldered the 5V relay and replaced it with a 12V one (the totally unnecessary conversion) I'm guessing you either:
A: Used a 12V relay with a different pin out than the 5V relay had.
B: Created a solder bridge on the PCB.

Can't think of any other way to end up with a short circuit in this very simple application.

PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

Re: 12V relay schematics

Wed Dec 20, 2017 9:40 pm

When you de-soldered the 5V relay and replaced it with a 12V one (the totally unnecessary conversion) I'm guessing you either:
*** i didnt de solder it, i created newone based on this schematics. I rechecked the pins with dmm and there is short between COM an NC.

The schematic looks to me like the lock is wired to a normally closed (NC) contact
*** it is, but i have also test it with NO.

I didnt wont to burn RSP so i hooked up this to arduino.
So am getting 3,3/ 5V -- and 0 from arduino mega board.

Do you want power going to the lock when the GPIO pin is high or low?
*** according to test, the lock is open when i apply power to it. This should be a case in real time too.
Intercom button is pressed , RSP signal is send to relay board, board opens lock...

PIN

PI_newbee
Posts: 169
Joined: Mon Aug 26, 2013 7:41 pm

Re: 12V relay schematics

Thu Dec 21, 2017 8:42 am

This is the test board. It's not representative one but...
https://ibb.co/fk2dpm

When i hook up COM to the door , lock i open all the time and i can not control it...

User avatar
davidcoton
Posts: 4251
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: 12V relay schematics

Thu Dec 21, 2017 10:23 am

  1. As previously explained, you need a link between 12V GND and Pi GND, otherwise the relay coil will not activate.
  2. Undo those taped connections and make them properly with connection strip or something else designed for the job -- to ensure good continuity where it should be, and insulation where there shouldn't be any continuity.
  3. Check the current required by the lock (either by finding and reading the spec or by measurement) and ensure that your 12V supply is adequate.
None of the above are optional. You MUST get them all right for your interface to work correctly and safely.
Signature retired

Return to “General discussion”