Reading Mux Analogue Inputs

Hey,

I want to take on a project with the Arduino that will require > 6 analogue inputs so I will need a multiplexer.

I’ve been thinking about it and after reading the information on the MC14067 multiplexer it seems that I will be able to do what I want but I still have a question.

The analogue inputs will be receiving information from potentiometers but presumably, to get an accurate reading of the pot’s values I’ll need a scan rate for my multiplexer (assuming MC14067) that is 8* my ADC frequency?

I’ve read the post on changing the pre-scaler value for the ADC so I’m pretty confident in that but, having never used a multiplexer before, am I limited to a scan rate or can I set it in code?

I hope that has made some sense. I have some experience with PIC programming but haven’t done anything like this before.

Thanks!

I’m not sure where you are getting this 8* from.

The procedure I would take is as follows:

  1. Select an analogue input through the mux
  2. Wait a short preiod of time for the effects of switching the mux settle down.
  3. Read the analogue value.
  4. Select the next analogue input through the mux.
  5. Goto step 2.

This will be the fastest you can read all the inputs. You may want to read them less often (it depends on your application) so you may want to set it up so that you read a new value every, say 25ms. This will give time for the Arduino to do other things besides reading pot values.

Mike

I made a system wiyh 16 slidepots using two 4051 analog mux IC’s.

I can read them very fast with the full 10 bit precision supported by the Arduino ADC, without changing any prescalar values or anything else.

You can find the design, including (primitive) PCB layout and Arduino code here:

http://mikmo.dk/misc/arduinomux.zip