What have I done wrong?

I know the resistors in my schematic should be different values, but why, and where?

Right now I have the following results.

If I hook up voltage to the V-in and then a load to the output I will get power to the load. I do NOT have anything connected to the Arduino input.

If I ground the Arduino input, nothing changes.

I have not applied any voltage to the Arduino input to see if it opens the circuit but, as far as I know, it shouldn't.

My components are 2N3904 NPN transistor and IRF9540N P-channel mosfet.

Any help is appreciated.

You have Q2 upside down.

JohnLincoln:
You have the source and drain of the P-channel MOSFET transposed. With the FET in this orientation, the internal protection diode will conduct and supply power to your load.

Thanks.

I'm pretty sure that means my prototype boards are toast. ~LOL~
I hooked the board up switching the +in and +out and there was a lot less power going through but too much to make it work. I'm sure a higher resistance resistor would minimize that but it's still not good.

I will breadboard a circuit with the mosfet legs swapped and see what happens.

Thanks again.

OK, I switched the legs on the Mosfet and the results are as follows.

I get a small amount of power coming from the V-out without a signal on the arduino pin.
When I apply any power to the arduino pin I get (close to) full power through V-out.
I can trigger the mosfet with continuity from my body so even a 1MΏ resistor on the Arduino pin should trigger this thing.

So, now I need to think about the resistor values.

  1. to keep the circuit open when the arduino isn't sending a signal
  2. to keep the Arduino from triggering the mosfet with a random noise signal.

I plan on having pull down resistors on the Arduino pin but I still need to worry about the accidental signal trigger.

OK, I'm frustrated...

I switched the mosfet lugs, as suggested, and the results are above.

Then I checked, and without a signal to "turn on" the mosfet, it was getting plenty warm (I'm only uising a 9V battery for power or it would have released magic smoke).

Here's the original breadboard setup.

Try this:

2014-11-09_13-51-47.jpg

Hi in that diagram, you have the gate pin right, the centre pin is the drain, in Pch the drain is to negative or ground via load, and the right pin is source and it goes to positive supply.

To test, remove Q1, Q2 should now be turned off no load current flowing.
Use a DMM, with power removed to check if you have diode condition from drain to source, Drain should be anode, do this with mosfet in circuit but Q2 removed.

Tom..... :slight_smile:

PS, if still no joy, with no input connection, but power applied, measure the volts at the three terminals of the mosfet with respsect to power supply negative.

I will try the suggestions.

First I have a question on the basic function of the Pmos.

With absolutely nothing else attached, should there be current flow through the source and drain?

I connected +9 to the source and get it back out of the drain.
I connected +9 to the drain and get it back out of the source.

That's just the Pmos. Nothing else.

Is this correct?

You might have enough leakage to be causing your problems or a bad transistor.
The cct. I attached will set things in a off condition with power is applied.

LarryD:
You might have enough leakage to be causing your problems or a bad transistor.
The cct. I attached will set things in a off condition with power is applied.

I will give your schematic a try.

I have three different (same model) Pmos on three different breadboards. All act the same way.

Thanks.

An easy test to check if the mosfet is functional is to just connect the gate to +12V to turn it off (Vout=0).
Then connect the gate to GND to turn it on (Vout=12V).

If functional, then a circuit like your initial one should work.
Make sure the ground for the 12V supply is connected to the Arduino ground.

OK, I used Larry's schematic and had to modify it. In the attached picture I show where I modded Larry's design.

I now have a working breadboard circuit with one minor issue. The resistor, as noted, gets pretty hot pretty quick. It's possible that the resistor is getting hot because I'm not triggering it with an actual Arduino. I will get to the Arduino test next.

But, is there a possibility that it's getting hot for some other reason? It's not actually part of the Arduino input part so it makes me wonder.

Thanks for the help.

I'm not able to comment on the circuit as a whole, but it should be a simple thing to calculate the current through the resistor in question? Then P=I^2 R gives you the power it needs to dissipate, and it might just be that you need to bump up from (say) 1/4W to 1/2W resistor?

Do you have a common ground between the Arduino and the external power supply?
You can try to go from 1k to 2.2k. Therefore less power.

Try to learn how to draw a schematic.

LarryD:
Do you have a common ground between the Arduino and the external power supply?
You can try to go from 1k to 2.2k. Therefore less power.

Try to learn how to draw a schematic.

Yes, I have a common ground. I can try a few options on the resistor.
It would be REALLY nice if I could read the math that goes along with it but those brain cells probably got tired chasing tail.

A schematic? I have a schematic...

Looked over your fritzing diagram and the connections look OK. The resistor getting hot means that the IRF9540N PMOS transistor is turned on (even with nothing connected to the "ard" terminal). It's turned on because this terminal is "floating" and will act as an antennae, picking up stray signals, oscillating the 2N3904 and switching on the PMOS transistor.

In your diagram, there is an X'ed out 10K resistor. If the one end that's connected to +5V was connected to GND instead, then this would solve the floating problem. Now the base of the 2N3904 will be pulled to GND, keeping it turned off. Also, the gate of the PMOS will now be pulled to 12V by the 1K "THIS RESISTOR". The PMOS will now be turned off and "THIS RESISTOR" will cool down.

To manually test, connect a jumper from "ard" to +5V and the PMOS will turn on, "THIS RESISTOR" will warm up. Remove the jumper from +5 and it will turn off.

If you replace both 1K resistors with anything from 2.2K to 3.3K the PMOS resistor will be much cooler and the 2N3904's base resistor will require a bit less current for control.

...good luck.

EDIT: Ahh, I see there's now a diagram, looks good, same suggestion - add 10K pulldown resistor from the base to GND.

dlloyd:
Looked over your fritzing diagram and the connections look OK. The resistor getting hot means that the IRF9540N PMOS transistor is turned on (even with nothing connected to the "ard" terminal). It's turned on because this terminal is "floating" and will act as an antennae, picking up stray signals, oscillating the 2N3904 and switching on the PMOS transistor.

In your diagram, there is an X'ed out 10K resistor. If the one end that's connected to +5V was connected to GND instead, then this would solve the floating problem. Now the base of the 2N3904 will be pulled to GND, keeping it turned off. Also, the gate of the PMOS will now be pulled to 12V by the 1K "THIS RESISTOR". The PMOS will now be turned off and "THIS RESISTOR" will cool down.

To manually test, connect a jumper from "ard" to +5V and the PMOS will turn on, "THIS RESISTOR" will warm up. Remove the jumper from +5 and it will turn off.

If you replace both 1K resistors with anything from 2.2K to 3.3K the PMOS resistor will be much cooler and the 2N3904's base resistor will require a bit less current for control.

...good luck.

Thanks for the help.
THe resistor only heats up when the arduino pin is given power (turning it on). Then it cools back down
I seem to have a problem anytime I hook a pulldown to the NPN transistor but I can play with that now that I have a "working" model.

In playing around I changed "this resistor" to 10K 1/2w (only because I had it sitting next to me) and it didn't get hot. This floats along with the other two suggestions above. The circuit still functions as it did before i swapped the resistor.

I will try a different version of the pulldown resistor connected to the NPN to see if that helps, hinders, or makes no difference.

Thanks again, all, for your help.

Diagram with suggested pulldown resistor: (SEE REPLY#20 FOR CORRECTED Q1 SYMBOL)

dlloyd:
Diagram with suggested pulldown resistor:

Thanks. That's just what I had in mind.

Thank you JohnLincoln for the correction!