Sensors in series to reduce wires

So I have a project which would require somewhere between 10 to 20 sensors. For the purpose of this use, the sensors are either open or closed.

So for now I am using simple push buttons on a breadboard.

One of the restriction I have is that I plan on using a regular Cat5 cable to connect all the sensors in series. So I have a limitation of 8 wires (7 really) to read 20 sensors. I was exploring the idea of putting a different resistance value on each sensor so I could put many of them on a single wire.

So far I realized the following:

  • It is really hard to have reliable binary like resistance values ( ie.: to have the Analog pin return 8, 16, 32, 64, etc. as there is a lot of play room)
  • It can take a few seconds for the actual proper readout to stabilize when a state change.
  • Using a custom array and defining resistance values manually, I have been able to isolate 10 push buttons on a single wire. I can tell which one is pressed... so long as you don't press more than 1 button at once.

But I have real trouble finding a reliable way to know what button is pressed when multiple buttons are pressed. (Because it is almost impossible to be precise with a binary-type scale, I tried skipping 2 numbers (ie: 8, 32, 128, 256) but the analog output is limited to 1023 so that put me down at only 4 sensor per wire.

Have anyone experimented with a similar situation of trying to isolate multiple binary states on a single analog input ? Is there a better way when dealing with many sensor and being limited in term of wires ?

Thank you !

You can use a resistor ladder to connect multiple switches to one analog input.

It is very difficult to arrange such a ladder to work with more than one switch closure at a time.

For a few buttons you may be able to make that work, but for many I suggest something like I2C expanders (2 pins) or shift registers (3 pins).

You could Charlieplex them with diodes. Actually you could make that digital and forget about resistors.

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.

What is the distance between the sensors and the controller?
This will govern the best way to solve your problem.
Can you please post a copy of your present circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

What model Arduino are you using?
What are the sensors you are going to use.

I gather that you may have more than one sensor on at a time?

Thanks.. Tom... :slight_smile:

You can use a counter & multiplexer at the sensor end, clocked from the arduino via the cable to repeatedly test the condition of each sensor. Using analog inputs to read digital values can introduce problems with noise, capacitance etc.
Ground and +5V, clock and (if necessary) reset for the counter, and one wire (or up to 4) for the sensor signals.

BCD matrix?