Dual latch Relay Circuit Setup

I was thinking something similar as DrDiettrich. If the LEDs alternately blink, then replace the relay test circuit with the actual relay. Here's an updated diagram:

|500x305

I'm a little concerned that the 2N3904 will not be strong enough to switch the relay coil. May need to replace with PN2222A or other.

EDIT: In the code, you may need to temporarily change the pulse interval from 40ms to 100ms to see the LEDs blink (pulse) a bit brighter.

I'm a little concerned that the 2N3904 will not be strong enough to switch the relay coil. May need to replace with PN2222A or other.

I have ordered 50 PnAAAA weeks ago, but they have not arrived. I also have:

2NAAAA will these work?

I understand this circuit a little better than the other. Does the led go in series after the diodes to the far right?

Once again thank you so much for your continued correspondence.

The 5V coils draw 120mA, should not be a problem with any transistor.

2NAAAA will these work?

If you mean 2N2222A, then yes.

I understand this circuit a little better than the other. Does the led go in series after the diodes to the far right?

The LEDs go in series with the 330 ohm resistors. The common connection point of the resistors is the 5V relay supply voltage.

EDIT: In the code, you may need to temporarily change the pulse interval from 40ms to 100ms to see the LEDs blink (pulse) a bit brighter.

I just followed the code you provided originally and there was a 40 - 1000 ms delay change. So i assumed this was what you meant.

With the revised LED test circuit and changing the transistors I have managed to get the LED circuit working as I would imagine the relay circuit would. I think I understand the circuit better now.

Now I just replace the whole relay test driver section with a relay, or do I need to swap the resistors back to the oldies.

Thank you so much for your help so far.

I'd leave the test LEDs in place, also the long delay. Then change resistor values if required, and finally clean up.

I’d leave the test LEDs in place, also the long delay. Then change resistor values if required, and finally clean up.

It looks alot nicer than last time.

How would i add the relay to this?

Thank you for all your help DrDiettrich

I tried adding the relay, 1 pin to 5v before the LED's resistors , then the two outer pins to common line before the diodes.

It seemed to flash one side, then both at the same time. No clicking noise.

Hi Guys,

I have removed the revised circuit from within the area entitled test relay circuit and replace that with the relay. This allow me to latch the relay either way, it kept its state after power off!!!

I am almost ready to put this onto a perfboard. Can you guys recommend any last minute things I should add or do to the circuit?

I was using the 330 resistors when I got it working, should I change this back to the 470s?

Out of curiosity and please forgive my ignorance. I was wondering if it is possible to perform this operation without the external power supply? By using an external ground? (I am new to all of this). Say for example if I had an arduino Nano, which has the job of pulse switching 1-3 relays.

Thank you so much, I am so happy I managed to get the circuit working

PS. my PN22222A's arrived today.

each coil uses 150mA if you use the Arduino power, you may have a dip in voltage. however, there is a away to trickle charge a cap to use that for the power dump to the coil. you cannot change state before it charges, and you cannot energize two at the same time unless you size the caps properly.

Continue with the 330R. Current is only drawn as long as the relays are triggered.

It may be possible to drive the relays from the Arduino 5V, but only with big caps (>=1000µF) added, or you risk controller resets or other malfunction. But if you already have a 5V supply, you can power both the Arduino and relays from that supply.

each coil uses 150mA if you use the Arduino power, you may have a dip in voltage. however, there is a away to trickle charge a cap to use that for the power dump to the coil. you cannot change state before it charges, and you cannot energize two at the same time unless you size the caps properly.

Thanks for the reply. But I am not exactly sure what you mean.

The option is to have latching relays all around my house, which is powered through cabling in the wall.

I had a thought that I could have a main 15v 3-4A power supply fed throughout the house via phone cabling (to account for voltage drop), it should drop down to an acceptable 6-12 V by the time it hits the arduinos. I would then use the regulated 5v supply to latch the relays. If I cant power from the nanos, i basically have two options.

Option 1: Input wall cavity power sockets and then use AC - DC 5v 1A USB sockets which I plug into the nanos and then a separate 5v supply for the relays

or

Option 2: Send a higher voltage through the phone cabling all around the house and then attempt to regulate the voltage down to 5v at the end for the relay...Not sure on that one.

Any guidance would be very much appreciated. thank you in advance

Continue with the 330R. Current is only drawn as long as the relays are triggered.

It may be possible to drive the relays from the Arduino 5V, but only with big caps (>=1000µF) added, or you risk controller resets or other malfunction. But if you already have a 5V supply, you can power both the Arduino and relays from that supply.

Does this mean I can do either the main external power supply for everything through phone cabling or a single 5v in each wall as said above and then I activate a plus and a negative on a board such as this:

http://www.ebay.com.au/itm/Protoboard-Plus-Tiny-Premium-DIY-Protoboard-Perfboard-for-Arduino-AVR-PIC-/331627685381?hash=item4d368ce605:g:m5YAAOSwT6pVzF6S

and this would be an acceptable method of powering both units?

Thankyou for your time

I just looked up voltage drops and although 15v 3-4A is quite considerable...

5v at 20ma is very minimal indeed. Maybe it would be better to have a main controlling arduino that sends signals through cat 6.

If I were to feed the main arduino 7-12 volts, but then send the reset and set , arduino 5v and power supply ground out on 4 different cat 6 inner cables. Would this work by any chance?

I just followed the code you provided originally and there was a 40 - 1000 ms delay change. So i assumed this was what you meant.

