Arduino Playground is read-only starting December 31st, 2018. For more info please look at this Forum Post

TruStability HSC and SSC Series Pressure Sensors (Digital Output)

Introduction

TruStability High Accuracy Silicon Ceramic (HSC) Series and Standard Accuracy Silicon Ceramic (SSC) Series are piezoresistive silicon pressure sensors offering a digital output for reading pressure over the specified full scale pressure span and temperature range. They are available in standard pressure ranges from 1 psi to 150 psi (60 mbar to 10 bar) and are intended for use with non-corrosive, non-ionic gases, such as air and other dry gases. The liquid media option extends the performance of these sensors to con-corrosive, non-ionic liquids.

The library uses I2C to connect to the sensor (see the Wire library). SPI can also be used (with some sensors, see datasheet), but is not implemented in this library.

If you have multiple devices connected to the I2C bus, remember that this device screws up the bus when it is not powered. One solution is to keep the device powered all the time. Another possible solution is to add an analog switch to physically disconnect the GND and Vsupply line or SCL and SDA line to the device. This needs more testing.

Check your sensor before you begin: some of them work with 3.3V some with 5V.

This library has been tested, but might still contain bugs, so please be careful.

Bugs, suggestions, comments are always welcome here.

Product page

Datasheets

Wiring

Components:

  • An arduino
  • 2 pullup resistors, optional
  • A 3.3V voltage regulator (depending on your sensor)
  • An SSC/HSC sensor

Usage 1: control the sensor from code

#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());

  delay(5000);
}

Usage 2: control the sensor from a stream

Available commands:

  • '1': start the sensor
  • '0': stop the sensor
  • 'a': return the I2C address
  • 'q': return the power pin
  • 'u': update pressure / temperature
  • 'p': return pressure (as a float)
  • 't': return temperature (as a float)
  • 'b': return min pressure (float)
  • 'c': return max pressure (float)
  • 'd': return min reading (raw: uint16_t)
  • 'e': return max reading (raw: uint16_t)
  • 'B': set min pressure (float)
  • 'C': set max pressure (float)
  • 'D': set min reading (raw: uint16_t)
  • 'E': set max reading (raw: uint16_t)


#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
  ssc.start();
}

void loop()
{
  while(Serial.available()) {
    hih.commandRequest(Serial);
  }

  delay(100);
}
 

Download

http://code.google.com/p/arduino-ssc