Go Down

Topic: interesting problem with transistors(solved) (Read 2927 times) previous topic - next topic

blcodemonkey

Jun 02, 2013, 04:59 pm Last Edit: Jun 04, 2013, 09:41 pm by blcodemonkey Reason: 1
I have a issue with a couple of transistors I have wired as switches. I am using both pnp and npn. Standard 2222a, and 4403. I tried using digitalWrite high and low to the bases; (1.5k resistors in line). The plan was: HIGH closes the junction on the npn and reverse bias the pnp. LOW swaps them.
In reality it does not work. The transistors appear to be cycling.
However, I take the jumper off the digital pin, and connect it straight to 5v or ground, the circuit works perfectly.
I have tried using both the pwm and non pwm pins on my uno, neither seems to work any better. It appears the pin does not truly go low to ground, or high to 5v.
So, does the arduino cycle the pins based on the internal frequency for that pin? I assumed when you  went high on a pin, it was a steady 5v. Is there anything I can do to rectify my problem? One option I did try was another transistor that opens and closes a relay. The relay flops its switch between ground and 5v.(sending clean power to the transistor bases). It works....better...... but I also have an electronic compass on board. The coil may interfere.

pito

#1
Jun 02, 2013, 05:03 pm Last Edit: Jun 02, 2013, 05:05 pm by pito Reason: 1
Show us your schematics, how the transistors are wired?..

Grumpy_Mike

Quote
It appears the pin does not truly go low to ground, or high to 5v.

You sure you have remembered to set them to outputs in the setup function?

blcodemonkey

I will post the schematics. It just occured to me that I may be trying to drive too many transistors off of 1 pin; 4 total. 2 npn, and 2pnp.  I have to digitize my schematics first!  Lol, I still use paper!

blcodemonkey

Here is the schematic. 
The point is to drive 2 servos; either from the arduino, or from an rc reciever. The override pin dictates which signal passes through. Like I said:PNP=4403, NPN=2222A.

pito

#5
Jun 02, 2013, 09:05 pm Last Edit: Jun 02, 2013, 09:32 pm by pito Reason: 1
It seems to me the PNP transistors have to have their emitters and collectors swapped, then the common collector point (to the servo) has to have a pulldown resistor connected (ie 4k7 against the ground)..

Also I would add a 10k resistor from PNPs bases to its emitters (especially the PNPs ones driven by those NPNs need it).

A PNP transistor must have on its emitter always larger voltage than on the base in order to work (measured against ground). The base current flows from emitter into the base and collector current from emitter into the collector with PNPs.

blcodemonkey

About the emitter/ collector part of the scheme; ignore the pic. I seldom use the graphical program, so I really didn't even look at the arrows!  I will look at what else you said, try it out, see if it works. Thanks!

Grumpy_Mike

Quote
ignore the pic. I seldom use the graphical program, so I really didn't even look at the arrows!

So why bother at all. Lets all make things up then should we.

Schematics are more important than words in describing what you are doing. So take a bunch of random words and put them in a post and then wonder why no one answers the question that is in your head.

pwillard

Quote
Schematics are more important than words in describing what you are doing. So take a bunch of random words and put them in a post and then wonder why no one answers the question that is in your head.


AMEN!

I can't stress enough that "this" is our language. (regardless of the one we speak).  It is critical that we discuss things using the carefully constructed common language known as the "electronic schematic".  A the saying "A picture is worth a thousand words" is almost never more true than when electronics is involved.

blcodemonkey

Ok ok! I have never really " shared " my schemes before, when I draw them for myself, I make a "D" with  b, c, e. When I am building from someone elses scheme, I have to look the darn things up. I have been properly chastized, now back on topic. Why does the circuit work when I put +5v or gnd on the override wire, but not when attached to the digital pin? I even watched it with my 'scope. The signal was smooth and clear; either the arduino pwm, or rx pwm. Put it on the digital pin, and I could see the arduino pwm and rx pwm together.
Do I need to split it up between 2 pins? My emitter/collector orientation is correct as built, I have not tried the 4k7 resistor yet on the common collector to gnd.

pito

With a 74HC157 (for example) you can mux 4 servos, no messing with transistors.. An smd SSOP16 or QFN16 package is much smaller than those 6 transistors and all those resistors there..

Grumpy_Mike

Quote
Why does the circuit work when I put +5v or gnd on the override wire, but not when attached to the digital pin?

Well if you posted what you have actually got I might be able to tell you.
You do have the grounds common, Arduion, servo and source of other PWM signal?

blcodemonkey

Yes, I have a common ground for everything!

blcodemonkey

Swap the arrows on the pnp transistors,  that is what I have. Common collector to servo.

Grumpy_Mike

Quote
Swap the arrows on the pnp transistors, 

No idea what that means, I can think of two things it could be.

If you are not going to be considerate enough to to draw what you have then why should any one bother to try and help you?

I am out of here.

Go Up