I started a home project which has become almost impossible i think and its all my own fault!

I planned on using a raspberry pi to monitor around 80 analogue sensors - specifically force resistors. I have since learnt that to use these sensors i need;

1) an analogue input on the raspberry pi - which i dont have 2) i could use an analogue to digitial converter which would then lose any information from the sensor

Step 2 is not desirable because i want to know when a sensor is above a particular value so based on this what are my options

Have I been far to optimistic and should i maybe swap the pi for an arduino or something? Is it ever possible to hook roughly 80 of these up to something so small? Hopefully someone can provide some assitance



The sensor type can be seen below - ideally all i want is to be able to read all 80 sensors and tell when a sensor is over a certain force. I dont need to know the force, just that it has been surpassed.

This is a force sensitive resistor with a square, 1.75x1.5", sensing area. This FSR will vary its resistance depending on how much pressure is being applied to the sensing area. The harder the force, the lower the resistance. When no pressure is being applied to the FSR its resistance will be larger than 1MΩ. This FSR can sense applied force anywhere in the range of 100g-10kg. Two pins extend from the bottom of the sensor with 0.1" pitch making it bread board friendly. There is a peel-and-stick rubber backing on the other side of the sensing area to mount the FSR. These sensors are simple to set up and great for sensing pressure, but they aren't incredibly accurate. Use them to sense if it's being squeezed, but you may not want to use it as a scale.

I want to detect when a seat has been sat on, but want to only show something that would be heavier than a bag. Thats why my condition of over a certain limit comes in to it. Ideally the cables connecting the sensors wont be too long, a couple of feet max i guess.


  • \$\begingroup\$ What information from the sensor would you lose that you can't already have? \$\endgroup\$ – Ignacio Vazquez-Abrams Nov 4 '13 at 19:18
  • \$\begingroup\$ i want to know the pressure of a square force resistor - the pressure doesnt need to be exact but i want to no when its above a value x \$\endgroup\$ – Biscuit128 Nov 4 '13 at 19:29
  • 1
    \$\begingroup\$ Provide more information about the sensors. If you only want to know when the sensor is above some value, and if the accuracy is not an issue, maybe it is possible to use the digital inputs. \$\endgroup\$ – johnfound Nov 4 '13 at 19:30
  • 3
    \$\begingroup\$ An "analog input" IS an analog to digital converter. \$\endgroup\$ – Scott Seidman Nov 4 '13 at 19:39
  • 3
    \$\begingroup\$ The picture, of course is very good, but the specification of the sensor would be much more helpful. What is the resistance? How it depends on the force? What is the threshold you want to detect? How long are the wires to the sensors? \$\endgroup\$ – johnfound Nov 4 '13 at 19:39

It seems that the sensor is highly non-linear and this is good in our case.

You can try to connect these sensors to the digital inputs of the RaPi, if they have some hysteresis (AFAIK, the GPIO inputs have a hysteresis). The schematic if the following:


simulate this circuit – Schematic created using CircuitLab

The value of R1 is the same as the resistance of the sensor on the threshold point. Determine it experimentally.

The capacitor C1 is to reduce the induced EMI. One approximate value is 100nF but it may vary.

Mount the resistors and capacitors as close to the CPU board as possible. Use shielded cable (low frequency) to connect the sensors. The shield must be the ground wire.

If the EMI are too big, some software processing of the false positives can be made.

If RaPi has no enough inputs (80) you should make some multiplexing. Note, that in this case, some buffers with hysteresis have to be used - 74HC7540 is good choice. You can use 10 of them and connect all outputs together and control the 3-rd state inputs by GPIO outputs. This way with 10 outputs and 8 inputs you can control 80 pressure sensors.

  • \$\begingroup\$ quick question, this is aimed at both answers so i will copy and paste - if we multiplex, do we lose the ability to know which signal came from what sensor (ie we just know that a sensor was triggered but not which) - thanks for such a comprehensive answer btw \$\endgroup\$ – Biscuit128 Nov 4 '13 at 20:43
  • \$\begingroup\$ @Biscuit128 No, of course. In the multiplexed inputs, you have to scan the sensors by the GPIO outputs and read the sensors by 8 (in the my suggestion). Then knowing what chip is enabled in the moment you will know the state of these 8 sensors and can write it to the memory. \$\endgroup\$ – johnfound Nov 4 '13 at 20:46
  • \$\begingroup\$ sorry for my lack of knowledge, im a software developer as per the day and am VERY new to the world of electronics :) \$\endgroup\$ – Biscuit128 Nov 4 '13 at 20:49
  • \$\begingroup\$ @Biscuit128 - similar method of scanning is used in the computer keyboards, because there are many keys and not so many inputs in the keyboard controller. :) \$\endgroup\$ – johnfound Nov 4 '13 at 20:55

80 Inputs is a lot of wiring so I think multiplexing is a good idea. What about a 32:1 multiplexer under serial data control and maybe you distribute the multiplexers around the house. Here's one idea: -

enter image description here

The current source (say 5mA) will be diverted to the sensor that is currently selected via the serial control (SPI) and will allow you to measure the voltage with an ADC. The ADC could be local (same SPI interface) or you could take 4x (32:1 muliplexed) outputs to a more central 4 channel ADC.

  • \$\begingroup\$ quick question, this is aimed at both answers so i will copy and paste - if we multiplex, do we lose the ability to know which signal came from what sensor (ie we just know that a sensor was triggered but not which) - thanks for such a comprehensive answer btw \$\endgroup\$ – Biscuit128 Nov 4 '13 at 20:44
  • \$\begingroup\$ @Biscuit128 the spi bus that controls the multiplexer selection comes from your RaPi and IT dictates what selection you are currently (at the moment) selecting therefore the RaPi (aka your software) knows what is currently being selected. \$\endgroup\$ – Andy aka Nov 4 '13 at 21:18

One possible sollution is to use the smallest micro you can use (PIC12F?) to read a couple of sensors and send a signal to the RaPi alerting it to the ID of the sensor that's tripped over a simple network (SPI / CAN / custom clocked?). If micro's are all on one network (or a few networks) connected to the GPIO pins you could capture every trip.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.