7

I have a relatively cheap 0-15psi pressure transducer. It has 3 pins - ground 5V and signal. The signal outputs a voltage of 0.5V to 4.5V based on pressure from 0psi to 15psi. I can verify it does respond to significant pressure increases so it works at least to a point.

The issue is that the reading from arduino can differ by over 50% when at ambient atmospheric pressure (resting on a table). It should be significantly more accurate if the sensor data are to be trusted. The code is basic:

void setup(){
  Serial.begin(9600);
}

void measurePressure(){
  int rawReading = analogRead(A0);   // Range : 0..1024
  //float rawVoltage = (rawReading * (4.5 / 1023.0)) + 0.5;

  Serial.print("Raw reading: ");
  Serial.println(rawReading);

}

void loop() {
  measurePressure();
  delay(1000);
}

The output variations are not entirely random, it seems that the reading goes down and up in intervals of roughly 5-15 seconds. Below is a sample output:

Raw reading: 61
Raw reading: 67
Raw reading: 70
Raw reading: 73
Raw reading: 74
Raw reading: 78
Raw reading: 75
Raw reading: 82
Raw reading: 85
Raw reading: 90
Raw reading: 89
Raw reading: 97
Raw reading: 103
Raw reading: 119
Raw reading: 146
Raw reading: 165
Raw reading: 171
Raw reading: 168
Raw reading: 163
Raw reading: 150
Raw reading: 143
Raw reading: 118
Raw reading: 88
Raw reading: 70
Raw reading: 62
Raw reading: 64
Raw reading: 72
Raw reading: 78
Raw reading: 80
Raw reading: 82
Raw reading: 88
Raw reading: 92
Raw reading: 102
Raw reading: 134
Raw reading: 160
Raw reading: 170
Raw reading: 172
Raw reading: 166
Raw reading: 158
Raw reading: 149
Raw reading: 132
Raw reading: 100
Raw reading: 73
Raw reading: 63
Raw reading: 61
Raw reading: 71
Raw reading: 77
Raw reading: 79
Raw reading: 84
Raw reading: 90
Raw reading: 90
Raw reading: 99
Raw reading: 134
Raw reading: 161
Raw reading: 170
Raw reading: 166
Raw reading: 161
Raw reading: 151
Raw reading: 133
Raw reading: 103
Raw reading: 81
Raw reading: 68
Raw reading: 63
Raw reading: 63
Raw reading: 71
Raw reading: 73
Raw reading: 81
Raw reading: 83
Raw reading: 85
Raw reading: 89
Raw reading: 98
Raw reading: 128
Raw reading: 161
Raw reading: 171
Raw reading: 166
Raw reading: 159
Raw reading: 145
Raw reading: 120
Raw reading: 85
Raw reading: 67
Raw reading: 57
Raw reading: 63
Raw reading: 72
Raw reading: 75
Raw reading: 83
Raw reading: 85
Raw reading: 89
Raw reading: 97
Raw reading: 130
Raw reading: 164
Raw reading: 172
Raw reading: 163
Raw reading: 155
Raw reading: 135
Raw reading: 101
Raw reading: 69
Raw reading: 60
Raw reading: 62
Raw reading: 72
Raw reading: 78

I tried adding 4.7k pull down resistor with no change but that was just a blind try. I have a multimeter connected as well and the reading seems to be more stable ranging from about 0.495V to 0.535V (variations do not seem to match arduino output).

What could be causing the issue?

17
  • Do you seem the same variation with a voltage divider that produces ~0.5V connected? Mar 22, 2014 at 21:19
  • I didn't have a voltage divider connected, voltage is in range of arduino voltage so not sure why I would need a voltage divider..?
    – DominicM
    Mar 22, 2014 at 21:35
  • No, just a voltage divider, absolutely nothing else. i.e. with a constant 0.5V input, do you see the same behaviour. Mar 22, 2014 at 21:42
  • Didn't try that. With nothing connected I see more random variations but only up to a few hundred as opposed to 0-1023 full range. Does that tell you anything or should I still build the voltage divider and test? I also tried another pin with same result. I am using Arduino Pro Micro btw.
    – DominicM
    Mar 22, 2014 at 21:55
  • A floating input will drift. What you need to work out is if it is the Arduino, your meter, or the sensor causing this. The voltage divider will isolate the sensor. Mar 22, 2014 at 22:22

1 Answer 1

2

I tried same setup with arduino uno and the problem is gone. It also works on micro as long as gnd and 5v pin is connected to uno. Uno measured voltage is 4.88V and micro 4.60V could a voltage difference this small cause this? What else could this be?

Reinstatement of incorrect edits by Annonomus Person (AP: Please do not edit answers in such a way that you entirely change their meaning. In the current discussion "the board" is meaningless. We are trying to distinguish between symptoms seen in two different 'boards', an Arduino Uno, and an Arduino Micro.)

Looks to me like the problem is with the Arduino Micro's 5V supply then.

If you are powering the Micro from an external supply (not USB), then 4.6V on the Micro's "5V" output would indicate that the 5V regulator is not operating within its expected range.

If you are powering from USB, then the regulator is not in play. The 4.6V would indicate a problem with the USB's 5V supply.

Likely possibilities:, either the upstream supply is inadequate, or the micros and whatever is attached to it is drawing too much current.

I suspect that the transducer output is fluctuating in a way that's too rapid to be seen by your meter, but which is sampled by the Arduino Micro, giving your varying result numbers.

Either the "4.6V" is inadequate to run the transducer, causing erratic transducer output, or the 4.6V itself is fluctuating, with similar results at the trans output.

And you might also check the ground between micro and transducer -- are you sure that's wired correctly?

6
  • Will test it with a different arduino mini, will need to wait for my soldering iron to arrive though, will update then.
    – DominicM
    Apr 9, 2014 at 0:50
  • For the setup that produces the fluctuating numbers, please confirm that you have the transducer connected to the Arduino Micro's +5V output, and tell whether you are powering the Micro from USB, or from an external supply, and if the latter, what kind of supply?
    – gwideman
    Apr 9, 2014 at 1:05
  • If you are powering from external power, such as batteries, please be aware that the specs for the Micro show that the 5V regulator is not reliable below 7V input.
    – gwideman
    Apr 9, 2014 at 1:06
  • Both the Uno and Mini are powered from usb port so it's not the issue especially since I also tried a different port. Transducer should work with 4.5 to 5.5V but you never know with cheap stuff. Will do some more testing when I receive my soldering iron...
    – DominicM
    Apr 11, 2014 at 18:34
  • @DominicM Note that I listed several possible issues, not just a single 'it'. A voltage of 4.6V DC may be fine for the transducer. But: (1) a meter measurement showing 4.6V can also result from a voltage fluctuating around 4.6V which will cause erratic transduce. Or (2) 4.6V is below USB 2.0 minimum spec of 4.75V, which in itself suggests something wrong with the supply or the path from USB to transducer. (4.6V is apparently legit for 3.0 though.). And again, it's worth checking the ground path between Micro and transducer.
    – gwideman
    Apr 11, 2014 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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