4
\$\begingroup\$

I've got an Atmel ATmega328P and I'm trying to run two thermistors into one analog pin (TEMP_M5), using a digital pin to select which thermistor is active (TEMP_SEL_M5). I thought the circuit below would let me do that, but I've breadboarded it and while the right-half of the circuit seems to work when TEMP_SEL_M5 is pulled to ground, whenever TEMP_SEL_M5 is pulled high, the voltage at TEMP_M5 is 0 V.

Description of the circuit:

  • The lower half is the bottom half of a voltage divider.
  • TEMP_M5 is an analog pin.
  • TEMP_SEL_M5 is the digital selector pin.

My theory was that pull-down R27 would pull Q3's gate low, so Q3 would enabling TH_M5 to form the upper part of the voltage divider, while also pulling Q4's gate low, keeping thermistor Q4 inactive.

Can anyone point me in the right direction please? Or might I have an error on my breadboard (or both!).

Circuit to switch between two thermistors

\$\endgroup\$
2
\$\begingroup\$

As an alternative to @Chapacabras perfectly reasonable solution, if you don't have any PMOS devices, you can simply invert the topology of the circuit presented in that answer in order to still be able to use NMOS devices.

The following topology should work as it allows the source of the NMOS to be connected to ground in order to allow your control signal to create a high enough Vgs to turn them fully on:

schematic

simulate this circuit – Schematic created using CircuitLab

(p.s. Circuit lab doesn't appear to have thermistors, so it is the wrong symbol, I know)

You can connect the two inputs using the resistor-transistor inverter that you show in your schematic. If I get a chance later I'll add it in to the schematic.

The downside to this is it inverts the behaviour of the output - a higher voltage now represents the opposite temperature change from the original circuit.

\$\endgroup\$
  • \$\begingroup\$ This is great as it helps my understanding and only uses one type of component. Thanks! \$\endgroup\$ – dannydc Aug 12 '16 at 10:17
6
\$\begingroup\$

Try this: enter image description here

Use 2 P-MOSFETs and 1 N-MOSFET.

Problem with your circuit is that when you switch one MOSFET on, than voltage at source pin rises, so it cannot be fully open. That's why I chose P-MOSFET and connected source pin to 5V rail. So voltage at source never changes.

\$\endgroup\$
4
\$\begingroup\$

Maybe you should consider completely different directions too:

a. Use two digital I/O ports to connect the tops of the NTCs to + or High-Z to switch them on and off.

b. Use integrated analog switches/multiplexers. (like CD4066, CD4051)

\$\endgroup\$
  • \$\begingroup\$ Thanks for thinking outside the box! I don't have the spare pins, but do have some CD4051 chips lying around that I could try. \$\endgroup\$ – dannydc Aug 12 '16 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.