NPA 201 Nova Sensor Amphenol

Hi, I have the Eval Bord for NPa 201 wired and connected to my UNO but not able to communicate with it. it works with I2C. if someone can help me out with a code to do it, it will be appreciated as I am new to that thanks

Did you get this working? I'm interested in trying to use the same eval board with an Arduino.

Thanks in advance!

UPDATE: I fixed the typo in the temp equation after seeing the post from Amphenol and it’s working correctly. The code below has been updated.


I was able to get the sensor working for pressure only so far. The data sheet with the info you need is here. has the temp and pressure equations flipped. I needed to move on to other things and haven‚Äôt figured out the temp calculation problem. I‚Äôm sure my code could be simplified and improved ‚ÄĒ hopefully this saves someone a little time, though.

#include <Wire.h>

const int sensor_addr   = 0x27;
const int read_delay    = 50;

int rbuf[5];
float P, T, Pconv, Tconv;

void setup() {
  Wire.begin();                // join i2c bus (address optional for master)
  Serial.begin(115200);        // start serial communication

}

void loop() {

  // NPA201 barometric pressure sensor
  int i;
  
      Wire.beginTransmission(sensor_addr); // transmit to device
      Wire.write(0xAC);                    // send command for full sensor read
      Wire.endTransmission();              // stop transmitting
    
      delay(read_delay);                   // datasheet suggests at least 20 milliseconds
    
      if (Wire.requestFrom(sensor_addr, 5) >= 0) {
        i = 0;
        for (i = 0; i < 5; i++) {
          rbuf[i] = Wire.read();
        }

      // Join two bytes for to make 16-bit readings for pressure and temp
      P = word(rbuf[1],rbuf[2]);
      T = word(rbuf[3],rbuf[4]);

      // Convert using formula in data sheet
      Tconv = T / 65535 * (85+40) - 40;
      Pconv = P / 65535 * (1260 - 260) + 260;

      // Output converted reading(s) to serial console
      Serial.print(Pconv);
      Serial.println(" mBar");
      Serial.println();


      delay(60000);                  // delay in msec
      }

}
1 Like

Try this:

void NPA201ReadData()
{
// Initiate Comms to device, initiate measure and read 5 bytes of data
Wire.beginTransmission(I2CAddress);
Wire.write(0xAC); Wire.write(0);
Wire.endTransmission();
delay(21);
Wire.requestFrom(I2CAddress, 5);
aa = Wire.read();
bb = Wire.read();
cc = Wire.read();
dd = Wire.read();
ee = Wire.read();

//Pressure Value = BridgeData/65535 * (1260-260) + 260 (hPa)
//Temperature_Value = TempData/65535 * (85+40) - 40 (¬įC)
// additional calculations to make values reasonable based on accuracy

pressure = (float) ((bb << 8) | cc) / 65535 * 1000 + 260;
pressure = round(pressure);

temperature = (float) ((dd << 8) | ee) / 65535 * 125 - 40;
temperature = round(temperature * 10);
temperature = temperature / 10;

}

ensure you are working on 3.3V for supply and SDA/SCL else you’ll fry it.

Thank you! I found my typo in the temp equation.

AmphenolSensors:
Try this:

void NPA201ReadData()

{
 // Initiate Comms to device, initiate measure and read 5 bytes of data
 Wire.beginTransmission(I2CAddress);
 Wire.write(0xAC);  Wire.write(0);
 Wire.endTransmission();
 delay(21);
 Wire.requestFrom(I2CAddress, 5);
 aa = Wire.read();
 bb = Wire.read();
 cc = Wire.read();
 dd = Wire.read();
 ee = Wire.read();

//Pressure Value = BridgeData/65535 * (1260-260) + 260 (hPa)
¬†//Temperature_Value = TempData/65535 * (85+40) - 40 ¬† (¬įC)
 // additional calculations to make values reasonable based on accuracy

pressure =  (float) ((bb << 8) | cc) / 65535 * 1000 + 260;
 pressure = round(pressure);

temperature =  (float) ((dd << 8) | ee) / 65535 * 125 - 40;
 temperature = round(temperature * 10);
 temperature = temperature / 10;

}



ensure you are working on 3.3V for supply and SDA/SCL else you'll fry it.

Hello, I‚Äôm trying to use NPA201 sensor in my project and as a demo code I uploaded the code you gave here on my arduino nano and I make proper connections. At first sensor readings was normal when I turn off and on my computer suddenly pressure readings of NPA201 off the charts, In my area air pressure around 900 -910 mBar but NPA201 shows 1260 mBar when I check air pressure is around 911 mBar when I check the bytes received status byte shows ‚ÄúALU saturation?‚ÄĚ according to application note.

What should I do to fix it?

Serial output of my readings are below,
Arduino Serial monitor hides MSB bit of the status byte because it is 0 and arduino serial monitor doesn’t show leading zeros.

Thank you,

Edit: Added Serial output of my readings before problem.

BeforeProblem Occured,

Raw Pressure (mBar),Temperature (C),1st Byte,2nd Byte,3rd Byte,4th Byte,5th Byte
899.86,29.16,1000100,10100011,11001101,10001101,10100101
899.89,29.28,1000100,10100011,11001111,10001101,11100100
899.89,29.48,1000100,10100011,11001111,10001110,1001011
899.93,29.57,1000100,10100011,11010010,10001110,1111001

After Problem Occured,

Raw Pressure (mBar),Temperature (C),1st Byte,2nd Byte,3rd Byte,4th Byte,5th Byte
1260.00,31.74,1000101,11111111,11111111,10010010,11101010
1260.00,31.72,1000101,11111111,11111111,10010010,11100000
1260.00,31.69,1000101,11111111,11111111,10010010,11010000