[SOLVED]:
pwillard was kind enough to suggest that my transistor was placed backwards, and it was. If you're using Fritzing, check to make sure that the pinout of the transistor is actually the one you're working with, it may be backwards in the diagram or PCB. Wawa also pointed out that my resistance values aren't exactly the best for driving mosfets. And, that LM317s waste some unnecessary energy to heat.
Hello! I thought I'd come sign up on the Arduino forums to ask for some help with a little annoying problem I'm having:
I'm wondering if anyone can spot any problems in this circuit? I'm having some frustrating problems with the IRF9640 p-channel mosfet not turning off when the NPN 2n2222 transistor is grounded. It won't work on my PCB, but it does on the breadboard, for some reason. I've included pictures of the CD, PCB and Breadboard, with the section in question circled in red- the rest works just fine. I want the IRF9640 to provide power for all of the LM317 regulators on the board when it is switched on by one of the digital pins of the Arduino.
Some background and clarification:
-The circuit is designed to be stacked with others and each drive a 3w RGB LED, so that each board and accompanying LED can be turned on and off with a different Arduino pin. All of them will have the same color PWMed to them via pins 9, 10, and 11, but only one will be on at a time, depending on which Digital pin is high (0-8). It's driven by a good ole UNO.
-The LEDs coming out of the Arduino and into the NPN aren't actually LEDs, they're just the SMD pads meant for easily jumping the desired Arduino pin to the base of the NPN. That way I can make multiples of the same circuit for different pins without editing the CD each time.
-There is a typo in the pictures - IRF9640 is titled IRF9604 on accident; I know this, I just slipped up when labeling things.
If anyone's got any comments or suggestions, please lemme know. If you need any more information or pictures, just ask. Thanks!!
On your PCB, it looks like the 2N2222 is backwards... the Emitter is trying to drive your MOSFET gate pin. I stopped looking after that due to "Fritzing makes my brain hurt". Maybe someone else will find another issue or say I'm wrong.
The 2N7000s won't get enough gate drive with a 1:1 voltage divider.
1k/1k would be ok for a small NPN transistor, but not for a small mosfet.
Remove (short) the "pin to gate" resistor, and change the value of the bleed resistor to ground to 10k.
The analogue path you have choosen is rather wasteful (power/heat).
There are 4- and 6-LED shield with switching CC drivers that do the same without getting hot.
This homegrown PCA9685 board does 16 LED channels, 3-20watt each. With 12-bit PWM.
Max 60 boards with a 2-wire interface.
Leo..
pwillard: You got it. I went and turned that transistor around, and bada-bing, circuit works like it's supposed to. As for Fritzing making your head hurt... I feel you on that one. It's got some nifty perks, but even as an amateur, I find it to be lacking occasionally. My cat is better at routing traces than Fritzing, and it has some nauseating UI problems, such as the scrollbar doing completely random things. Hopefully as time goes on, it will mature into a more robust program.
Wawa: Good call on the resistor values and mosfets, and you're right about the LM317s. They're so hot, you could practically solder with them. I changed the values of the resistors like you recommend, so I'm not bleeding as much voltage to ground for no reason. As for the LM317s, I'm only using em because I got my hands on a couple hundred of the things, and I figure I might as well do something with them and maybe learn a bit in the process. But, if I end up needing to drive LEDs for something more serious, I'll definitely remember your post and use that!