Basic Barometer Project 1.4

Purpose

This example shows how to use the on-board barometer sensor (MS5540B) of the AT91SAM7L-EK to retrieve temperature and pressure information.

Hardware Requirements

An AT91SAM7L-EK evaluation kit is required to use this project.

Description

The application connects to the external MS5540B barometer sensor through the SPI to fetch the current temperature and pressure. This information is then displayed on the DBGU.

Since the usual point for pressure is taken at sea level, the measurement obtained from the sensor must be normalized. The algorithm to apply is described in the following application note from the manufacturer (Intersema).

The current altitude is fixed during compilation, but can be modified by changing the appropriate #define in main.c.

Usage

  1. Build the program and download it inside the evaluation board. Please refer to the SAM-BA User Guide, the GNU-Based Software Development application note or to the IAR EWARM User Guide, depending on your chosen solution.
  2. On the computer, open the DBGU port with a terminal application (e.g. HyperTerminal on Microsoft Windows).
  3. Start the application.
  4. The program will immediately start displaying measurements on the DBGU, as shown below:
    -- Basic Barometer Project 1.0 --
    Current altitude is 205m
    Temperature = 26.4 C | Pressure at sea level = 1026.9 mbar
Atmel Corporation ©2008