Friday, March 29, 2024

Weather Logger

Presented here is a personal weather logger whose various transducers are used to log weather data such as humidity, atmospheric pressure and temperature. The data is transferred to PC where it is displayed as a graph for analysis. -- By Niras C.V.

Presented here is a personal weather logger whose various transducers are used to log weather data such as humidity, atmospheric pressure and temperature. The data is transferred to PC where it is displayed as a graph for analysis.

Fig. 1: Screenshot of weather logger graph
Fig. 1: Screenshot of weather logger graph

The weather logger has the following features:
1. Measures and displays real-time value of humidity, pressure and temperature on the LCD
2. Saves data for 35 hours with sampling interval of 30 minutes in the microcontroller
3. Shows clock/calendar function
4. Has USB connectivity for data transfer to PC
5. stores data in a PC for future analysis
6. Displays a graph in the PC as shown in Fig. 1
7. Sets clock and reference pressure using switches

Circuit and working

The circuit diagram of a weather logger is shown in Fig. 2. The circuit is built around microcontroller PIC18F2550 (IC1), serial real-time clock DS1337 (IC2), temperature sensor LM92 (IC3), humidity sensor SHT11 (IC4), pressure sensor MPX5100 (IC5), 5V voltage regulator 7805 (IC6) and 16×2 LCD display (LCD1).

The circuit requires 5V power supply. The mains power supply is stepped down to 9V AC, 500mA by transformer X1. This stepped-down AC voltage is rectified by bridge rectifier BR1 and filtered by capacitor C1 before it is fed to IC6. Regulator IC6 provides regulated 5V DC supply. LED1 indicates the presence of power in the circuit.

Microcontroller

 The PIC18F2550 microcontroller is the heart of this project. It works with a 20MHz crystal and has 32 kB of flash memory, 2 kB of RAM and 256 bytes of EEPROM. The controller is USB 2.0 compatible with speed of 1.5 Mbps to 12 Mbps. It has three external interrupts, four timer modules (Timer0-Timer3) and 10-bit ADC module with up to 13-channel multiplexer.

- Advertisement -

Real-time clock

The DS1337 serial real-time clock is a low-power clock/calendar chip with two programmable time-of-day alarms and a programmable square-wave output. Address and data are transferred serially through an I2C bus. The clock/calendar provides seconds, minutes, hours, day, date, month and year information. The date at the end of the month is automatically adjusted for months with fewer than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-hour format with AM/PM indication.

Pins 3, 5 and 6 of serial real-time clock IC2 are connected to pins RB2, RB0 and RB1 of IC1, respectively, with pull-up resistors. At pins 1 and 2 of IC2, external crystal oscillator of frequency 32.768 kHz is connected. External 9V battery is used to power the RTC.

Temperature sensor

LM92 is a digital temperature sensor and thermal window comparator with an I2C serial bus interface and an accuracy of ±0.33°C. The window-comparator architecture of the LM92 eases the design of temperature control systems. Its open-drain interrupt (INT) output becomes active whenever temperature goes outside a programmable window, whilst a separate critical temperature alarm (T_CRIT_A) output becomes active when the temperature exceeds a programmable critical limit. The INT output can operate in either a comparator or event mode, whilst the T_CRIT_A output operates in the comparator mode only.

- Advertisement -

The host can program both the upper and lower limits of the window as well as the critical temperature limit. Two pins (A0, A1) are available for address selection.

Pins 1 and 2 of temperature sensor IC3 are connected with pins 21 and 22 of IC1, respectively. The address pins 6 and 7 are connected with Vcc as shown in Fig. 2.

Fig. 2: Circuit diagram of a weather logger
Fig. 2: Circuit diagram of a weather logger
Fig. 3: MPLAB screenshot
Fig. 3: MPLAB screenshot

Humidity sensor

The SHT11 is a single-chip relative humidity and temperature sensor module comprising a calibrated digital output. The device includes a capacitive polymer-sensing element for relative humidity and a band-gap temperature sensor. Both are seamlessly coupled to a 14-bit analogue-to-digital (A/D) converter and a serial interface circuit on the same chip. The 2-wire serial interface and internal voltage regulation allow easy and fast system integration. Pins 3 and 2 of humidity sensor IC4 are connected with pins 12 and 13 of IC1. Pin 2 is pulled up ‘high’ with resistor R9.

Pressure sensor

The MPX5100 series piezoresistive transducer is a monolithic silicon pressure sensor designed for a wide range of applications, particularly those employing a microcontroller or microprocessor with A/D inputs. This single-element transducer combines advanced micromachining techniques, thin-film metallisation and bipolar processing to provide an accurate, high-level analogue output signal that is proportional to the applied pressure.

Pin 1 of pressure sensor IC5 is connected with pin 2 of IC1. IC5 produces analogue output corresponding to the pressure at this pin.

SHARE YOUR THOUGHTS & COMMENTS

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Calculators

×