I have a computer in a different room from my monitors and got tired of having to walk into the other room every morning to turn on my PC since Wake on LAN is a lie apparently.
I found a neat solution from someone who had the same thought using an ESP8266 along with a couple of opto-couplers and resistors. The resistors pull the signal low by default, and two pins are used from the ESP8266 to trigger a power or reset. All is fine.
The issue is that it is also set up to detect power from the power LED on the front panel. There's no optocoupler on this one, just 5v going straight into my ESP8266, not the best choice, but the really weird thing is that the Power LED is ALWAYS on like this.
As soon as I connect my ground bam! the Power LED lights up. The design of the circuit is pretty straight forward. The ESP8266 sits between the frontpanel and the motherboard. When the computer is turned on, it should send 5V on the LED+ from the mainboard which the esp8266 detects, but instead I'm getting constant power.
Any ideas what could be causing this? Here's the pcb layout.
Given the ESP8266 is a 3V device and appears to not be 5V compatible, this would be my starting point. Have you measured the voltage on the LED when it is off and when it is on. The voltage between each LED pin and the ground plane are the important measurements. The voltage drop of the LED is less important.
For control of external devices like an LED, the supply voltage (+) is frequently uncontrolled constant and the sink (-) pin is controlled via a MOSFET. So, the ESP8266 input pin would need to be connected to the other LED pin.
Including some resistors between the LED and the ESP pin would be appropriate to protect both devices. If the LED has 5 Volts, then a resistor voltage divider will be required for the safety of the ESP device. A current limiting resistor between the LED pin and ESP pin is worth considering as well.
Always post the schematic first, not a PCB or breadboard layout. If no error can be found in the schematic, then you can post the PCB or breadboard layout for the forum to check.
If you don't have a schematic, and you created the PCB layout without one...
then you probably didn't build a prototype or test it either. If you try to run before you can walk, you fall to flat on your face.
ohhh, okay yeah, that would make a lot of sense for why it's behaving the way it is. As soon as I connect my ground I'm giving it a path for the led to turn on. This would also explain why when I connected it to an external 5v wall wart the LED becomes very dim, but still on. It no longer has a common ground and it's in a floating state.
I'll connect up my multi-meter and give it a quick test here, but just quickly spitballing a possible solution if I cut the connection between the LED ground and the ESP ground on the board and then use a pin with an internal pullup, I could connect that pin to the LED ground and sense when the input goes low.
Then I would just need to make sure that the ESP is externally connected to the pc's ground to make sure it has a common ground reference, something I'm already doing since I connect it's 5v and ground to an empty USB 2_0 header.
Though I think I'd be better off long term using another optocoupler in line with the LED's power instead of using this branching power detection line that is currently employed.
Ok, thanks for that. I can't see a problem with the schematic, other than the one that has already been mentioned: that a 5V signal is connected directly to a 3.3V input pin.
If I remember, the wires from the front panel in the cases I have used are marked PWR+ and PWR-. Not PWR and GND. So the motherboard is free to switch the led on high side or low side.
Perhaps if the power led is switched on the high side, then when the power led is off, the ESP input is floating. Try connecting an external pull-down to the pin, e.g. 10K.
Perhaps if the power led is switched on the low side, the power led + is connected to a permanent 5V supply and it is the power led - that switches the led on and off. Try connecting that to the Arduino pin, and use the internal pull-up on the ESP pin.
I guess the way that the power led is switched on/off can vary between different motherboards. Another opto-isolator would allow it to work for almost any motherboard.
yeah the guy who made this talked about vaguely hearing that power detection straight off the power led was a bad idea, but couldn't remember why and just made it like this anyways. But that's fine, I didn't like it going straight into my input pin anyways and this design was a good proof of concept to see if it would work in general before I refined it a bit.