Pages: [1]   Go Down
Author Topic: multiplexing analog inputs?  (Read 1158 times)
0 Members and 1 Guest are viewing this topic.
Melbourne
Offline Offline
Jr. Member
**
Karma: 2
Posts: 83
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

So whilst I'm doing this with an arduino the question is probably more general electronics related as I can't seem to find an answer in the almighty google but am sure someone has done this before.

Overall I'm building a garduino-esque drip watering system for my garden however instead of it just turning on the whole irrigation system when one plant is getting a bit dry what I want to do is make it water specific plants. I've more or less got the irrigation control working on the output side (opening and closing specific valves in the system according to instructions) but I want to have more than 6 inputs (yes moon on a string and all that) - particularly because I want the sensors in different types of plants in different parts of the garden (some parts are more sunny, shady, wet or dry than others).

I'm already using shift registers to control the open and closing of my valves so was thinking if there's an equivalent for analog input? I looked at using a standard shift register but it would mean the input becomes high/low not variable.

Does anyone know of a component to achieve what I'm setting out to do or can enlighten me as to a way of switching between multiple analog inputs coming onto the same pin?

I don't need something that is performance driven as I don't need constant feedback into the system - even if it had to cycle between each of the inputs in a "round-robin" style that would be sufficiently fast enough for what I need it for (lets face it plants don't dry out *that* fast so anything faster than once per day will be sufficient).

Cheers
ajfisher
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8976
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.arduino.cc/playground/Learning/4051

The CD4051 ia an 8-way analog multiplexer/demultiplexer.  You address it with three digital outputs to connect one of 8 signals to an analog input pin, then read the pin.  By using one per analog input pin you can get eight times as many inputs at the cost of three digital output pins.

Remember you can use "analog input pins" as digital output pins.

By using three of the six analog pins as inputs and three as address lines to the 4051 chips you can get 24 analog inputs for very little cost.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 96
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Two suggestions, if you don't want shift registers. One is to hook your different water sensors to different resistors, and hook all to one analogue pin. When you get different resistor values read by the Arduino, you can turn on different water valves. Other is to use the PCF8575 I2C chip. It can watch 16 switches at once, and send that info to the Arduino with only two wires on the I2C bus.
Logged

Resistance is Futile

Melbourne
Offline Offline
Jr. Member
**
Karma: 2
Posts: 83
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks John

That looks really simple - not sure why the almighty google didn't return that page as it was really detailed and exactly what I'm looking to achieve.

Between that for input and shift regs for output I could almost get to "per plant" measurement and watering which would be pretty cool.

Cheers
Andrew
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8626
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have a look at 4067 and 4051 chips.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Montreal
Offline Offline
Faraday Member
**
Karma: 31
Posts: 2611
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I will just say , that

"Posted on: Today at 09:06:31 PM
Posted by: johnwasser"

he is right, multiplexing input the best solution , and not just best , the only one.
And this chip is good, take a data sheet from
http://www.alldatasheet.com/view.jsp?Searchword=4051

What is a obstacle in design only
ON Resistance
VIN = VIL or VIH (Control), and
RON
VDD=10V
120
500
 You will have to consider ON resistant, input has to be 100 times more resistive,
so you wouldn't lost a info.


Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8976
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That looks really simple - not sure why the almighty google didn't return that page as it was really detailed and exactly what I'm looking to achieve.

You just needed to know the right search terms:  analog multiplexer
One of Google's suggestions was:  analog multiplexer demultiplexer 4051
I selected that suggestion and the Arduino Playground page was the first result!  (I was surprised and pleased.)
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Pages: [1]   Go Up
Jump to: