Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A momentary push button cannot remember whether a circuit is on or off. To make one press turn a device on and the next press turn it off, add something that stores the state: a push-push switch, a logic latch, a relay, a MOSFET soft-latch circuit, or a power-button controller. For a simple logic signal, use a debounced flip-flop; for a low-voltage DC power rail, use a properly designed MOSFET latch; for a device that needs orderly software shutdown, use an external latch or dedicated controller.

First decide what “on/off by a push button” means

These behaviors call for different circuits:

  • Press once for ON, press again for OFF: Each short press toggles a stored state.
  • Short press for ON, long press for OFF: The circuit distinguishes press duration, often to avoid accidental shutdown.
  • Press to run: The load is powered only while the button is held. No state memory is needed.
  • One-shot operation: A press starts the load for a fixed time.
  • Software power button: A short press asks a processor to shut down cleanly; a long press may force power off.
  • Toggle a signal, not the whole power rail: The controller remains powered while an LED, relay, or logic output changes state.

A circuit that toggles an LED does not necessarily switch off the processor that controls it. Whole-device power switching also has to address startup, shutdown, and unwanted current through connected signals.

Why the button needs a memory element

A normally open momentary button briefly connects its contacts when pressed, then returns to its original condition when released. It has no memory of the previous press. Press-ON/press-OFF operation therefore needs a bistable element—something that can remain in either of two states until told to change. Common choices include an SR latch, a D- or JK-type flip-flop, cross-coupled logic gates, transistor feedback, a relay, or software state held by a powered microcontroller. Mosaic Industries describes latch and feedback approaches.

Choose an approach for the job

Need Good starting point Main consideration
A maintained contact with minimal electronics Mechanical push-push switch Check the contact rating and whether abrupt power removal is acceptable.
Toggle an LED or logic output Debounced flip-flop A raw button can bounce and cause multiple toggles.
Switch a low-voltage DC device from a battery MOSFET soft latch Design for off-state current, inrush, gate voltage, and startup behavior.
Allow a processor to save data and shut peripherals down Power controller or external latch coordinated with the processor The processor needs power until it completes shutdown.
Isolated or inconvenient-to-switch loads Relay or latching relay with control logic Account for coil power, contact ratings, arcing, and suppression.
Mains-powered equipment Appropriately rated, enclosed, certified switching product Do not adapt a low-voltage hobby circuit directly to mains.

Mechanical push-push switch

A push-push, alternate-action switch mechanically latches on one press and releases on another. It needs no firmware or electronic standby current and is straightforward when a maintained contact is all that is required. It may be larger than a momentary switch, its mechanism and contacts can wear, and the load’s contact current and voltage ratings still matter. Unlike a software power button, it cannot request a graceful shutdown. SPST, SPDT, and DPDT describe contact arrangements; those labels alone do not mean a switch has alternate-action memory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Flip-flop for a signal or logic-controlled load

A common arrangement routes a debounced button to a toggle flip-flop and sends its output to a suitable load driver. A D flip-flop can be wired with its inverted output fed back to D, so each valid clock edge changes Q. A 74HC74, 4013, or another suitable device may be used if its supply and input levels fit the design. A NAND latch is another option, but its input behavior and reset state must be designed deliberately.

Do not connect an unconditioned mechanical button directly to a flip-flop clock and assume one press creates one clean edge. Contacts can open and close several times during one press, causing multiple toggles. A discussion of soft on/off buttons explains this bounce problem.

MOSFET soft latch for low-voltage DC

A soft-latch circuit uses feedback to keep a power switch enabled after the momentary button is released. In a common high-side arrangement, a P-channel MOSFET switches the positive supply to the load; a small transistor or logic element pulls the MOSFET gate to turn it on, and a feedback path sustains that state. A resistor or control input returns the gate toward its source to turn the switch off. Some designs use timing components to make shutdown require a longer press.

Mosaic Industries provides example MOSFET latch circuits. Its specific example is described for approximately 5–18 V and up to 4 A; those figures apply to that circuit’s component choices, not to MOSFET latches generally. Use a reference circuit only after checking its parts, load, and operating conditions against your own design.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

High-side switching disconnects the positive rail while usually retaining the load’s ground reference. Low-side switching with an N-channel MOSFET may be simpler, and can be appropriate when the whole circuit is designed for it, but disconnecting ground can create unexpected paths through data lines, shields, sensors, or grounded equipment.

  • Check the maximum input voltage and transients, MOSFET drain-source and gate-source ratings, and the actual gate drive.
  • Check RDS(on) at the gate-source voltage your circuit supplies. Threshold voltage alone does not show that a MOSFET will conduct efficiently.
  • Estimate continuous and peak current, heat dissipation, and startup inrush from motors, lamps, converters, and capacitors.
  • Account for leakage through the latch, regulator, indicators, pull-ups, and connected interfaces; “off” does not necessarily mean zero battery drain.
  • Check whether output capacitors keep the load partly powered or prevent the latch from resetting, and whether external signals can back-power the load.
  • Define the state when power is first connected, including what happens if the button is held during startup or shutdown.

Microcontroller and power-button controller

An MCU can debounce a button, implement short- and long-press behavior, show status, and shut down peripherals in a controlled order. But firmware cannot cut the power that keeps the MCU running by itself. A separate latch or power controller must hold the rail on during operation and allow the MCU to release it after shutdown. A typical sequence is: a button or controller starts the rail; the MCU asserts a power-hold signal; firmware handles a valid press and saves data; then it releases the hold signal or commands the controller to remove power.

