A Simple Soft Power Switch Using Common Modules

If you want to easily control the power in a circuit, you’ll probably reach for the classic toggle switch. While there’s certainly nothing wrong with that, physical toggles are a bit dated at this point. A soft power switch that turns your gadget on and off at the tap of a finger is far more 21st century. You might think this kind of modern trickery is too difficult to implement on a DIY project, but as [Sasa Karanovic] shows, it’s actually a lot easier than you might think.

Now to be fair, that wasn’t actually his goal. All [Sasa] was trying to do was come up with a slick way to control the LED lighting in his 3D printer enclosure. Which, as you can see in the video below, he accomplished. But the hacked together circuit he used to do it could easily be adapted for other electronic projects. If you’re using a LM2596 DC-DC converter module to power your gadget, you can add a touch sensitive soft switch for literally pennies.

The trick is utilizing the enable pin on the LM2596. The common buck converter modules tie this pin to ground so the regulator is always enabled, but if you lift the pin off the PCB and connect it to the output of a TTP223 capacitive touch sensor, you can simply tap the pad to control the regulator. Power for the touch sensor itself is pulled from the input side of the regulator, so even when the power is cut off downstream, the sensor is still awake and can kick the chip back into gear when you need it.

If you’re not interested in touch control, you could try connecting the enable pin on the regulator to an ESP8266 and making a cheap Internet-controlled DC power supply.

28 thoughts on “A Simple Soft Power Switch Using Common Modules

    1. They’re still relevant for detecting human fingers, but I’d say they’re dated for just about everything else. Particularly anything involving constant pressure.

      There’s high end switches, but at that point it’s not cheaper than optical.

      But Capsense normally works very well with large pads, when done right. To be really awesome things like that need to be able to recalibrate over time and look for fast taps, and ignore slow changes because of some extra humidity or something.

      1. “But Capsense normally works very well with large pads, when done right. To be really awesome things like that need to be able to recalibrate over time and look for fast taps, and ignore slow changes because of some extra humidity or something.”

        Or, just, you know use a damned button or switch that requires no power supply to operate, works every time without recalibration, shows its current state passively, can be operated by feel, and is otherwise in every way simpler to implement and use.

        I have a (very expensive) alarm clock for which I have to turn on the lights in the bedroom to find the little spot on the face to turn the alarm on or off. It’s also a two handed job because just “pushing” the touch spot is likely to make the stupid thing fall over.

    2. [“physical toggles are a bit dated”. No, they actually work consistently.]

      Working consistently IS a bit dated where ya been?

      But that’s the nice thing about building stuff yourself. Everything is a choice. We are all welcome to use touch switches or toggles as we please.

    3. It may be that Tom didn’t mean “dated” in the sense that technical readers would understand it, but instead “dated” the fashion industry jargon term for “no longer stylish.”

      1. So have I. An 1/8 w resistor fits nicely between the end two pins of that component to make a voltage divider.
        You can directly control it from an MCU to do soft power off/latching power on. Tweeted about it.

  1. ” While there’s certainly nothing wrong with that, physical toggles are a bit dated at this point. A soft power switch that turns your gadget on and off at the tap of a finger is far more 21st century. ”
    What an annoying line of thought. Since when does “fashion” matter in DIY? That’s cringy.

    Soft buttons have good uses, but to be modern is laughable and annoying.

    1. I never had old devices turn on/off or change mode accidentally. But with a modern smart phone I halve of the time can’t even hold the darn thing without triggering something and doing something unexpected and unwanted. Yep… technology has come a long way. These “soft switches/buttons” combined with bad or inconsistent user interfaces that have too many functions under the same button, give many users a hard time, how hard can it be?

      But the HUGE advantage of a true switch (the one that actually breaks/makes the circuit) it that it truly breaks the circuit, all those soft power switch solutions have a standby current of some sort, no matter how small it’s never zero. A true switch gives you true feedback, you can feel or hear when you switch it. People kind of like this… a lot. Touchscreen and softswitches combined with a slow response of the device are horrible to operate… did I press it… oh… yes it does something now, did I do that? The fun starts when the system breaks down… is the problem in the switch? You don’t know, there is no feedback. Ohh.. wait, it didn’t see my finger properly. But too sensitive isn’t good either.

      Progress can be cool, but looking at this project, did it really improve the system? Is this really so much better then a simple switch? There is no need for touch-systems if you don’t want a tumbler switch, use a simple push button on/off switch, you know the one granny has on the lamp near her bedside.

      Though, I fully understand the tinkering factor here, so nice job on that one.

      1. The standby current for that buck converter is 80uA. A coin cell can do that for 5 years. The voltage divider I use to hold the _enable pin high for an MCU draws more power. :)
        This particular application really shines in battery-powered children’s devices. You can still have an on/off switch, but now it just momentarily grounds the _enable till the MCU takes over holding that line down. And when the device is idle the MCU can truely shut itself off with no additional actives. Just need two resistors and the buck converter you were probably already using.

    2. “Soft buttons have good uses, but to be modern is laughable and annoying.”

      Yeah, Modern would be the giant monolith with a dedicated toggle switch, deconstructing it and making it modular and its state transient is very post-modern.

  2. me – neither capacitance or resistance screens are suitable for this ATE function. and the three mechanical switches were approved by the QA and manufacturing managers.

    client – it does not look good. i want it to look more modern.

    me – then it might be less reliable.

    client – i want a modern appearance to all ATE in this area because this factory is where we bring customers.

    me – ok, sign this extension to my statement of work and sign this release.

    client – ok.

    14 months later…
    me – your honor, request summary judgement at this time.
    client – his design failed and production lost and customer lost and reputation lost and whaa whaaa whaaaaa.
    judge – dismissed with prejudice.

    1. I am not a lawyer, but based purely on this narrative, reinstated on appeal. If you can’t make it work, you have to refuse the money, the existence of the additional waiver shows that the contract is based at least in part on delivering a product or service, it is not a pure time-based contract.

      1. “….and sign this release.” usually makes it into “I submitted a design that I say will work and can be produced, but will do the demanded changes on the condition that subsequent costs, failure and consequences rest with the client ,and that they were advised of the potential harm, so it’s on them.”

        That doesn’t mean you won’t wind up in court – plenty of blamestorming after the fact – but the biggest consequence is usually that the client, with a fresh self-inflicted bullet wound in the foot, will start bad-mouthing the consultant. Occasionally they’ll do a Microsoft and try to bleed you out in court costs which is pretty annoying.

  3. Huge thanks to Tom and Hackaday for sharing this “project”.

    Also a big thank you Hackaday readers for valuable feedback.

    As I mention in the video, the main motivation behind using a touch sensor is being able to hide it under a surface. I’m going to embed it inside a table so it’s not visible from the outside, but you still can activate it through top surface.

    I really like that people are discussing how they like and dislike this solution, that was the whole point of the video. Showing
    how something can be done. It’s not the best way, it’s not the worst way, but rather sharing an a idea an how something can be done and hopefully ignite that hacker/maker fuel in others to go and make something awesome. :)

Leave a Reply to RubyPantherCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.