The 40ms is the pulse duration. The 1000ms is the timing between Set and Reset. When looking at the LEDs in the test circuit, the Set LED will give a very quick blink, then 1 second later the Reset LED will quickly blink, then this repeats forever.

So basically, the control signal (quick pulse) toggles back and forth from the Set pin to the Reset pin. The relay contacts do not pulse. They will close continuously for about 1 second, then open continuously for 1 second, and repeat like this forever.

I have removed the revised circuit from within the area entitled test relay circuit and replace that with the relay. This allow me to latch the relay either way, it kept its state after power off!!!

Yep. That's why its called a "latching relay". It has memory. This is the main advantage of this type of relay ... it only takes minimum 30ms of power to the coil to change the status of the contacts. In the test code, the relay coil draws no power whatsoever 96% of the time.

each coil uses 150mA if you use the Arduino power, you may have a dip in voltage.

Note that Set and Reset are never activated at the same time. So 150mA is the peak current, but only for the pulse duration (30ms minimum). Most of the time the coil is disconnected. A capacitor could help if the supply can't handle a 150mA impulse, but I doubt this would be a problem.

The option is to have latching relays all around my house, which is powered through cabling in the wall.

How many relays? Note that you'll need 2 digital outputs per relay.

Can the relays be Set or Reset sequentially? If so, all that's needed is 150mA. If you have 25 relays and your impulse is 40ms, then it will only take 1 second to update all 25 relays with only 150mA of current.

Can the relays be Set or Reset sequentially? If so, all that's needed is 150mA. If you have 25 relays and your impulse is 40ms, then it will only take 1 second to update all 25 relays with only 150mA of current.

If I am understanding what you mean is current then this is amazing news!

I looked up voltage drop for phone line (i think: 22-24 gauge). With .15 A and 5v there is only a very small voltage drop.

From this, I feel the best way to control it is:

From one main arduino Mega in a central location that sends pulses via cat6 into the roof, into the wall cavities housing the relay circuit?

Does this sound like it would work? That way I could also have a 5v power supply at the main source which I can send out with the cat 6 through the cables.

Thank you for your time.

Hi thre guys,

Just a side note question:

Hypothetically, if i did go down the supplying 5v current through cat 6 around my house, could I use the module featured in the below link to:

Receive voltage which would have dropped from 5v-(4.9 - 4.6) depending on the distance sent (between 5-25 metres). Then regulate it up to 5v at 500ma.

What are your thoughts guys?

Step Up Module - Ebay

From this, I feel the best way to control it is: From one main arduino Mega in a central location that sends pulses via cat6 into the roof, into the wall cavities housing the relay circuit? Does this sound like it would work?

Yes, this could work.

That way I could also have a 5v power supply at the main source which I can send out with the cat 6 through the cables.

Something to consider: I'm quite sure it's possible to use just one supply for everything. I would consider using a 7.5V (regulated) DC supply that can be used to power the Arduino through Vin and also provide power to all the relays. For relay power, just use one 1N4004 or 1N4007 diode in series with the 7.5V. This essentially creates a separate 6.8V supply for the relays.

This will not be a problem because of the voltage drop across the transistor (0.3V) and the voltage drop through the wiring which would leave something less than 6.5V. Note that the rated voltage of the relay coil is 130% max = 6.5V.

I’m quite sure it’s possible to use just one supply for everything. I would consider using a 7.5V (regulated) DC supply that can be used to power the Arduino through Vin and also provide power to all the relays. For relay power, just use one 1N4004 or 1N4007 diode in series with the 7.5V. This essentially creates a separate 6.8V supply for the relays.

I have an adapter split and a screw terminal end, so I could power the arduino through the jack as normal, then have it split off into screw terminal, then into ground and then hot to diode and then a common hot line?

Is it perhaps better to have the diode at each of the cat 6 end points or would that make the voltage too unreliable on account of voltage drop in different distances of cabling?

I am starting to get excited about all of this.

Will it limit the longevity of the relays possibly putting them at the end of their tethers for the entire life at 6.5v or is it more like to be less and within the range is within the range?

Would a main arduino and a common 5v power supply , which I step up to a solid 5v → 500ma at the end of the circuit be better for the life of my project or is there issues with using cheap chinese step up modules.

Should I employ an opto-isolator?

Sorry about all the questions, thank you so much for your responses. i am learning alot

I have an adapter split and a screw terminal end, so I could power the arduino through the jack as normal, then have it split off into screw terminal, then into ground and then hot to diode and then a common hot line?

If the adapter is 7 to 7.5V, then yes. At the screw terminal with 7.5V connect the anode of the diode. Then use the other end of the diode (stripe end) for your 6.8V supply.

Is it perhaps better to have the diode at each of the cat 6 end points or would that make the voltage too unreliable on account of voltage drop in different distances of cabling?

No advantage ... only one diode required at the main power supply point.

Will it limit the longevity of the relays possibly putting them at the end of their tethers for the entire life at 6.5v or is it more like to be less and within the range is within the range?

No ... its within specifications. The main thing that would shorten life span is having the pulse duration too long. This overheats the coil.

Would a main arduino and a common 5v power supply , which I step up to a solid 5v -> 500ma at the end of the circuit be better for the life of my project or is there issues with using cheap chinese step up modules.

The main problem here is that you would need a separate module for each relay if the relays are at different locations. Also, more components, more chances of component failure.

Should I employ an opto-isolator?

Good question. There are definitely advantages with this. Note that it would make the circuit somewhat more complex. You'll probably need to design your own relay module for this.

EDIT: This darlington photocoupler could directly drive the relay coil (no extra transistor required).