Before all, a PNP transistor with its emitter at +12V requires +12V at its base in off state - but the Arduino pins only source 5V! Add another NPN to drive the base of the PNP, with a resistor from collector to +12V.
Then do what I posted in #12, and the ghosts will go away. Swap the lines that turn off and on the transistors in the wrong order.
Try adding a 330 ohm resistor from the base of each
PN2907 to +5V.
The output of the arduino may not completely reach
5V. There will be some drop.
Tinker Dwight
I have snipped the wires on my pin 9 and 10 I/O and wired them to a breadboard.
On pin 10 I have an LED happily flashing.
On pin 9, I have wired up the transistor as shown in the sparkfun tutorial here:
I have tried both ways with fresh transistors can could not get a pulse. Tried a 10k, 1k and 10ohm base resistor as well!
I nhave dumped the transistors for now and ordered a different type to see if they work.
I seem to be able to ditch them anyway as I have just measure the draw on each common anode and it is 15mA...well within the I/O draw spec anyway!
That schematic is incorrect.
The transistor will still be on with the input at 5V because
5V is less than 12V.
The base lead has to go to 12V to turn the transistor off.
Where did that motor schematic come from?
What garbage.
Dwight
Sorry, should have mentioned I am all at 5V. No 12V source.
I meant I followed the "wiring".
Edit: and GND tied.
The thing also works with using the I/O pins directly to power the segments. Thin I will stick with this and leave it running for a few days to ensure it doesn't die.
Why not use the 330 ohm resistors as I suggested.
Yes, I realize you were using a 5V and not 12V, only how
stupid the drawing was that you found. Obviously the
person that created it never actually used it.
With the pins directly driving the the display you are
attempting to drive about 200ma when the display is
all 8888. This is not a good thing for your chip,
Fix it right and not a hack. I doubt you are getting more than 40ma
or so. It is still over stressing the part more than it is intended.
Dwight
Sorry, I keep giving Kama because this is all helpful. My electronics (even after reading about 4 hours on transistors) is still shakey as!
So which is the option I "want"?
Are these remotely a correct way to not kill my MUC?
Neither is right.
the emitter goes to 5V
the collector to the displays.
I added the 330 ohm to ensure that the transistor turns off.
If you are connecting the collector of the PNP to 5 volts that is wrong.
Also, the drawing that Larry posted shows FETs. These don't work the same
as transistors and are not direct replacements.
Look at Q6 and add the 330 ohm resistor as I stated.
It is just there to make up for some voltage drops you seem to have.
I should note that the first drawing would likely smoke the transistors.
Dwight
I should note that the first drawing would likely smoke the transistors.
Well not quite. When you swap over the emitter and collector of a transistor, what happens is that it still works but at a very much reduced gain. This is because the basic structure is a PNP three layer doped crystal. With the N part being the base and the P parts being the collector and emitter. So electrically the emitter and collector are the same, however the geometry of the transistors pattern leads to a much better gain one way round or the other.
The right hand drawing of those two is close. I would just swap over the emitter and collector and make the 330R resistor more like 10K.
Do note that the collector base voltage would still
want to be about .65 V
The NPN transistor would most likely be saturated
at about .4 volts someplace.
5V - .65 - .4 = 3.95V
Where would you expect that 3.95 volts to go?
There is no resistor between the collector of the
NPN and base lead of the PNP transistor.
I still predict smoke!
Dwight
That would work but why add the extra transistor?
Isn't the MCU's output 0-5V or is it one of those 0-3.6V chips.
If it is a 0-3.6V this circuit should work fine. It will work
fine on a 0-5V output as well but is overkill.
It is still a good idea to put something like a 1K across the PNPs
base to emitter.
It will speed up the turnoff time.
Dwight
Hi Mike
Why 10K. That only gives a tiny voltage
margin.
I agree 330 might be a little too much.
Maybe 1K might be better.
Assuming that the transistor is essentially off at .4V,
with a 1K it is .8V of margin, with only about
15% loss of drive.
Dwight
?
For turning the transistor on it gives a large voltage swing on the base. Without any resistor the transistor is subject to being turned on by interference.