1
\$\begingroup\$

enter image description here Hello everyone,

I have the above circuit connected to my computer. The Pro Micro is running the following program (code HERE):

  1. Check if computer is on or off by verifying if the motherboard LED+ pin is HIGH or LOW, respectively (pin 5)

  2. If the computer is off, check the input from the fingerprint sensor;

  3. If the fingerprint is valid, turn on the computer by setting pin 4 HIGH which in turn switches the transistor and then sets it LOW after a small delay -- mimics a power button press.

As long as the Pro Micro is powered, the setup works with no issues. But when I unplug the Pro Micro, the computer shuts down and I don't understand why. And it's not momentary like a button press. It's like the transistor is on fully, resulting in a long button press.

Can anyone help me understand why this is happening when unplugging the Pro Micro?

\$\endgroup\$
  • \$\begingroup\$ TStef can you try removing the MOBO LED+/Pin5 connection and then powering down your Arduino? If the PC no longer shuts down, I can explain what's happening. \$\endgroup\$ – Vince Patron Aug 4 '17 at 20:30
  • \$\begingroup\$ I'll give it a try right now. \$\endgroup\$ – TStef Aug 4 '17 at 20:31
  • \$\begingroup\$ You better start explaining, mister :D Yeah, it no longer shuts down if I do what you suggested. \$\endgroup\$ – TStef Aug 4 '17 at 20:35
1
\$\begingroup\$

The computer turns off because the end R1 is then floating, and thus the base of your transistor is floating. I suggest pulling pin 4 HIGH with a resistor

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ So another 1k resistor pulled to GND should eliminate this behaviour? \$\endgroup\$ – TStef Aug 4 '17 at 20:29
  • \$\begingroup\$ @TStef -- a big resistor. Maybe 10k (and I've only glanced at this and looking more specifically, I think you need to tie it HIGH. \$\endgroup\$ – Scott Seidman Aug 4 '17 at 20:30
  • \$\begingroup\$ The GND label on pin 4 is very misleading. \$\endgroup\$ – Scott Seidman Aug 4 '17 at 20:31
  • \$\begingroup\$ Oh yeah, I'm sorry, I just realized that I messed up the schematic. 4 and 5 should be the lower ones. I'll reupload the schematic. Thanks. \$\endgroup\$ – TStef Aug 4 '17 at 20:37
0
\$\begingroup\$

From your comment, it sounds like the Arduino is still on even if you're removed power from it. You can confirm it by measuring VCC and also Pin 4 output. How can this be?

That's because the input of most CMOS ICs look like this:

schematic

simulate this circuit – Schematic created using CircuitLab

Inside the Arduino and nearly all CMOS ICs, it has diodes on the IO pins as shown above. These diodes do nothing in normal operation, but if the pin gets hit with a static zap (ESD, electrostatic discharge), they dump the energy into GND if it was a negative polarity, or into the power rail if it was a positive polarity. The power rail typically has big capacitors that can absorb this energy and prevent the gates of the internal MOSFET transistors from getting damaged.

So your problem is that the LED signal still has a high voltage when you remove Arduino power. This causes the Arduino to be powered from the LED signal of the PC!

There's a few ways to isolate this. The cheapest cheesiest way is to use a large value resistor, like 10k in series and maybe 100k pull down. This way, even if LED is at 5V, the current through the 10k is so tiny that the Arduino does not power on.

Another (better way) is to have the LED drive an NPN transistor, and then the Arduino senses the collector side just like the way you have Q1 and R1 in your circuit, but facing towards Arduino. I can draw a schematic but I'm sure you get it. Hope that helps, -Vince

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I think I understand. And what would the emitter of this NPN be connected to? \$\endgroup\$ – TStef Aug 5 '17 at 17:52
  • \$\begingroup\$ To use an NPN for isolation when you power down the Arduino, you have the LED pin drive the base of the NPN transistor through say a 10k resistor. The NPN emitter connects to GND. Then the collector goes to your Arduino digital input that you will use to check for LED state. You will need a pullup resistor from collector to your Arduino 5V supply. Resistor can be from 10k to 100k; value is not critical. But the logic is backwards. You will read logic 0 when LED is on. You understand it or should I draw a schematic? \$\endgroup\$ – Vince Patron Aug 6 '17 at 1:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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