Turn on laptop / push button once - Page 1
Forum section: electronics / beginners

author: pengu
author_rank: Newbie
timestamp: November 01, 2017, 03:37:08 am
content: Hey, I want to build a circuit that can turn an old laptop on once there is power, the laptop does not have an option in bios and it does not support WOL.I've opened up the laptop and there's a tactile switch button that needs to be shorted and the circuit opened for it to turn on. I can't push it more than once otherwise the laptop will turn off.There is a blue LED next to the button that is turned on after the button is pressed and released. There's also a 19v dc in near by I could get power from.I don't know a lot about electronics so I'm not sure where to start, I either want to simulate a short on the button once ever and realsed once power is applied, or ideally simulate a click when the power LED is off.Any help would be appreciated, thanks!

author: Ian.M
author_rank: Super Contributor
timestamp: November 01, 2017, 07:13:03 am
content: You'd start by checking if either side of the button goes to a supply rail or to ground (local 0V not Earth), and which side of the LED has the biggest voltage change between off and on.A further complication is whether or not the LED flashes in standby - if so your circuit needs to detect that and treat it as LED on. Another issue is battery state - assuming the battery is still functional - It is extremely undesirable to force a power-up if the battery doesn't have enough charge for an orderly startup and shutdown.Then you must consider the space available for your circuit and how you can mount it without blocking ventilation and possibly causing other parts to overheat. Depending on the space available, it may be extremely challenging even for an expert in SMD circuit design and assembly, or if there's lots of space it may be easy for any novice J. Random Hacker to assemble something to fit 'dead bug' style or even on protoboard.The timing and sequencing required would push most of us towards a small MCU of some sort, + a micro-power regulator to power it and various circuits to interface between the MCU's logic level I/O pins and the signals in the laptop. Do you have any experience with the Arduino platform or any other type of MCU? If not, although its possible to do this sort of stuff without programming, it typically requires a significantly more complex circuit, which will be much harder to design and test, and the capacitors required for longer RC delays (e.g. to handle the blinking standby LED problem) or to delay powerup till the DC in has been stable for tens of seconds. are likely to be physically larger than one would prefer for a limited space design.

author: newbrain
author_rank: Super Contributor
timestamp: November 01, 2017, 02:40:55 pm
content: Quote from: Ian.M on November 01, 2017, 07:13:03 amWell, if the pushbutton closes a circuit with GND, maybe it's much easier.Just use a monostable with an open collector or open drain output (in parallel to the switch), fed and triggered by the presence of the 19V (via a regulator, if needed).After all, if I understood the OP correctly, they just just want to turn on the laptop when power comes back.The LED is a red herring, as it would appear to be on only after the laptop is on.A simple circuit with a couple of BJT or MOSFETs, and a handful of passives, should be just fine.

author: Ian.M
author_rank: Super Contributor
timestamp: November 01, 2017, 04:29:46 pm
content: It gets a lot more complicated than that. If the LED is off, and 19V_in is present it needs to pulse the button once X seconds after 19V_IN goes high.If you don't stick a longish delay in there it will try to turn on when power briefly reappears, which happens a lot if the utility linemen are trying to clear multiple faults, or the reason for the failure was a local open circuit.Its that handful of passives that's the problem. For any laptop worth resurrecting, at best there's physical space for a thimbleful!

author: pengu
author_rank: Newbie
timestamp: November 01, 2017, 08:40:58 pm
content: I don't care about the size of the device or circuit, I could go the arduino or esp8266 route no problem. Especially if it'll be the easiest for me, I've got the programming experience but very little electronics experience. I'd prefer less overhead with a simple circuit but I'll be alright without one. I can power the device externally and then when the power is out to the laptop and device and the laptop is still running off batteries it can shut itself down.

author: newbrain
author_rank: Super Contributor
timestamp: November 01, 2017, 09:54:20 pm
content: Quote from: Ian.M on November 01, 2017, 04:29:46 pmEh, that'd be a nice implementation, but none of the motherboard BIOS I have around (a couple of NUCs and two Gigabyte) does that: there's no perceptible delay between the AC coming back and the PC starting up.I'm usually more for digital/MCU but this time it might really be overkill...I would try something like this:Of course, an MCU based solution is more flexible and would allow for more advanced functionality.Quote from: pengu on November 01, 2017, 08:40:58 pmBoth ESP8266 and Arduino are really too much, but a small ATtiny would fit the purpose quite well: see alsothis threadwhere a similar problem is solved, and Ian proposed a very smart fully analogue solution!

author: Ian.M
author_rank: Super Contributor
timestamp: November 01, 2017, 11:04:01 pm
content: Quote from: newbrain on November 01, 2017, 09:54:20 pmYes. Then you have to resort to stuff like enabling full POST and RAM checks to get enough delay before bootup, or if that's not enough, setting up multiple boot options for the OS (even if you need to add a dummy one) so you can set a delay before the default is chosen).Re your proposed circuit: Add another MOSFET to hold down the gate of the button driver if the LED is on, to avoid the problem of a brief interruption of mains power causing the laptop to shut down when the mains comes back on, and you'd have something minimal, but workable, *IF* one side of the button is already connected to ground.Its interesting to note that the O.P of the thread you just linked to ended up going with a MCU based solution in spite of several possible discrete or logic gate based solutions being offered. Of course once you have a MCU in there, complex sequencing is essentially free, with the only cost being level translation for any extra sensing inputs, and a little development time, but more important, changes to the sequencing only need a few minutes at the keyboard + plugging in an ICSP cable, as opposed to switching on the soldering iron and changing the circuit.@pengu,The next step is for you to investigate the existing button and LED circuit as I asked initially:Quote from: Ian.M on November 01, 2017, 07:13:03 amPost results (with voltages) here.

author: Mr. Scram
author_rank: Super Contributor
timestamp: November 01, 2017, 11:26:41 pm
content: I sounds like you are trying to run a laptop remotely. Are you trying to make one into a server?

author: pengu
author_rank: Newbie
timestamp: November 01, 2017, 11:27:25 pm
content: here's an image of the location of the button, led, and power input:https://imgur.com/a/rze3jthe voltage difference between the button and the led are both 2.8vI'm trying to have the laptop turn on when my car turns on, and it will act as a server

author: Ian.M
author_rank: Super Contributor
timestamp: November 01, 2017, 11:45:43 pm
content: The voltage difference between the LED and the button doesn't tell us anything useful.Measure the voltage each side of the LED, with the laptop on, and again with it off with respect to the laptop chassis (e.g. the shell of a USB port). Do the same with the button. If one side of either consistently reads 0V, (+/-0.1V), then with the laptop off, disconnected from power, and preferably with the battery removed, check for continuity between the 0V point and chassis using a DMM or other low output voltage meter on a low resistance range, (*NOT* an analog multimeter, Megger or other meter that uses a high test voltage).Post the raw results here, carefully identifying each point tested and the laptop's On/Off state at that time. There should be eight voltages, and depending on their values, up to two resistances.

author: newbrain
author_rank: Super Contributor
timestamp: November 02, 2017, 12:21:00 am
content: Quote from: Ian.M on November 01, 2017, 11:04:01 pmI happen to know him very intimately since long time, we usually (but not always) agree.Quote from: pengu on November 01, 2017, 11:27:25 pmAnd so we discover that:Mains does not enter the pictureThere's an available always on power source that can stand a small load (e.g. an MCU)Given the above, a small MCU seems a good idea, one could implement a simple state machine that:Tuns on the laptop when the car is turned onShuts it down when the car is turned offMaybe supports its own button to override the automatism (so the laptop can be tucked away and its button needs not be reachable)In fact, I have designed something very similar with an ATtiny, for a friend who wanted to change his iMac G5 mobo with a NUC one.I attach the code below, if it can be of inspiration, it also understands a flashing LED for sleep mode to disable the iMAC backlighting.The code has been tested on target with a PSoC based rig to simulate all the surrounding HW, but not on the field, as my friend did not go through with his idea...Quote from: pengu on November 01, 2017, 11:27:25 pmThis is not very clear, the real question is whether one side of the button (and of the LED) is connected to ground.If not, we will need something as a small relay, or an analogue switch (CD4066?).Edit:Missing license in the code.

author: Ian.M
author_rank: Super Contributor
timestamp: November 02, 2017, 12:27:31 am
content: +1 to the above.Quote from: newbrain on November 02, 2017, 12:21:00 amI was being stupidI didn't remember or notice the identity of the O.P.Edit: personally, I prefer this licenceCode:/** -------------------------------------------------------------------------* "THE BEER-WARE LICENSE" (Revision 42):* "Ian.M" <https://www.eevblog.com/forum/profile/?u=104739> wrote this file.* As long as you retain this notice you can do whatever you want with this* stuff. If we meet some day, and you think this stuff is worth it, you* can buy me a beer in return. Ian.M* --------------------------------------------------------------------------*/Credits toPoul-Henning Kampfor formalising the Beer-Ware licence.

author: pengu
author_rank: Newbie
timestamp: November 02, 2017, 12:38:11 am
content: the top of the LED is -, bottom +, top of the button is -, bottom +on: ground to led -: -0.02v, +: 0.01voff: ground to led -: -0.09v, +: 2.96von: ground to button -: -0.09v, +: 2.96voff: ground to button -: -0.001v, +: 2.8v

author: Raj
author_rank: Frequent Contributor
timestamp: November 05, 2017, 09:13:39 am
content: Simplest method-Opto isolator also known as optocouplerOr use a relayWhen they are driven by a monostable 555 /mcu, your Job's done

author: Ian.M
author_rank: Super Contributor
timestamp: November 05, 2017, 10:15:08 am
content: The good news is it looks like one side of both the LED and the button goes to Ground. Check continuity to chassis ground from the - side of each as I described earlier. Once you've confirmed the button and LED have one side to chassis ground, Newbrain's circuit from reply 5 should work. To add my refinement from reply 6 that disables the circuit once the LED is on, you'll need to either use a low Vgs threshold MOSFET as the LED only gives you 3V to drive it, or you'll need to use a small signal NPN BJT (e.g 2N2222), collector to the gate, emitter to ground with a 100K series base resistor between it and the LED.