Extremely jittery analog inputs

Hi, I'm working on a pretty simple Arduino project with a MegaADK. Part of it is to read 10 analog sensors (FSRs). However, I can't read reliable values with my setup.

I first tested everything with a breadboard and it worked fine, but when I tested it in the "real" setup, that is, with longer (~1m, 10 wire flat-)cables, the values became completely bogus: They oscillate between 0 and 1023 and seem to spill over to the neighboring sensors. I read somewhere that this could be due "residue voltage" in the A/D-converter and to drain it one should make an analogRead() before the actual read. Tried it, didn't work (even with 12 "drain reads").

The thing is, I even get these weird values just with the cables (and not the sensors, resistors, etc.) connected.

the analog lines are floating, the wires work as antennas. That is why the value goes all directions.
use a pull up resistor will pull the line to 5V (1023 reading) or a pull down will bring it to zero.
choice is yours (depending on the sensors to be connected …)

A flat ribbon cable has a lot capacitive and inductive coupling. Do you have only the FSRs on that cable ? no digital signal for a sensor or so ?

Which FSR are you using ? What is the impedance of it ? It is almost as if you are using high impedance piezo sensors instead of FSR.

I used the Adafruit tutorial here. In my case, all sensors share one GND and one 5V pin. So I should already have pull down resistors.

Edit: The resistors are soldered directly to the sensors, would it be better to put them closer to the board?

Which FSR are you using ? I have some (but I can't find them...) so perhaps I have the same and can do some tests. Adafruit uses resistors of 10k to GND. You have that ? It doesn't matter if they are soldered to the FSR or near the Arduino. The circuit impedance is now 10k or lower, that should not give so much oscillation.

Now what is going on ? Perhaps you have a very strong radio signal, or the cable is laying over a device that generates illegal radio noise. Perhaps the GND is not connected (that happens a lot).Perhaps your resistors are not 10k, but 10M. Something funny is going on.

Do you have a multimeter to measure everything ?

I use the Interlink ones linked in the tutorial ( or some other that happen to look exactly the same and are also made by Interlink). I'm not near my circuits now, but I definitely used way more than 10kOhm (about 50k I think), that's because I have to measure relatively small weight changes while having a big base weight. I do have a multimeter, but I'm 90% sure, there's no illegal noise, just regular WLAN, Bluetooth, etc.

Meanwhile, I found my FSRs and they are the same Interlink FSR as in the tutorial :stuck_out_tongue:
They can be more than 20M without pressure, but when they are attached to a solid surface, a slight touch lowers it below 100k.

Tell me more about your project. You apply weight to them and have to measure a small change ? They are not made for that. Many people think they can be used in a shoe, but that is not possible. They can not handle that amount of weight and they can not measure weight. You are not the first one that wants to use them in a shoe, a chair or a mattress. Perhaps in a mattress is possible if no FSR gets more than 10kg.

When you want to test them, use the 10k resistor, and use a few analogRead() for the average. You can also add a capacitor from the analog input to ground (1nF to 10nF) to reduce the RF noise.

They should sense a change in weight, so I have a drawer with stuff in it and want to measure if something has been taken out/put in. With the short cabled version this works pretty good. I don't really care for exact measurements; I want to detect THAT something changed, not necessarily how much. It won't ever get near 10kg (2kg at most, probably less), but as you can see in the tutorial's graphs, detecting, say 10g difference while having 500g in the drawer is rather hard with smaller resistors.

I already use the average of 4 Reads().

How exactly would I do that capacitor thing? I taught everything myself, no theoretically background.

Ten sensors in a single drawer (I like that idea) or 10 drawers each with a sensor (that is harder).

A small capacitor to analog input and GND for every analog input that has a FSR. So it filters the high frequencies and flattens the signal a little. When you have the resistor at the Arduino, you can use the resistor parallel with the capacitor. I would like the capacitor at the analog pins of the Arduino and not on the other side of the cable at the FSR.

But please use a 10k resistor for every FSR, you can try different things later on.

Measure that the GND is connected and the 10k is connected. I have my doubts about that.

I checked all the soldering points, it's all fine, everything's grounded. Unfortunately I don't have 10k resistors, but I bridged one of the two 27k ones, so I have 27k now, I also tried a capacitor (1,9 and 4,7 nF), it does in fact flatten the signal, but adds a drift, so it slowly oscillates towards 1023.

By the way: I tried different resistors, I need that high resistance for reliable measurements.

I know you want that high resistance, but I want to find the problem. Because there is something wrong.

The 27k is not that bad. I wonder what will happen when you try 4k7.

With the 27k connected to GND and FSR, it is impossible that it drifts to 1023. Could the Arduino Mega be damaged ? I hope not, since it worked on the breadboard. I get a feeling that GND and 5V are not connected. The drifting and oscillating is typical for an open analog input. What about that flat cable ? could it be broken inside ? or have bad soldering or connections ? Perhaps something changed in your sketch ? Do you use a breadboard ? those can have bad contacts.

Check your wiring once more.... and if that is okay, disconnect everything from the Mega board and test the analog inputs with something simple. At this point everything can be wrong, so you have to start all over again, and step by step try if it is working.

I have two boards and two cables, both the same issues. However, I tried some very simple wirings directly on the board (A0<->GND, A0<->5V) with the expected results (0,1023).

With a connected cable I get the wrong results again, oscillating and/or random values. I checked all the wiring again and checked 5V/GND at the end of the cables with an LED, it worked.

I really don't know what to say. I could do the same thing with very long cables and it won't oscillate and it won't drift to 1023. Somehow it is not going to work like this.

Do you have a potentionmeter ? of about 10k. You could try that at the end of the cable. Connect it to 5V and GND and the slider to A0. The values read by A0 must be stable. Perhaps something happened to the Arduino board. Did you do something special with the AREF pin ?