Mulitplexer to read analog values

arduinomultiplexer

schematic

simulate this circuit – Schematic created using CircuitLab

I have a hall sensor that can measure current up to 25 A with analog output 0~5V. I am using Arduino mega board for programming. There are in total 30 hall sensors and where Arduino mega has 16 analog channel. Because of this I am planning to use multiplexer circuit.

Questions:

  1. Is the above circuit right to build multiplexing circuit?
  2. How are multiple analog output values read?
  3. What is the purpose of selector pins S0, S1, and S2? It says that depends on state of pin it read value. Is it true or false? I mean to say, if S0, S1, and S2 are all 0, it reads analog output of hall sensor 1; if S0 = 0, S1 = 0, S2 = 1, it reads HS4. Is that correct or not?
  4. Is it correct that using multiplexing, I can read one value at a time, but with multiple IO connected?

Best Answer

  1. You can use the above circuit.

  2. One of the input in connected to output based on the selector line value.

  3. selector pins decide which input line is connected to output line. selector lines = 000 selects HS1, 001 selects HS2 and so on..

  4. You have to use time division multiplexing. ie., read HS1 for 1st few ms, read HS2 for next duration and so on..