Difference between revisions of "Module/Meas Spec MS5611 I2C"

From PaparazziUAV
Jump to navigation Jump to search
m
(→‎Altitude in Autopilot: added baro example code from chris)
 
(2 intermediate revisions by one other user not shown)
Line 5: Line 5:
== Overview ==
== Overview ==


The Measurement Specialties MS5611 is an excellent barometer/pressure sensor. Currently a plastic case version (-01BA01) and a metal case version (-01BA03) exist. The sensor can be used as I2C or SPI device. This page describes the connection through I2C (the MS5611 mounted on the Aspirin V2.2 uses the SPI port).
The Measurement Specialties MS5611 is an excellent barometer/pressure sensor. Currently a plastic case version (-01BA01) and a metal case version (-01BA03) exist, both with the same functionallity. The metal case was added since the values form the plastic one change under the influence of bright light. The sensor can be used as '''I2C''' or '''SPI''' device.  
 
This page describes the connection through '''I2C'''. Note that the MS5611 mounted on the Aspirin V'''2.2''' uses the SPI port, the Aspirin V'''2.1''' still '''I2C'''


The device was tested in a simple static noise comparsion [[Baro_comparsion|setup]].
The device was tested in a simple static noise comparsion [[Baro_comparsion|setup]].
Line 137: Line 139:
  11.272 123 BARO_MS5611 8049312 8052284 988.77 22.38
  11.272 123 BARO_MS5611 8049312 8052284 988.77 22.38
  11.524 123 BARO_MS5611 8049344 8052330 988.78 22.39
  11.524 123 BARO_MS5611 8049344 8052330 988.78 22.39
=Altitude in Autopilot=
If you want to use it for altitude estimation in the autopilot the following line needs to be added to your airframe file: <define name="USE_BARO_MS5611"/>
Other example how to use the baro from [[IMU#Drotek_10DOF_.28MPU6050-HMC5883-MS5611.29|Drotek 10DOF (MPU6050-HMC5883-MS5611)]]
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
  <modules>
    <!-- baro_ms5611_i2c Alternate address -->
    <load name="baro_ms5611_i2c.xml">
    <define name="MS5611_I2C_DEV" value="i2c2" />
    <define name="MS5611_SLAVE_ADDR=0xEE"/>
    <define name="MS5611_SEND_BARO_ALTITUDE"/>
    <!--<define name="SENSOR_SYNC_SEND"/> -->
  </load>
</modules>
</source>
}}


[[Category:User_Documentation]] [[Category:Modules]]
[[Category:User_Documentation]] [[Category:Modules]]

Latest revision as of 10:22, 21 August 2014

MS5611-01BA01 as part of the FreeIMU 0.4.3
MS5611-01BA01 as part of the multi adapter board

Overview

The Measurement Specialties MS5611 is an excellent barometer/pressure sensor. Currently a plastic case version (-01BA01) and a metal case version (-01BA03) exist, both with the same functionallity. The metal case was added since the values form the plastic one change under the influence of bright light. The sensor can be used as I2C or SPI device.

This page describes the connection through I2C. Note that the MS5611 mounted on the Aspirin V2.2 uses the SPI port, the Aspirin V2.1 still I2C

The device was tested in a simple static noise comparsion setup.

Module name sensors/baro_ms5611_i2c
Sensor type barometer, temperature
Range (baro) 10 kPa .. 1200 kPa
Range (temp) -40°C .. +85°C
Resolution (baro) 1.2 Pa
Resolution (temp) 0.01°C
Refresh rate 4Hz
I2C address 0xEE

Product home page

Hardware

The sensor can directly interface to the 3.3V I2C port of the autopilots and is supplied by +3.3V.

Supplier:

Drotek

CSG

Wiring

Autopilot I2C pin Autopilot I2C MS5611
1 GND GND
2
3 +3.3V VCC
4 SDA SDA
5 SCL SCL


Usage

To use it load the baro_ms5611_i2c module:

File: conf/airframes/myplane.xml
  <modules>
    ...
    <load name="baro_ms5611_i2c.xml"/>
  </modules>

Configuration

To see the sensors data in the log file set the SENSOR_SYNC_SEND in your airframe file. Every time new data is available it will be sent directly.

File: conf/airframes/myplane.xml
  <modules>
    ...
    <load name="baro_ms5611_i2c.xml">
      <define name="SENSOR_SYNC_SEND"/>
    </load>
  </modules>

Result message

The raw values (d1/d2) and the corrected ones (pressure/temp) are written to the log file.

File: conf/messages.xml
  <message name="BARO_MS5611" id="116">
    <field name="d1" type="uint32"/>
    <field name="d2" type="uint32"/>
    <field name="pressure" type="float" unit="hPa" format="%.2f"/>
    <field name="temp" type="float" unit="deg_celsius" format="%.2f"/>
  </message>

The sensors calibration values are read out at init time and transmitted every 30 seconds. They can be seen as some sort of unique serial number.

File: conf/messages.xml
  <message name="MS5611_COEFF" id="117">
    <field name="c0" type="uint16"/>
    <field name="c1" type="uint16"/>
    <field name="c2" type="uint16"/>
    <field name="c3" type="uint16"/>
    <field name="c4" type="uint16"/>
    <field name="c5" type="uint16"/>
    <field name="c6" type="uint16"/>
    <field name="c7" type="uint16"/>
  </message>


Sample log file lines

10.239 123 MS5611_COEFF 8 53136 52817 34048 31158 31184 28953 55558
11.024 123 BARO_MS5611 8049424 8052329 988.8 22.38
11.272 123 BARO_MS5611 8049312 8052284 988.77 22.38
11.524 123 BARO_MS5611 8049344 8052330 988.78 22.39

Altitude in Autopilot

If you want to use it for altitude estimation in the autopilot the following line needs to be added to your airframe file: <define name="USE_BARO_MS5611"/>

Other example how to use the baro from Drotek 10DOF (MPU6050-HMC5883-MS5611)

File: conf/airframes/myplane.xml
  <modules>
     <!-- baro_ms5611_i2c Alternate address -->
     <load name="baro_ms5611_i2c.xml">
     <define name="MS5611_I2C_DEV" value="i2c2" />
     <define name="MS5611_SLAVE_ADDR=0xEE"/> 
     <define name="MS5611_SEND_BARO_ALTITUDE"/>
     <!--<define name="SENSOR_SYNC_SEND"/> -->
   </load> 
</modules>