11
\$\begingroup\$

In the older days and still now we have buttons where one way is off and the other way is on, its mechanically built to connect or disconnect an electric path physically.

On modern devices like laptops the power buttons work differently. Push once, it's on, Push again, it won't turn off and will go to sleep mode instead. Keep the same button pressed for around 3 seconds and the laptop shuts down as if the power was literally cut off.

These buttons surely have a more complex mechanism than just connecting or disconnecting a wire.

Does anyone know how those circuits have been designed? I am quite curious as to how these power switches work.

\$\endgroup\$
2
  • \$\begingroup\$ Do you know anything about switching AC power with semiconductor devices such as triacs or FETs? Do you understand anything about digital latches? What about microprocessors or software? In order to answer the question in a fairly short space I'd like to know how much you know so i can target the answer appropriately. I'm sure you'll understand \$\endgroup\$
    – Andy aka
    Commented Apr 6, 2013 at 21:58
  • \$\begingroup\$ Of course I do know all about these things. \$\endgroup\$
    – quantum231
    Commented Apr 12, 2013 at 22:12

2 Answers 2

10
\$\begingroup\$

The modern switches don't contain any magic. In fact, they are less complicated and expensive than real physical on/off switches.

These switches are just inputs to a microcontroller. The microcontroller can tell when you push the button, and the rest is policy encoded in the firmware to decide what to do about it. The power is usually switched with transistors. This means the button itself doesn't have to handle high voltage or high current, so there are a lot more options to make it and for it to be small. It could be a membrane switch, for example, which you'd never use to switch wall power.

This does mean that a little bit of the device is usually on, at least enough to power the microcontroller. However, modern microcontrollers can take such tiny amounts of power when doing nothing but waiting for a switch signal that this power is irrelevant in most cases.

In some cases, the button actually causes the micro to get powered up when pressed, which then turns on some transistors or a relay or something to keep the power on. When you press the button to turn the device off, the micro shuts down everything, including itself.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ so that means some smart device other than the intel dual core CPU on the mother board is waiting for the power button to be pressed? I just find these type of switches to be rather intriguing. \$\endgroup\$
    – quantum231
    Commented Apr 7, 2013 at 21:59
  • 1
    \$\begingroup\$ @quantum: The main CPU probably gets the power button as input when it is running. That allows it to shut down gracefully. The button signal also goes to the power supply, which has a little bit of itself powered up to receive the button signal, then power itself up the rest of the way and start the main processor. \$\endgroup\$ Commented Apr 7, 2013 at 22:04
7
\$\begingroup\$

In simple devices you might have a microcontroller in low-power mode which wakes up (generating the enable signals for other devices) when the button is pressed, then goes back to sleep when the button is pressed again. This after considering debouncing, the fact that the user might press the button many times in a row etc...

When you already have a power management framework (as in laptops) it's easy to integrate those features. Besides, there are integrated circuits (like the LTC2950) that can handle power buttons (e.g. debouncing, handling quick successive pushes etc...).

\$\endgroup\$
1
  • \$\begingroup\$ Man, you learn this stuff, it still seems a bit mystifying for a couple years, then you jump on here and someone makes it completely obvious. Many thanks! \$\endgroup\$
    – E.HP.S
    Commented Sep 5, 2023 at 13:40

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