I have a momentary push-button switch in an existing installation that I can hijack for a project. The project requires a 5 VDC relay to activate and the rest of the circuit is powered through there.

But how do I make a momentary push-button switch activate a relay?

I built a circuit like this in the Falstad circuit simulator.

Enter image description here

The output is the collector of the NPN with the 1 kohm base. I connected this point to the negative terminal of the relay and the positive terminal is connected to Vcc (12 V). This doesn't work, because the relay coil pulls the collector up and breaks the circuit.

If I add another NPN with its base connected to the NPN with the 1 kohm base it pulls the PNP base down and the PNP will never activate.

Do note I'm a newbie, just a hobbyist here. Btw, I have no access to flipflops, diodes, etc. All I have are resistors and NPN/PNP and various capacitors and a few relays. I will have to drive 2 hours to buy other components if need be.

  • \$\begingroup\$ Once you press the button, how long must the relay be engaged before deactivation? \$\endgroup\$ – jonk Jun 11 '17 at 20:37
  • \$\begingroup\$ If the relay coil is rated for 5 volts, you should not apply 12 volts to it. Is the relay to be operated only while the button is pressed? \$\endgroup\$ – Peter Bennett Jun 11 '17 at 21:04
  • \$\begingroup\$ Pushing the button activates the relay. How does the relay become deactivated? Do you have unused contacts on your relay? \$\endgroup\$ – Glenn W9IQ Jun 12 '17 at 5:47
  • \$\begingroup\$ Hi thanks for the replies. This circuit turns the momentary switch into a toggle. It is modified from here : m.eet.com/media/1134400/15136-102804di.pdf (I didn't have the R & C values of the original circuit) What this circuit does is, one momentary press results in the output (collector of the NPN transistor with 1k base) being ~12V, another press results in the output being 0V. So it has become a toggle with the PNP remembering the state when the push button is depressed. \$\endgroup\$ – Azrudi Jun 12 '17 at 7:05
  • \$\begingroup\$ Do you have unused contacts on your relay? \$\endgroup\$ – Glenn W9IQ Jun 12 '17 at 7:38

Don't forget the flyback diode or it won't last very long: enter image description here

|improve this answer|||||
  • \$\begingroup\$ Heya, thanks for this suggestion. But please treat me as a noob and explain to me why? This direction of the diode is from ground to Vcc, meaning there could be current going from Grnd to Vcc? From Vcc go Gnd the diode will block current anyway, just like as if there is no diode or wire or resistance there anyway. \$\endgroup\$ – Azrudi Nov 16 '17 at 12:18
  • \$\begingroup\$ The solenoid / inductor part of the relay stores current. If you shut the current off suddenly, it has to dissipate the energy that is stored in its magnetic field. The voltage across the coil will build up to 100s of volts, exceeding the Vds of any switch element you have, and end up zapping your FET or BJT. The diode allows it to recirculate until the power is dissipated by the resistance of the coil itself, as well as th IV drop of the diode. \$\endgroup\$ – Mike Barber Nov 16 '17 at 18:31
  • \$\begingroup\$ Ahh, alright I see now. Thank you very much. I was not aware of this. So as I have it now (without the diode), the PNP transistor at the top is the component under threat, right? \$\endgroup\$ – Azrudi Nov 16 '17 at 18:47
  • \$\begingroup\$ Correct. Your Bjt would last for a few times most likely, then would fail eventually. \$\endgroup\$ – Mike Barber Nov 17 '17 at 4:21

I've solved this problem.

I've connected another PNP driven by the collector of the 1k base NPN transistor.

It is now working and activating the relay coil as expected.

Thank you for reading!

enter image description here

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.