From PaparazziUAV
Jump to: navigation, search

This site will explain a way, how to use a Analog Microelectronics pressure sensor - AMS 5812 Series, distributed by Amsys.


At first you have to be sure, you've programmed the right I2C address on the sensor chip.
To do this, you can use a programmer device named “AMS 5812 starter kit“ which comes with all the software you need.

Paparazzi addresses

I2C Addresses: The default address of every AMS chip is F0 and it is always reachable, even if you've programmed a other one.

The default addresses defined in the paparazzi driver are:

  • Baro: 0xE4
  • Airspeed: 0xE8

You can change them and many othe sensor specific data in the files:

  • /sw/airborne/modules/sensors/baro_amsys.c
  • sw/airborne/modules/sensors/airspeed_amsys.c

AMSYS addresses

The „AMS 5812 starter kit“ software does not use the first bit of the address.
If you want to know more see:
Because of this you have to program the sensor chips with this addresses:

  • Baro: 0x72
  • Airspeed: 0x74


This is an expample to define the module in the airframe.

<firmware name="fixedwing">
  <define name="USE_I2C0"/>
  <define name="USE_AIRSPEED"/>

  <load name="airspeed_amsys.xml">  
    <define name="AIRSPEED_SCALE" value="1."/>   
    <define name="AIRSPEED_FILTER" value="0.902000010014"/>   
  <load name="baro_amsys.xml">	
    <define name="BARO_FILTER" value="0."/>

USE_AIRSPEED is only needed if you want to control your plane's speed by true airspeed.

This is the calculation which should explain the usage of AIRSPEED_SCALE

1.2041 is the value of the air density.

AIRSPEED_FILTER and BARO_FILTER are values of an TP1 filter:

airspeed_amsys = airspeed_filter * airspeed_old + (1 - airspeed_filter) * airspeed_tmp;
airspeed_old = airspeed_amsys;

The AMSYS Baro driver is only written to measure the height not to use it as an flight variable.