Push Button ON/OFF Circuit to Control Connected LED

latching ON/OFF circuit using an optocoupler of PC817 and a PNP transistor BC558, This circuit is powered by a 6V DC source like battery or adapter. This Simple latching ON/OFF circuit using PC817 optocoupler and BC558 PNP transistor. Learn how push buttons can toggle power electronically without mechanical latching. Includes working principle, circuit explanation and LED indicator behavior. lets build with proper understanding.

What this Circuit Do?

Push Button ON/OFF Circuit Diagram

Push button ON OFF circuit using pc817

Components Required

  • P1- OFF push button (normally open, connected to +6V)
  • P2- ON push button (normally open, connected to GND)
  • LED, Indicator LED for the ON state
  • PC817 Optocoupler (LED + phototransistor)
  • Q1 (BC558) PNP transistor acting as a latch switch
  • R1,R2 and R4 220ohms R3 is 1K.

Working Principle of Push button ON/OFF Circuit

The circuit is in initial state, When first powered transistor Q1 (BC558) is OFF. So the LED and the optocoupler’s LED are OFF. This time the circuit is waits for a ON button press.

ON Button (P2) Pressed

When the ON Button (P2) pressed negative voltage is passing through the bush button. This time the P2 connects the optocoupler LED (inside PC817) to ground through 220Ω resistor.

The optocoupler LED turns ON and it make the internal transistor (pins 3–4) to conduct. This provides a path for current through 220Ω to ground and it will turning ON BC558 transistor.

Once Q1 turns on, it supplies current to keep the optocoupler LED lit even after P2 is released this is the latch action. The LED also lights up, indicating the circuit is ON.

When the OFF Button (P1) is pressed

P1 connects the transistor’s base bias to +6V, cutting off the current path for the optocoupler LED. The optocoupler turns OFF, which turns OFF Q1 and LED. The circuit returns to its initial state.

Applications

  • Touch or pushbutton ON/OFF latching switch.
  • Can control a relay or transistor driver circuit for load switching.
  • Useful in low-power control panels or microcontroller interfaces.

Akhil Satheesh

Akhil Satheesh

Akhil Satheesh is an electronics expert and the Founder and CEO of Soldering Mind. Specializes in designing innovative electronic circuits and custom, high-performance PCB layouts. Every project he shares on solderingmind.com is rigorously bench-tested to ensure accuracy for makers and hobbyists alike.

Leave a Reply