Pressure Sensor and Arduino YUN

Hello guys,
I work in a project with Pressure Sensor HSCDRRN002NDAA5 (Honeywell) and Arduino YUN but I can not get any information from the sensor, in resume I use:
Arduino board: Yun
Sensor: Honeywell HSCDRRN002NDAA5, Datasheet: http://www.mouser.com/ds/2/187/HSC%20Analog-221530.pdf
Software: Arduino 1.5.4
Port: COM17 (I’ve checked the port for my Arduino in ‘device manager’ option in Windows)
Library: SSC.h http://playground.arduino.cc/Main/HoneywellTruStabilitySSC-HSCPressureSensors
Code, the basic one of the example:

#include <Wire.h>
#include <SSC.h>

//  create an SSC sensor with I2C address 0x78 and power pin 8.
SSC ssc(0x78, 8);

void setup() 
{
  Serial.begin(115200);
  Wire.begin();
 
  //  set min / max reading and pressure, see datasheet for the values for your 
  //  sensor
  ssc.setMinRaw(0);
  ssc.setMaxRaw(16383);
  ssc.setMinPressure(0.0);
  ssc.setMaxPressure(1.6);
 
  //  start the sensor
  Serial.print("start()\t\t");
  Serial.println(ssc.start());
} 

void loop() 
{
  //  update pressure / temperature
  Serial.print("update()\t");
  Serial.println(ssc.update());
  
  // print pressure
  Serial.print("pressure()\t");
  Serial.println(ssc.pressure());
  
  // print temperature
  Serial.print("temperature()\t");
  Serial.println(ssc.temperature());

  while(1) {
    // use Serial as a command stream
    while(Serial.available()) {
      ssc.commandRequest(Serial);
    } 
    delay(100);
  }
}

I connect the following port of the sensor to Arduino board:
Pin2 → 5V
Pin3 → Pin 8 of Arduino
Pin4 → GND

I can blink my Arduino board then the problem (I suppose) is on the code.

Any advice?

Thanks.

You have not got the write code of this sensor. Or maybe that should be the wrong sensor for the code.

Look fig 1 on page 5 of the data sheet it decodes the part number. The one you have ends in AA5 the 5 says its the 5V version but the AA tells you that it has analog output so you should connect it to one of the analog ports and use analogRead().

The pin names are a clue you would never call an I2C/SPI pin "output".

Mark

Mark

Great, in this way I connect the Pin 3 of the Arduino to the Pin 3 of the sensor and I use the following basic code:

int analogPin = 3;     // potentiometer wiper (middle terminal) connected to analog pin 3
                       // outside leads to ground and +5V
int val = 0;           // variable to store the value read

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

void loop()
{
  val = analogRead(analogPin);    // read the input pin
  Serial.println(val);             // debug value
  delay (100);  
}

I obtain in every moment the value 497, 498 or 499. That's a logic value between 0-1023

My sensor is HSCDRRN 002ND AA5 that means: 002ND = The pressure Range is +-2 in H20 = +-19.6133Pa

But my question is: what unit do Arduino and sensor use? What value is getting my Arduino?in which unit?

To convert different pressure units: http://prevodyonline.eu/en/pressure.html

Thanks.

The analogue port converts voltages between 0 and 5 to a value between 0 and 1023. So, an input of 498 is 5 * (498/1023) which is about 2.43 volts

yes, thanks UKHeliBob, I've just found and my code is:

int analogPin = 3;     // potentiometer wiper (middle terminal) connected to analog pin 3
                       // outside leads to ground and +5V
int val = 0;           // variable to store the value read
float pinVoltage;

void setup()
{
  Serial.begin(9600);          //  setup serial
  pinMode(analogPin, INPUT);
}

void loop()
{
  val = analogRead(analogPin);    // read the input pin
  pinVoltage = val * (5.0 / 1024.0);      //  Calculate the voltage on the A/D pin
                                    //  A reading of 1 for the A/D = 0.0048mV
                                    //  if we multiply the A/D reading by 0.00488 then
                                    //  we get the voltage on the pin.
  Serial.println(val);             // debug value
  Serial.println(pinVoltage,5);
  delay (1000);
  
}

But I divide by 1024 no 1023 because there are 0-1023 = 1024 values My outputs are: 498 2.43164 497 2.42676

Cheers.