Home > Detection Circuits >Special Measurement and Display Circuits > Digital barometer with graphical LCD display

Digital barometer with graphical LCD display

Source: InternetPublisher:fjub27SH Keywords: LCD digital barometer Updated: 2025/12/16

Digital Barometer with Graphical LCD Display

This is a digital barometer using an Atmega8 microcontroller and a graphical LCD display. This project utilizes an SCP barometer sensor with the graphical LCD display connected to the Atmega8 microcontroller. The graphical LCD displays the latest 128 readings, taken every 20 minutes. You can view information for approximately the last two days. The provided C source code can be customized to your needs.

Digital Barometer with Graphical LCD Display

Record barometer/serial LCD code.

SPI pressure sensor

ATmega8

Serial 128/64 LCD

For chart scaling, one year of barometric pressure data was downloaded from the Tyddington, UK station. The data mean is +/- standard deviation 1012.76 +/- 9.9 mbar. Therefore, to cover a range of two standard deviations, a range of +/- 20 mbar needs to be plotted around the mean of 1013.25 mbar (standard atmosphere). Testing showed that this range is too large for short-term observations. The chart range is currently set by dividing by the constant SCALE=8 (default). Therefore, the pixel range [0,47] corresponds to the mbar range {1032.5, 994.8 mbar}.

/* ATmega8 compilation using -Os (size optimization) */

#include

#include

#include

#include

//#include

//OFFSET converted to sea level altitude, the first barometric pressure sensor value is 2299  

#define OFFSET 2498

#define MINUTES 20 // Minutes for linear regression stress trend

#define SAMPLES 60 // Number of samples per second per minute

// SCALE converts (0.1 millibars to approximately 1 atmosphere) y = 24 - int(pressure millibars - 1013.25) * 10 / SCALE)

#define SCALE 8 //Chart stress scaling factor (divisor)

// Global variable for the circular FIFO data buffer. CBUFSIZE must be a power of 2.

#define CBUFSIZE 128

#define MASK (CBUFSIZE-1)

#define FOSC 8000000 //Internal RC

#define BAUD 9600 // Higher baud rates have poor compatibility with internal RC

#define MYUBRR FOSC/16/BAUD-1

#define sbi(var, mask) ((var) |= (uint8_t) (1

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号