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?

asheeshr
  • 3,847
  • 3
  • 26
  • 61
DominicM
  • 597
  • 3
  • 7
  • 13

1 Answers1

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?

gwideman
  • 358
  • 1
  • 7