I will apologise straight off for the lack of circuit diagram. But I will explain what I am trying to do as best as possible.
I have the dual altching relay model of this relay. I am trying to configure it so that I can both latch it either way with my arduino. A wise person on this forum has guided me to understand that in the diagram. I think 5v is applied to the + pin and then when setting or resetting the relay, I have to set either side to low? Is this correct?
I have also read that I should employ resistors and diodes to protect the arduino from getting fried.
Any help on how I would set this circuit up would be much appreciated. Thank you for your time.
First of all open the data sheet and find your specific relay description (section Dimensions), to identify the coil connectors and polarity. Eventually the same information is printed near the relay pins. Or give the full type ID of your relays, so that we can find the essential details pertaining to exactly that type.
In either case you need at least 2 transistors, better a H-bridge, to drive such a relay. The Arduino outputs are incapable of sourcing that much current or voltage as required to toggle the relays.
H-bridge is the magic word.
But, there is a BUT ...
Building this circuit with discrete devices you will have to make absolutely sure, that certain conditions won't happen if you don't want to fry the transistors in the circuit. As the transistors need a time (ok, pretty short, but they are fast) to switch from ON-OFF or OFF-ON you might run into a situation where the current is shortened through two transistors with any load in between which will fry at least one, maybe both transistors.
There for my recommendation is to use a special IC for that which is designed to avoid that shortening situation.
A suitable H-Bridge IC is the L293D, which is pretty common in the Arduino world and pretty cheap, coming with internal protection diodes and it's inputs can be directly connected to the Arduino outputs without addt'l resistors.
The following links give you some more detailed information how to use the circuit; in your project just replace the motor with the single coil of your latched relay - polarity of the coil is irrelevant as you can switch the state back and forth by the Arduino.
I'd wait for feedback about the really used relay. If it has separate set and reset coils, two transistors will be perfectly sufficient, a full H-bridge is required only for a single coil relay. For insiders: just the same difference as with unipolar and bipolar stepper motors
Separate 5V supply is needed but H-bridge is not needed (I've used these). Only 2 outputs needed. Remember to use a pulse (HIGH) to set or reset the relay (do not leave the outputs continuously high). A pulse duration of 40ms works well.
Thank you again for your response, I will attempt to make something following your guidelines after i finish work tonight.
I was referring to the hollow white downward arrow, is this ground?
If not I was curious as to how the circuit is grounded? I am a beginner at this stuff, but from the diagram you provided it looks as if the current from the high pulse will trail back out the left pin of the opposite transistor?
Does the white hollow arrow mean 5v? That would mean that 5v goes into the collecter, then the base is pulsed and the emitter delivers the current towards either reset or set? then the back flush of emf travels through the diode back into the centre pin?
You better use the circuit diagram in #8. The H-bridge circuit in #3 is too specialized and simplified, will work only under certain conditions. The weakest point is the restriction of the supply voltage, which is supposed to equal the logic HIGH voltage of the driving output pin, under load. Even then the top transistors may not turn fully on, due to the voltage drop in the base resistors. If a base current of only 1mA is required, this will drop 1-3V on the 1-3k base resistors, another 0.7V on B-E, and 0.4V on the C-E of the bottom transistors, so that less than 3V is left for the coil
Increasing +V doesn't help, because the emitter voltage can not exceed the base voltage, which is determined by the connected controller output pin. In practice the top transistors should be PNP, with another NPN transistor driving their base.
The hollow arrows mean ground. The diodes let the back flush rush into the power source.
Thank you for your reply. I am building the circuit now. Is the external 5v supply mandatory or is this the only way doing it this method?
Would this mean I would need two power supplies for every one of my projects? Would it be possible to have 1 main external supply that feeds all of the relays around the house through cat6? I know there would be a voltage drop, so you would up the voltage at the start, is there anyway however to ensure that 5v goes into the circuit at the end?
I attempted the circuit. I have enclosed pictures but will describe as best as possible
arduino pin 6 -> 470 resitor to base of transistor, with left pin leading to ground and right pin leading a common line which splits off into 1 pin of relay (of the 3 pins), the other is a diode pointing towards a line that is fed 5v from an external power source. This is repeated for pin 7.
I then used the script your provided, no clicking noise when hot is not attached and no switching when it is.
I feel i have possibly confused myself somehow and done things wrong. The bit that worries me the most is around the input area. I have attached pictures to attempt to assist my explanation.
Test your circuit by disconnecting the base resistors from the controller, and connect them momentarily to Vcc to switch the relay. You can also add a LED (+resistor) to the output pins, for visual feedback.