Power LED from PC showed on the Blynk app

Hello!

So I have made a circuit that can turn my PC on and off from the Blynk app (with the push Button widget). I have used a relay to do that and a ESP8266 (NodeMCU). Now I would also like to read the state of my PC by connecting the power LED pins from my motherboard to the micro-controller. But I don’t know how to setup the widget and how to code the thing. Would I need a resistor to limit the current going to the controller? Please help!

No need for a resistor but you have to be careful about the actual voltage level the LED receives. You also need a shared ground with the PC.
A much easier way may be to tap into one of the USB ports of the PC. As you use a relay it sounds like you switch the mains power to the PC so the USB is guaranteed not powered when the PC is off, and powered when it’s on.

USB has a lot of protection built in. Wiring your PC mobo directly to a controller board does not.

If you splice an opto-isolator to your power led leads on one side and your controller to the other, it would be protected.

I use a relay to connect the actual power LED pins from my motherboard. In an other forum someone suggested using a LED and connecting a LDR on top of it, with heat shrink around it to make it dark.

Do you know what voltage the motherboard is giving to the LED? I don't need to see the actual LED while I am sitting in front of the PC, since I can literately see when it is on or off. If you know what voltage the PC is putting out from the motherboard pins and you know if the LDR can connect to the NodeMCU (3.3v board right?), please tell me witch LED and LDR from here: https://www.banggood.com/search/led-diode.html https://www.banggood.com/search/ldr.html I need!

Thanks!

feikescholtens:
I use a relay to connect the actual power LED pins from my motherboard. In an other forum someone suggested using a LED and connecting a LDR on top of it, with heat shrink around it to make it dark.

That’s a slow DIY opto-isolator. LDR is very slow like 10ms response, phototransistor is more than 100x faster.

Opto-isolator chips come in single-channel (4 pins), dual channel, and quad channel that I have bought before.
Look them up.

Do you know what voltage the motherboard is giving to the LED? I don’t need to see the actual LED while I am sitting in front of the PC, since I can literately see when it is on or off.

I have a meter, I can measure the voltage. Using an opto I would put a resistor in series to limit the led current to 5mA at most.

If you know what voltage the PC is putting out from the motherboard pins and you know if the LDR can connect to the NodeMCU (3.3v board right?), please tell me witch LED and LDR from here: https://www.banggood.com/search/led-diode.html ldr - Buy ldr with free shipping | Banggood.com I need!

Thanks!

You don’t want an LDR and especially a relay!. Look on ebay for phototransistor, also for opto-isolator.

Hi,

Can you look up a good quad channel phototransistor and optoisolator? I am pretty new to this stuff you know. And how can I connect the wires to the chips? Jumper wires and breadboard?

If you get the opto in DIP form (Dual Inline Package – pins in line on both sides of the chip, 2.54mm/0.1" center to center) then it will fit a breadboard and sockets with same spacing holes (not all breadboards are 10 holes per inch but that is standard socket).

I googled quad opto isolator and get many hits, here is one 16 pin 4-channel from the top for 69 cents:

http://www.jameco.com/z/LTV-847-Lite-On-Electronics-Optocoupler-DC-Input-4-Channel-Trans-DC-Output-16-Pin-PDIP_878286.html?CID=GOOG&gclid=CjwKCAjwmK3OBRBKEiwAOL6t1LEfNaQUK-ThCZc5SzEoofXzAfIIVN0vyIZMzcW02RGp5bpsnkOmyBoCZRoQAvD_BwE

Where it says voltage: 5000V <— that the protection, it takes 5000V to breach the gap. Some optos are good to 10000V or more.

These are for signal current only, about the same as Arduino pins. Best not to feed the input >25mA nor let the output conduct >25mA. Those are 1/2 the maximum which cannot be maintained more than short time. This means that you may need two resistors per channel at most depending on what voltages you are using. If the output connects an Arduino pin set to INPUT mode to 5V (so the pin reads ON when the opto input is HIGH) then no resistor on the output side is needed.

To go from signal level to power level, use the signal to control a transistor and yes, another thing to learn… or find existing circuit or howto.

The datasheet will have the pinout for the chip, it is pretty simple.

I’m not set up for making drawings here nor am I an electronics engineer. WVMARLE knows these things better than I.