2 AMS5915-0010-D sensors shows 2 different result using the same coding

Hi, I bought 2 AMS5915-0010-D sensors.
With the same coding, I got 2 different reading from the sensors.
First sensor is around 0-1Pascal, while the other sensor is around 4988Pascal.
May I know is it the hardware problem or coding problem?
Following is my coding.

/*

AMS5915_example.ino
Brian R Taylor
brian.taylor@bolderflight.com

Copyright © 2017 Bolder Flight Systems

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the “Software”), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#include “AMS5915.h”

// an AMS5915 object, which is a
// static pressure sensure at I2C
// address of 0x12, on I2C bus 0,
// and is a AMS5915-1200-B
AMS5915 sPress(Wire,0x28,AMS5915::AMS5915_0010_D);

void setup() {
// serial to display data
Serial.begin(9600);
while(!Serial){}

// starting communication with the
// static pressure transducer
if (sPress.begin() < 0) {
Serial.println(“Error communicating with sensor, check wiring and I2C address”);
while(1){}
}
}

void loop() {
// read the sensor
sPress.readSensor();

// displaying the data
float pa = sPress.getPressure_Pa();
Serial.print(pa,6);
Serial.print("\t");
Serial.println(sPress.getTemperature_C(),6);
delay(500);
}

Thank you.

Kai

hi,
try this code


can you post a picture of your setup.

Thanks

1 Like


Above is my setup. Do I have to get the pull-up resistor connected?
I have tried your coding, attached below are the readings from the sensors:
There’s a 0.11Mbar difference when there’s no pressure is applied. How to offset this off?

Thank you.

Kai

Yes, I believe you use the Pull-Ups for the External I2C sensors, unless you are using a Controller from NCD.io. I don’t think the Arduino has Pull-Up resistors for I2C Bus.
Only 1 set of Pull-Up Jumpers are used no matter how many I2C sensors are on the BUS.

A NCD.io employee can confirm this. I may be wrong.

BUT, Looking at your Log, 0.1 mbar is only 0.04 inches of water column.
With a Range of 0 to 10 mbar, that’s well within the Specified Error in the Datasheet of that particular sensor (2%)
0.1 mbar is 1% of the Output Range of the AMS5915-0010-D.

@rfontaine is correct about pull ups.
the sensor board also has pull ups, you can install the pull up jumpers to enable the pull ups on SDA SCL lines.

Noted and thank you for the information.
As it’s a 4pin pull-up resistor, may I know how to connect the pull-up jumper?
Which direction should I connect the jumper?


First picture or second picture?
Thank you.

2nd picture.

Thanks

If im using the Mux, which pull-up resistor should I use?
The pull-up resistor on the Mux or one of the sensor’s pull-up resistor?

Pull us on mux.
Thanks

So if im connecting using Mux, what is the coding?
Thank you.