I got stuck with a legacy board that used relays to switch between 2 analog inputs. Sometimes the relays got stuck and provided a false reading. In my search for a quick solution I came across multiplexers. These allow you to switch between inputs using an output from your microchip. The bog standard multiplexers are the 4051, 4052 and 4053 series. Download the multiplexer datasheets here.
- 4051 – Uses up to 3 outputs to switch 8 inputs to 1 channel
- 4052 – Uses up to 2 outputs to switch 4 input pairs to 2 channels
- 4053 – Uses 1 output to switch 2 input triplets
Some things I found out using the 4052:
- Pull inhibit, Vss and Vee to ground, not through resistors but direct to gnd
- Pull Vdd high
- Pull the unused input pins high or low as require.
- There is internal resistance in the multiplexer that can affect sensitive analog signals
- The internal resistance can change with the temperature of the chip (I’d love more info on this if anyone wants to contact me)
Shown is the small strip / vero board I built to solve my switching problem. There’s a voltage divider in the middle to pull a pin high / low with 10k to ground and 1k to the microchip output. So in this case I only needed one microchip output to switch between 2 analog inputs and get rid of the dodgy relays.