ExpertSensors & Measurement
Eight-Channel Analog Sensor Scanner
Select one of eight low-voltage analog inputs with an SN74HC4051 and read it using the Pico ADC.
Parts from the database
- SN74HC4051N ร 1Eight-channel analog multiplexer
- Raspberry-Pi-Pico ร 1Select outputs and ADC
Other supplies
- breadboardCommon build supply
- up to eight 10 kฮฉ potentiometers or 0โ3.3 V sensor outputsCommon build supply
- 100 nF bypass capacitorCommon build supply
- jumper wiresCommon build supply
- MicroPython installedCommon build supply
Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.
Connections
- TI DIP-16: VCC pin 16 to 3.3 V, VEE pin 7 and GND pin 8 to ground, enable pin 6 low; bypass pin 16 to ground.
- Common Z pin 3 to Pico ADC0 GP26. Select S0/S1/S2 pins 11/10/9 to Pico GP2/GP3/GP4.
- Channels Y0โY7 are pins 13,14,15,12,1,5,2,4. Keep every signal between ground and 3.3 V.
Build steps
- Run the scan loop and watch eight ADC counts.
- Turn one channel potentiometer and confirm its corresponding count changes.
- Add sensors only after verifying their analog range.
- Wait after switching and average samples for steadier readings.
Software and firmware setup
from machine import ADC, Pin
from time import sleep_ms
s0, s1, s2 = Pin(2, Pin.OUT), Pin(3, Pin.OUT), Pin(4, Pin.OUT)
adc = ADC(26)
select = (s0, s1, s2)
while True:
readings = []
for channel in range(8):
for bit, pin in enumerate(select):
pin.value((channel >> bit) & 1)
sleep_ms(2)
readings.append(adc.read_u16())
print(readings)
sleep_ms(250)Test your build
One changed potentiometer should affect only its corresponding value in the eight-count list.
Troubleshooting
- All same: verify S0/S1/S2 and channel pin order.
- Out of range: disconnect; no analog input may exceed 3.3 V.
- Spikes: allow longer settling and average samples.
Safety and limitations
Low-voltage prototype only. Never route mains or signals above 3.3 V through the mux/Pico.
Manufacturer and platform documentation
Community Notes for This Project
These are unverified visitor contributions, separate from the build guide and manufacturer specifications. Verify technical advice against the linked datasheets before relying on it.
Set up the comments service to load community notes.