Arduino: getting 24 analog inputs from 6 pins

Thread Starter

Phaedo

Joined Sep 4, 2013
13
So I am making something using my arduino uno. The problem is that I need 24 analog inputs and the uno only has 6! This is what I came up with:



If the switches being on or off represents the digital outputs of the Arduino being high or low and the two top power sources represent the analog output from the device that I want to go into the Arduino, I can control which analog output the input is received from. Thus, hopefully, I will get 24 inputs, 6 parallel * 4 serial , the count to 4 will be controlled by 4 of the Arduino's digital out or, if I'm short of pins, two and some logic gates.

Would this work? I can see from the simulation that the voltage changes from the voltage that the bulb receives compared to what goes into the receiver of the transistor. Is there a way to remedy this. Thanks in advance!
 

Thread Starter

Phaedo

Joined Sep 4, 2013
13
Why not use a handful of CMOS CD4051, a one of eight selector IC.
I had a look at the data sheet but I can't make much sense of it. What are the advantages of this over the below link.

You could use a few shift registers - you daisy chain them together, so you can make as many outputs as you like
Would this work? This is my favourite solution so far. What sort of clock speed would I be able to squeeze out of the arduino? The pwm can only reach 490hz, do you reckon using a digital out as the clock instead of a pwm and just running with the arduino clock speed im getting of 4.5Khz. What about an external clock. It is doing audio stuff so the faster the better really.

There are multiplexer/demux shields for the arduino.. slap it on and done..
https://www.sparkfun.com/products/11723
http://playground.arduino.cc/learning/4051
Thanks, I would but this is more expensive and I always feel a bit like I've cheated if I get a shield!
 

blueroomelectronics

Joined Jul 22, 2007
1,757
The CD4051 is a analog switch, like a rotary switch with 8 to 1 selected by 3 bits ABC.

The shift register is for adding more digital outputs not analog inputs.
 

Thread Starter

Phaedo

Joined Sep 4, 2013
13
The CD4051 is a analog switch, like a rotary switch with 8 to 1 selected by 3 bits ABC.

The shift register is for adding more digital outputs not analog inputs.
This seems like exactly what I was looking for, thanks! I realise now that I could have read that on the data sheet:

The CD4051B is a single 8-Channel multiplexer having three
binary control inputs, A, B, and C, and an inhibit input. The
three binary signals select 1 of 8 channels to be turned on,
and connect one of the 8 inputs to the output.
Sorry and thanks for you having to do that, I was just intimidated by it at first.

So.. just use the same parts and build it yourself..
That would still probably be more expensive than the CD4051 for what I want to do but thanks anyway!

By the way, out of curiosity, what sort of circuit is behind an analog multiplexer?
 
Top