using thermistors with transistors

Happy sunday everyone..

I want to read the inputs from 2 LM35 thermistors. Unfortunately, i only have 1 analog pin left.

I tried to alternate the readings with my code, using 2 amplifier/transistors, such that it turns on one thermistor, gets the analog reading, then turns off. Then it repeats this cycle for the other thermistor.

Here's the transistor im using.

2N 2222 A338

The problem with this solution is that the readings start to jump all over the place. Does anybody know why? Im open to suggested workarounds, but do not want to rework my entire circuit to make other analog pins available:-)

Are you using any base emitter resistors? When using a BJT as a switch sometimes it helps to ensure you are really driving it into saturation - perhaps you are getting erratic behavior due to the transistor not being fully saturated.

Firstly the LM25 is not a thermistor, its an active semiconductor temperature sensor.

Secondly you need to switch the output pins, not the power to the sensors (the unpowered sensor's output pin will definitely not float, it will probably affect the voltage from the powered sensor or even burn-up).

To switch the analog pin between the two output pins takes an analog multiplexer chip.

Hi all,

Thanks for your help!

I was able to figure out how to fix it… looking at the data sheet it takes 24 microseconds to stabilize. :slight_smile: so i just put in a delay command. It works great! Yay