# Arduino output consistently fluctuates +/- 15

Hello,

I've placed constant weights on the force sensor (R_flexiforce) in my circuit (diagram attached, recommended by the sensor manufacturer) and always measure a fluctuation of +/- 15 Arduino output units (about 0.1V). This also occurs without any weight on the sensor, which has a resistance of 5 M ohms in that case. The fluctuation is very consistent, with the same range of +/- 15 and frequency of about 0.2 Hz (12 cycles per minute).

Currently C1 = 22 pF and Vref = 0.27 V. The Arduino pins I'm using are and 5V, GND, and A0. My code currently records at a delay of 100ms and outputs an average of the past 10 readings, and I've observed the same fluctuation with both smaller and larger delays and no averaging.

I've searched this issue on Google and this forum and read through the three below links with similar issues. They mentioned using input from the wall instead of the Arduino as well as a capacitor across AREF, but I'm not sure how to interpret that in the context of my situation.
https://forum.arduino.cc/index.php?topic=27195.0
https://forum.arduino.cc/index.php?topic=50189.0
https://forum.arduino.cc/index.php?topic=177960.0

Thank you, I appreciate your time!

dawnia:
The fluctuation is very consistent, with the same range of +/- 15 and frequency of about 0.2 Hz (12 cycles per minute).

Breathing on it too closely?

with the same range of +/- 15 and frequency of about 0.2 Hz (12 cycles per minute).

But, that's after the averaging, right?

What happens when you rotate the gain pot to both extremes?

What are the resistor values (including the pot)?

Vref = 0.5 V.

What voltage are you getting out of the op-amp (into A0)?

Can you give us a link to exact sensor you're using?

Sure, thanks for your detailed followup!

I attached output from the serial plotter over around half a minute without averaging and with a delay of 50 ms. Same phenomenon.

What happens when you rotate the gain pot to both extremes?
What are the resistor values (including the pot)?

The pot is currently 1 MΩ, and I also get relatively good resolution +/- 500 kΩ. The resolution isn't great outside of that range; when the pot is too low, the output rails at lower values, and when too high, the output is too sensitive and shoots up to 1023 with little pressure on the sensor.

Right now R2 = 300 Ω and R1 = 5200 Ω, so Vref = 0.27 V. This is within the optimal range recommended by the sensor manufacturer.

What voltage are you getting out of the op-amp (into A0)?

I'm not sure what you mean, since depending on the force on the sensor I can get voltage output throughout the range from a low of about 50 up through 1023.

Can you give us a link to exact sensor you're using?

Which Arduino, and how are you powering it.

If you double the value of C1, does the frequency of the oscillation halve?
Leo..

I attached output from the serial plotter over around half a minute without averaging and with a delay of 50 ms. Same phenomenon.

That looks like mains interference that is being aliased due to the very slow sample rate. This is made worse by the very high impedance of the circuit.

Try looking at this at a higher sample rate and see if you can spot your local mains frequency or double it.

I have an update and especially want to @Wawa since they mentioned power. I was just testing (with both averaging and 100ms sampling) noticed that the fluctuations stop when my laptop isn't charging. I'm using an Arduino Uno. Does charging my laptop affect the Arduino's 5V pin? Is instead powering my Arduino from the wall a solution to this?

• Dawnia

dawnia:

I have an update and especially want to @Wawa since they mentioned power. I was just testing (with both averaging and 100ms sampling) noticed that the fluctuations stop when my laptop isn't charging. I'm using an Arduino Uno. Does charging my laptop affect the Arduino's 5V pin? Is instead powering my Arduino from the wall a solution to this?

• Dawnia

I am sure that depends entirely on the age and condition of the battery in your laptop. One cell may be dead and the charging circuit detects the below normal voltage and tries to charge the battery. Then it detects the temperature rise in the battery and stops charging. Then all over again.

Paul

Pay close attention to grounds and bypassing.

Don't daisy-chain grounds. Make sure your ground and power connections are good. I just troubleshot a noisy ADC that turned out to be a protoboard that wasn't tight enough for 24 gauge wire, but is for 22 gauge wire.