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.

Help needed for controlling relay

Status
Not open for further replies.
I can confirm that pins 4,6,8,9,10,11 are all grounded. All other pins are connected to the right components and so is R1.
The voltage at the junction reads 4,7 volts, but it keeps dropping slowly and the voltage stays 9 volts at Q. Pressing the button doesn't change it anymore...
 
The voltage at the junction reads 4,7 volts, but it keeps dropping slowly
OK so far. The 4.7 reading would be 4.5 if C2 and C3 were perfectly matched (which is unlikely in practice). The voltage decay is due to C3 discharging (and C2 charging) through your meter.
What is the voltage across R1 with/without the button pressed?
Do you have access to an oscilloscope?
 
Okay, that makes sense.
The voltage across R1 is 8 milivolts when not pressed and 9 volts when the button is pressed.
And no, I do not...
 
OK. So the button-switch is working. Shame you can't check things on a 'scope.
With your Vmeter across R2, do you get any meter response when the button is pressed?
 
When I pres the button, I get a positive response of 0,045 volts, releasing it give a response of 0,01 volts negative.
And I can buy on relatively cheap, but I rather wouldn't if it's not really necessary.
 
When I pres the button, I get a positive response of 0,045 volts
That suggests (but it's not conclusive) that pin 3 is getting a clock pulse ok, so either the connection from pin 2 to pin 5 is iffy, pin 6 grounding is iffy, or that half of the IC has failed (perhaps from electrostatic discharge damage or over-heating during soldering).
I suggest you reflow the solder joints to the IC pins then check things again.
If that doesn't effect a cure then you could disconnect pins 1,2,3,5,9,11 from their present connection points, ground pins 3 and 5, and try using the other half of the IC (for that, pin 9 will go to pin 12, pin 11 will go to C1/R2, pin 13 will go to the Q1/Q2 bases). Hopefully the other half of the IC is still ok.
 
I've checked and done everything you've said, but I couldn't find anything wrong... It was still the same.
So I decided to start from the ground up and I made a new layout which would use the other half of the IC.
Now some things have changed, but it's still not working. But I do think I managed to narrow it down somewhat.

When I first connect the powersupply I get a zero at Q2. In this state I get 0,55 volts at the C2/C3 junction (with or without the relay) . Than when I press the button,Q2 becomes 9 volts and I measure 8.1 volts at the C2/C3 junction (again with or without the relay). And this is where it stops working properly. Pressing it again, I do hear the relay switch, but Q2 remains high and after this, the button doesn't do anything anymore. I do get a response over R2 every time I press the button.
Now here's something I find interesting: When Q2 is high and I disconnect the power, the voltage start dropping slowly. If I press the button, it discharges faster, but only for a brief moment. So if I press and release it a couple of times, it takes 15-20 seconds to fully discharge. Now if I reconnect the power, Q2 remains zero and the cycle is finished.

I have to mention that I have tested with 2 different IC's and they both act the same.
 
When I first connect the power supply I get a zero at Q2.
If the latch is working correctly the Q2 state could randomly be high or low at power-up.
In this state I get 0,55 volts at the C2/C3 junction (with or without the relay) .
That suggests something isn't connected correctly. Without the relay (and until you get the latch working properly it's best to leave the relay disconnected) the C2/C3 junction should be at ~ 4.5V.
Than when I press the button,Q2 becomes 9 volts and I measure 8.1 volts at the C2/C3 junction (again with or without the relay).
Without the relay coil connected the C2/C3 voltage shouldn't change. That confirms a wrong connection.
Double-check that you have no short between Q1 emitter and the C2/C3 junction or between R3 and that junction.

Is your circuit on a breadboard, or soldered on a pcb?
 
Last edited:
I've checked the board and the layout like 50 times for wrong connections or shorts, but I'm afraid I've looked at it so often I'm unable to see my own mistake.

My circuit is on a veroboard, with the IC's, the transistors and the relay on sockets for safe soldering and easy switching. Still haven't invested in a breadboard yet...

Here's the layout I made:
Relay driver - side 2.png
Relay driver - side 2 (tracecuts).png
 
You have C1 connected to pin 12; it should go to pin 11.

Nice pics. What software did you use to draw them?
 
Last edited:
Oops...that a mistake in the drawing, that not how it is on the board. The jumper is actually at row D, so it is correct.

I use this site (**broken link removed**) to go from a schematic to a layout. Because it keeps track of the different components that are linked together, it makes it a lot easier to come up with a compact layout. It takes some getting into, but after that it works great. Then I usually draw it again in DIY layout creator to make that fancy looking drawing. It's free to download and use of off google. I find that easier to use when actually populating the board and keep track of the different components, but it has some annoyances when working with it.

For the second layout, I didn't make the drawing at first. I used the online layout, because I was eager to get it working. I made the drawing this morning.
 
Assuming the jumper is actually at row D, get out your magnifier/meter and make absolutely sure that the track cut at row B column L is complete (no whisker of copper remaining). Also check for solder/copper whiskers bridging other tracks/cuts. Something else to check is that no legs of the IC have been bent under, and that the IC is fully seated.
 
Last edited:
I don't know what happened, but at the C2/C3 junction I now get 4.2 volts. I've checked all tracks, checked the IC, checked the trace-cuts and found nothing out of the ordinary. Also checked the transistors and they turned out fine. After re-seating them, I got a normal read at C2/C3... so yeah whatever.

I also found out that when Q2 is high and I remove the power, and the voltage at Q2 drops to below around 7 volts, the switch works although not really reliable. Pressing it causes Q2 to become low and when I press it again, Q2 becomes high again (to whatever voltage still remains in the system). But like I said, it usually works, but sometimes I have to press it three, four times (slow or fast presses don't seem to make a difference).
So maybe it is just a case of fiddling with some values?
 
I don't know what happened, but at the C2/C3 junction I now get 4.2 volts.
Methinks there was previously a dodgy connection which has now been corrected.
Also checked the transistors and they turned out fine. After re-seating them, I got a normal read at C2/C3
Are the transistors in sockets?
it usually works, but sometimes I have to press it three, four times
Sounds like switch contact bounce may be unusually prolonged. Try increasing the value of C1 (e.g. put another 100nF in parallel). Allow 1s or so between button presses.
 
Hi

Here's a circuit you may consider...
The circuit I've shown I simulated from an 74HCT version and the results were good, so I expect it will work.

Since there are two D FF in the package, I used both.
I added a POR circuit because the Toggle FF would not always init to the same state on power up.

The circuit I bread boarded works but uses 74HCT74 FF so it was a little different ( I used two Voltages, 5v and 9v).
I'd breadboard the CD4013 version but I don't have a CD4013B (maybe tomorrow).

Anyway...it should work.


eT
 

Attachments

  • MagLatchDrvr-CD4013B.png
    MagLatchDrvr-CD4013B.png
    64.5 KB · Views: 158
R1/C1 in that configuration will result in a slow clock ramp. Won't that exceed the clock spec rise time for the D-latch?
 
Sorry, R2/C1 (in your .png file).
 
Put another 100nF capacitor over C1; no change... While the power is connected, the button still only works once when Q2 is low, but in this state the button ALWAYS works. When I power it off, I still have to wait till below 7 volts on Q2 before the button has an effect, but it's still inconsistent. And yes, the transistors are in sockets. Is that a problem?

eTech I'm willing to give your schematic a go aswell , but I have to order some more resistors and other components (maybe a breadboard wouldn't be so bad either) so I better wait till you guys agree about the schematic ;)
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top