What is after the first 1. 2. 3. 4. steps ?
567.dk

Arduino Info USB/FTDI programmer Add libary Remove libary RF transmit / Recive 315 or 433 Mhz CD4051B - 8 port analog multiplexer 74hc595 - 8 port shift register - output 1-Wire ® Temperature (DS18B20) i2c bus + scanner i2c Barometric Pressure + Temp(BMP085) i2c LCD 1602 Display SingleBus Temperature + Humidity(DTH11 + DTH21 + DTH22)

Arduino extra analog input with CD4051B - 8 port analog multiplexer



I had to use more than 8 analog inputs to a project, and desided to play around with analog multiplexers
Otherwise i had to use an expensive Arduino, with more analog inputs.

But if you just whant a digital I/O the you can choose mcp23017 or shift registers.

PCS Item Calculated Price Price bulk buy
1 CD4051B 0.29 E-bay US $ 1.43 @ 5 PCS with shipping to Denmark (Aug 2013)
16 Varius Ω Resistors 0.00 Use some resisors that yoy have !!!


Recommended standard reusable hardware

PCS Item Calculated Price Price bulk buy
1 Arduino Pro Mini clone 3.71 E-bay US $ 3.71 @ 1 PCS with shipping to Denmark (Aug 2013)
1 Wire Jumper Cable 7.49 US $ 7.49 with shipping to Denmark (July 2013)
2 BREADBOARD MB-102 830 TIE-POINTS 1.96 E-bay US $ 3.05with shipping to Denmark (Aug 2013)


Use donate button if you like my guides, or if you want a new guide ( See missing work ).

Datasheet CD4051BE



Here my test setup, with 8 to 1 analog input (using 1 analog input and 3 Digital outputs)

some text some text

You can exted this guide in varius ways, i include some samples at the bottom.




Here is my sample code. I shift the bits on the multiplexer and read the value, with no delay. I get the right values, if you put in a small delay (2 ms) before reading - it may be bether.

Arduino sample code

I use putty as console debugging putty or Direct download my server (v0.62)
I discovered that i runs more stable than the build in version
some text

Here a example to get 32 analog input using only 4 analog inputs and 3 digital outputs
If you scale it up using all 8 analog input on this board you get 64 analog input still using only 3 outputs.

some text

But you can get more analog inputs - You chose the number !!!

Here a example to get 64 analog input using only 1 analog inputs and 6 digital outputs
If you scale it up using all 8 analog input on this board you get 512 analog input still using only 6 outputs.
If you whant to save digital output, you can make it with shift registers. And only use 3 digital outputs.

some text