# Transistor Switch giving funny readings

#### Mashly

Joined Apr 4, 2014
33
Hi Guys,

Probably going to be really silly question here.

I am trying to make a transistor switch with a voltage divider to get a output prportionally lower than the input when the base is pulsed.

I am using trying to get no more than 5V when using a 12V source (testing the voltage of a battery using an arduino).

I have chosen R1 as 1K, R2 as 2K and Rb as 4K. It seems to work when I turn the base on (I get around 5V output at 15V input). But when I turn the base off and measure the voltage across the capacitor I am still seeing the 15V input? Why could this be?

Thanks for any help in advance.

Mash

Edit: with a BC108 transistor.

#### djsfantasi

Joined Apr 11, 2010
7,249
Do you have a schematic?

#### Mashly

Joined Apr 4, 2014
33
Don't worry I think I have solved it.

The volt meter is measuring voltage drop, so when the no voltage on the base, the drop between the collector and ground is 15V.

Does this sound correct?

#### Alec_t

Joined Sep 17, 2013
11,814
If your circuit is intended to work as I'm guessing, then I think you'll need a 2-transistor solution; something like this.

Edit:
If transistor leakage current is significant then a respective ~33k resistor between base and emitter of each transistor could be added.

#### Attachments

• 19.9 KB Views: 21

#### Mashly

Joined Apr 4, 2014
33
Sorry if I am being a bit stupid, but could you elaborate on the need for the two transistor circuit?

I am looking to get the voltage of a battery with an Arduino so I can send it using a radio module I have. I will pulse the transistor every minute (or when needed) to get the voltage then send it via the radio link.

#### AnalogKid

Joined Aug 1, 2013
8,828
Alec's schematic looks like what you described. If it isn't, please post your own schematic.

ak

#### Mashly

Joined Apr 4, 2014
33
Hi, this is the way I was thinking of doing it, with just the one transistor. It is not properly set up yet as I am still trying to learn spice, but you should get the idea.

#### Attachments

• 15.4 KB Views: 29

#### Papabravo

Joined Feb 24, 2006
14,879
In your circuit the Vout will be at 12V when the transistor is off. Ohms law requires the voltage drop across a resistor to be 0 when there is no current flowing. It this what you intended? 12V on a digital input would be ahhh...bad bad thing.

#### Alec_t

Joined Sep 17, 2013
11,814
.... which is why one transistor is needed as a level-shifter.

#### Mashly

Joined Apr 4, 2014
33
I think I see what is happening now. The NPN is shorting the base to ground when pulsed which turns the PNP on. There is no voltage present over the voltage divider now when the PNP is turned off.

#### Mashly

Joined Apr 4, 2014
33
Thanks got it working, Your value of 100K was a bit high for the Transistor I was using but replaced it with a 4K and it works fine.

Can anyone tell me if this will be temperature stable or if I can do anything to help with this?

Thanks again.

Mash

#### ScottWang

Joined Aug 23, 2012
6,982
If your circuit is intended to work as I'm guessing, then I think you'll need a 2-transistor solution; something like this.

Edit:
If transistor leakage current is significant then a respective ~33k resistor between base and emitter of each transistor could be added.
The c of Q1 need to pull high, otherwise, when the input(Vpulse) is low, then the c of Q1 will be floating, it maybe has a chance to causing the c of Q2 oscillating.

#### Alec_t

Joined Sep 17, 2013
11,814
Can anyone tell me if this will be temperature stable
Simulation shows it's stable over a -50C to +50C range.

#### ScottWang

Joined Aug 23, 2012
6,982
Simulation shows it's stable over a -50C to +50C range.
You can use it normally until when the oscillation happening and then to take care of it.