Help with 14M2 and latching relay

parto

Member
Hi, I needed another output pin and so in my project am switching from using an 08M2 to a 14M2. I was driving a latching relay. The 08M2 output pins worked switching the relay but with the 14M2 I hear just a faint click from the relay. I've spent a while getting to this point. Here is the replay I am driving: http://www.ebay.co.uk/itm/Bistable-...894847?hash=item2337da167f:g:rmQAAOxy4eJTLokg . In the 08M2 I used pins C.0 and C.4. With the 14M2 I am using B.1 and B.2. Thanks!
 
Last edited:

erco

Senior Member
Diagram below is from datasheet at http://www.audiowind.com/pdf/D-151.pdf This latching relay has 2 coils, a Set coil (relay on) and a Release coil (relay off). Looks like transistor bias resistors and flyback diodes are already on the board, so you can connect whichever Picaxe output pics you like directly to the S and R pins.

Drive the S pin high briefly to Set the relay, then make it low and you're done. A half second pulse is more than enough. You may hear ONE click when it latches but no more, because once it's latched it can't latch anymore (until you activate the other coil to release the relay).

To release the latch, drive the R pin high briefly to Release the latching relay, again a half sec pulse is all you need, then drive the R pin low. You may hear ONE click when it releases, but again, further high pulses to this pin won't make another click, because once it's released it can't release anymore.
 

Attachments

Last edited:

erco

Senior Member
BTW latching relays are great for saving power but they need two control pins. You said you needed one more pin than an 08M2 had to use this latching relay. Two questions:

1) Are you using SEROUT pin C.0? It can be an output pin too. Edit: I see you are after re-reading your first post.
2) Do you know about the trick to use the SERIN pin as an output pin? It requires adding a MOSFET and a resistor. Then use Picaxe's built in pullup resistors to turn the MOSFET on & off. Pretty slick.
3) Can you use a standard (non-latching) relay? That only takes one pin, but it must be constantly driven (consuming some power) to keep the relay on.
 
Last edited:

hippy

Technical Support
Staff member
The 08M2 output pins worked switching the relay but with the 14M2 I hear just a faint click from the relay.
There doesn't seem to be any immediately obvious reason why the relay board should work with the 08M2 but not the 14M2. It would be worth describing what PICAXE hardware you have, your circuit diagram, and providing the code you are using.
 

parto

Member
Hi erco and hippy; thanks very much for the replies. I can try to put together a circuit diagram but am a beginner at that and it will take a while. So I'll first describe what I've done. I tried to just replicate what worked with the 08M2. With the 08M2 I used pins C.0 and C.4 to switch the relay. For the 14M2 I used the AXE117 proto board (I used the 08M2 proto board also). I put everything onto the board except the optional Darlington chip. I used the b.1 and b.2 soldering holes that are right next to the 14M2 chip. My setup also uses a DS3231 real-time clock. I used the b.3 and b.4 pins next to the chip for that too, and that seems to be working OK.

I am testing the setup with a simple program:

#picaxe 14M2
main:
high b.2
low b.1
pause 300
low b.2
pause 300

pause 3000

high b.1
low b.2
pause 300
low b.1
pause 300

pause 3000
goto main

As I say, I hear faint clicks and the relay does not switch. Using the 08M2 with the same program (with the pin numbers changed) I get strong clicks and the relay does switch.

Hopefully someone can recognize with this description something I've done wrong--maybe something with way I'm using the proto board? If not, I'll try to get a diagram done. Thank you!
 

hippy

Technical Support
Staff member
The relay board you have seems to have drive transistors on it so it shouldn't be a case of drawing too much current through the pins.

The only thing I can think of is there's a wiring error somewhere or something is causing the power rail to collapse leading to the PICAXE restarting, causing the relay coils not to have fully energised before it restarts.

You could modify your code as below so it will report what it is doing when it is running after download -
Rich (BB code):
#picaxe 14M2
#terminal 4800
  sertxd( cr, lf, "restarted", cr, lf )
main:
  sertxd( "main " )
  :
  as already exists
 

parto

Member
Hi hippy, The serial terminal says:

Receive Buffer: 1 mainmainmainmainmain

I hear weak clicking but there is no switching. I'll try replacing the relay next.
 

erco

Senior Member
Should certainly work, unless there is something wrong with your 14M2 or the AXE117 board. Plug your 14M2 into your 08M2 board (should fit) and swap some pins to see if it works.
 

erco

Senior Member
On the AXE117 board, pin B.2 is also connected to header pin PZ. Is that connected to ground somehow?
 

parto

Member
Dang, it seems that the problem was what I least expected--the relay itself. Although it was new, when I replaced it, the 14M2 worked just as the 08M2 setup does. Sorry to take you down a bit of a rabbit hole, but knowing that I was doing things correctly helped me do the replacement, which I'd considered earlier but figured it was more likely I'd done something wrong. Thank you both!
 
Top