Print

Barometer

A simple recording barometer. Based around a widely available off the shelf transducer with a conversion to USB IO.

A real simple project.

Sensor is a Sensym CDX 0811 Baro part. Temperature compensated up to 85°C I2C interface barographic sensor.

Test run on a Deumilove board - sensor connected to standard I2C port ( Analog 4 and 5 ). A very simple sketch got me a NMEA barograph sentence.

$PZXDR,B,0995,m,*00

PZ - Proprietary sentence ID an arbitrary Z
XDR - NMEA Transducer sentence ID
B - Barometer Identifier
0995 - transducer value
m - units - millibars
  • 00 - checksum - Not calculated in this version.

The sketch puts out the barometric pressure sentence at 1 minute intervals to save downstream processing requirements. ( change the Delay (60000); line to 1000 to make it 1 second. )

Baro sketch
#include <Wire.h>
 
// TWI (I2C) sketch to communicate with the Sensym CSDX 0811 BARO digital barograph
// On the Arduino board, Analog In 4 is SDA, Analog In 5 is SCL
// These correspond to pin 27 (PC4/ADC4/SDA) and pin 28 (PC5/ADC5/SCL) on the Atmega8
// The Wire class handles the TWI transactions, abstracting the nitty-gritty to make
// prototyping easy.

// Output to serial USB is in NMEA format
 
void setup()
{
  Wire.begin();
  Serial.begin(4800);
 
}
 
void loop()
{
 
  byte z_val_l, z_val_h, x_val_l, x_val_h, y_val_l, y_val_h;
  int z_val, x_val, y_val;
  // Serial.println("hello?");
  //byte in_byte;
  // transmit to device with address 0x1D
  // according to the LIS3L* datasheet, the i2c address of is fixed
  // at the factory at 0011101b (0x1D)
  Wire.requestFrom(0x78, 2);
  while(Wire.available())
   {
   x_val_h = Wire.receive();
   x_val_l = Wire.receive();
   }

x_val = x_val_h;
x_val *= 256;
x_val += x_val_l;
x_val -= 400;

x_val /= 10.666;
x_val +=800;

Serial.print("$PZXDR,B,");
if (x_val < 1000) Serial.print ("0");
Serial.print(x_val, DEC);
Serial.println(",m,*00");
delay(60000);
}


Now I'm going to try to add a temperature / Relative humidity sensor to the board ( If i can find some old ones I have knocking about here somewhere ) to use a bit more of the processing power available.

I have a couple of these (external link) somewhere which do humidity to digital.

In the meantime I have been working on Java and NMEA. I have adapted some existing open source libs and have got the PC to sit and monitor the prototype barometer. I' am trying to get the results into a JSON file for presentation by a variety of charting packages. My favorite is FlashChart2 so I'll be putting a link in here to the reesults on that platform.




SourceHistory

Calendar


August 2010 - October 2010
S M T W T F S
01 02 03 04 05 06 07
08 09 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 01 02 03 04
05 06 07 08 09 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 01 02
03 04 05 06 07 08 09
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31 01 02 03 04 05 06

Upcoming events

Last blog posts

No records to display