Maker Pro
Maker Pro

Using pnp and npn transistor as 1 pole 2 throws switch

Hi!

So I'm doing a small project it is a 4 bits DAC with a R-2R resistor ladder, what I have to do is to control the 4 outputs from the resistor ladder with 4 electronic switchs which are controlled by a microcontroller.

Each switch must have 2 throws, one must be connected to ground, the other throw must be connected to a sum node, and it must have 1 pole so only one throw can be connected at the time.

I'm using a bc327 bjt pnp transistor and a bc547 bjt npn transistor, both of them have its base connected to the same microcontroller bit output, the μC 4 bit sequence its a simple counter (0 to 15), the idea is simple: 4 outputs of the μC will be connected to 4 pairs of pnp and npn transistor.

What I 've done is that when the μC sets a 0 on one output, its respective pnp will be close and its respective npn will be open, also when the μC sets a 1 (5V) on the same output, its respective pnp will be open and its respective npn will be close.

I checked the logic with a pair of transistors, a pair of 100kΩ Rb for both bases , a LED and a 330Ω Re (for the pnp) and another led and 330Ω Rc (for the npn).

So its almost working, I mean that when the μC sets a 0 on the bit output, the led from the pnp transistor is on and the led from the npn transistor is off. When the μC sets a 1 on the bit output, the led from the pnp transistor is weakly on and the led from the npn is completely on.

What it means is that the pnp is not completely open when I put a 5V on its base, I'm supplying the leds with a 6V battery and the idea it's ok for a simple on-off leds, but it's a big problem since the R-2R ladder works currents smaller than 0.5 mA.

Is there a way to make a pnp operate as a completely open switch?

84sove.png
 
Last edited:
It's because you have 6 Volts for your power supply and the PIC is running, I hope from 5 Volts. When the PIC pin goes to 1, there is not enough voltage to turn the transistor fully off.
Thanks
Adam
 
It's because you have 6 Volts for your power supply and the PIC is running, I hope from 5 Volts. When the PIC pin goes to 1, there is not enough voltage to turn the transistor fully off.
Thanks
Adam

Thanks Adam for answering!, how much voltage do I need to turn the transistor fully off? is it depends on the power supply voltage or just the type of transistor?
 
You need to match the supply voltage ideally. So running from 5 volts will work. If you need a higher voltage for the load then you will have to add some more transistors that are running from the same supply as the PIC so they can switch the transistor connected to the higher voltage.
Thanks
Adam
 
That's a good idea Colin. You may have to change the resistor value to change the brightness of the LED because this circuit will draw a few mAs less than the original design. But it may not be an issue.
Adam
 

Harald Kapp

Moderator
Moderator
Putting the LED into the emitter leg of Q2 will drop additional voltage across the LED which in turn reduces the effective voltage at Q2's emitter. Therefore now the 5V from the PIC a re sufficient to turn Q2 off.
 
Top