For a signal-toggle project, firmware may simply change a stored state and drive an output. For actual power removal, design a wake-up path and an orderly shutdown path. Cutting power during a flash write, filesystem update, or active peripheral operation can corrupt data or leave hardware in an unsafe state.

Debounce the button

Mechanical contacts do not always produce a single clean transition. Use a Schmitt-trigger RC input, a suitable latch or clock-conditioning arrangement, firmware debounce, or a controller with specified debounce behavior. An RC capacitor alone is not automatically a complete solution: the receiving input must have defined thresholds, preferably with hysteresis.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

In firmware, accept a press only after the input has remained in the pressed state for a chosen stable interval, then wait for a stable release before accepting another press. Pick timing to suit the switch and user experience; do not treat one debounce interval as universal. Dedicated power-button controllers can provide their own specified debounce and timing functions.

When a dedicated power-button IC makes sense

A controller IC is useful when the design needs documented debounce, press timing, a power-enable output, undervoltage or power-fail handling, or a processor shutdown handshake. It does not automatically replace the external switch or driver needed for a high-current load.

Device What the manufacturer specifies Best fit and limitation
Analog Devices LTC2950 2.7–26.4 V operating range, typical 6 µA supply current, adjustable timing, debounced button input, enable output, and processor handshake functions. The datasheet describes internal debounce timing of approximately 32 ms before the enable sequence, with additional timing adjustable by external components. Wide-input push-button control and MCU coordination; use an external power switch or driver where the load current requires one.
Analog Devices LTC2955 1.5–36 V supply range, typical 1.2 µA supply current, automatic turn-on through a voltage-monitor input, timed or long-press shutdown, and MCU coordination. A version can drive an external P-channel MOSFET. Systems that need automatic start or power-fail-related behavior as well as button control; confirm the exact device version and circuit implementation.
Texas Instruments TPS3420 1.6–6.5 V operating range, typical 250 nA supply current, configurable delay behavior, and open-drain reset output. Low-power push-button reset timing or logic supervision. TI positions it as a reset timer/controller, not as a universal system power-latch controller.

Specifications above are manufacturer-published values; verify the datasheet conditions, package, version, and circuit requirements before selecting a part. Analog Devices’ product pages showed starting prices of $2.52 for the LTC2950 and $2.75 for the LTC2955 at 1,000 units on August 16, 2026. Those are volume price signals, not guaranteed single-unit retail prices.

Relay-based switching

A conventional relay needs a toggle circuit to control its coil; a latching relay can retain its state mechanically after a set or reset pulse. Relays can provide isolation and switch loads that are awkward for a MOSFET, but they are larger and often consume coil power while held on. Contacts can wear, arc, and bounce. Suppress DC coil back-EMF with an appropriate diode or other suppression component, while checking its effect on relay release time. Solid-state relays suit only compatible load types and require their own leakage, heat, and switching checks.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

A relay module is not automatically safe for mains use. Line-voltage designs require suitable enclosure, spacing, fusing, component ratings, and applicable electrical-safety practices. For mains equipment, use a properly rated certified product rather than adapting a low-voltage latch circuit.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Build and verify in this order

  1. Define the behavior: Record supply voltage and transients, load type and current, whether presses toggle or require a long hold, whether shutdown must be orderly, the off-state current budget, and the required startup state.
  2. Choose the architecture: Use the selection table above to distinguish a maintained contact, logic toggle, DC power latch, processor shutdown, relay, or mains-rated product.
  3. Condition the button: Add appropriate hardware debounce, firmware filtering, or a controller IC’s specified debounce function before relying on a press as one event.
  4. Choose a load driver: A logic output should not power a motor, lamp, heater, or relay coil unless its ratings allow it. Use a suitable MOSFET, load-switch IC, or relay driver; add flyback or other suppression for inductive loads.
  5. Test startup and edge cases: Test power connection, short and long presses, release, a held button during startup, rapid presses, brownout, battery removal and reconnection, maximum load current, and the actual load’s capacitance.
  6. Check shutdown and isolation: Confirm that storage writes complete, connected interfaces do not back-power the circuit, and the measured off-state current meets the battery-life requirement.

Troubleshoot common failures

One press toggles twice

Likely cause: Contact bounce reaches a clock or logic input as multiple edges. Fix: Add appropriate hardware or software debounce; do not use a raw button as a flip-flop clock.

The circuit turns back on while being switched off

Likely cause: The button is still held when the latch releases, or collapsing load voltage feeds the latch through a capacitor or signal line. Fix: Require a long press, ignore further input until release, add an off interval, and remove unintended feedback paths.

The MCU appears off but still draws current

Likely cause: USB, UART, GPIO, sensors, programmers, or communications lines supply current through input protection paths. Fix: Review power sequencing and interface connections; use suitable series resistance, bus switching, open-drain signaling, or power down the connected device as well.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Large capacitors prevent a clean off state

Likely cause: Stored charge keeps the load above its logic threshold or feeds latch feedback. Fix: Consider a controlled discharge path, a load switch with output discharge, or a latch designed for the capacitive load; account for discharge time and energy.

The MOSFET heats up or the latch resets at startup

Likely causes: Excessive on-resistance at the actual gate drive, inadequate thermal design, or load inrush above the switch or supply capability. Fix: Recheck on-resistance at the operating gate voltage, peak current and transient ratings, heat dissipation, and whether soft-start or inrush limiting is needed.

Startup state changes unpredictably

Likely cause: A simple latch’s state depends on leakage, capacitor tolerance, or supply ramp. Fix: Add a defined startup/reset network or use a controller with documented startup behavior. The LTC2955 includes an automatic-turn-on voltage-monitor function; follow its specified circuit rather than assuming every latch starts in a known state.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.