Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because you need to act like a switch.


> void setup(){ pinMode(PWRBTN, INPUT); }

> void press(){ digitalWrite(PWRBTN, HIGH); delay(33); digitalWrite(PWRBTN, LOW); delay(33); digitalWrite(PWRBTN, HIGH); }

My 5min hack would look like this - and optionally a 0.1uF and a 1k resistor for peace of mind - totally untested though. Usually a uC I/O pin has three states; output high, output low and Hi-Z. Hi-Z is high-impedance or extremely high resistance state, analogous to an open circuit.


Right, just toggling a GPIO. From what I can tell, there is some claim of 5V 500mA for a short period when doing this, which would explain the transistor.


I mean, you can use a GPIO on a microcontroller as a switch if the current is small enough... this device is not directly in the path of 120V, it's just twiddling a GPIO on the motherboard... right?




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: