Digital barometer with graphical LCD display
Source: InternetPublisher:fjub27SH Keywords: LCD digital barometer Updated: 2025/12/16

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.

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
- Equivalent Series Resistance and Low Resistance Tester
- Homemade metal detector
- Economical and practical three-phase rectifier voltmeter
- The making of watermelon ripeness measuring instrument
- Homemade inductive AC voltage tester
- Circuit for measuring battery capacity
- Humidity measurement circuit with temperature compensation
- Production of Sweep Frequency Signal Source
- Accurate current limiter solution for smart meters
- Transistor detector circuit
- Three-phase alternating current detection circuit
- Three-phase power supply phase sequence detection circuit
- AC voltage regulating circuit working condition detection circuit
- A5349 type AC smoke detection circuit - block diagram
- DC recovery light detection circuit that suppresses useless stable background light
- Cable automatic detection circuit
- ADM690~ADM695 constitute a detection circuit (2)
- Interface between LCD 7-segment display and microcontroller
- 4-digit LCD static display circuit
- Optical fiber vibration measurement detection circuit







京公网安备 11010802033920号