0% found this document useful (0 votes)
7 views

Weather Logger - Detailed Electronics Project With Source Code

Uploaded by

Lingraj Lingu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Weather Logger - Detailed Electronics Project With Source Code

Uploaded by

Lingraj Lingu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Engineering Projects For You 1500+ Electronics Projects For You Intermediate Projects

Weather Logger
By EFY Bureau

June 5, 2018  17936

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

Fig. 1: Screenshot of weather logger graph

T he 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

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

T he circuit requires 5V power supply. T he mains power supply is stepped down to 9V AC, 500mA by transformer
X1. T his 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
T he 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. T he controller is USB 2.0 compatible with speed of 1.5 Mbps to
12 Mbps. It has three external interrupts, four timer modules (T imer0-T imer3) and 10-bit ADC module with up to
13-channel multiplexer.

- Advertis ement -

Real-time clock
T he 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. T he
clock/calendar provides seconds, minutes, hours, day, date, month and year information. T he date at the end of
the month is automatically adjusted for months with fewer than 31 days, including corrections for leap year. T he
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 RT C.

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. T he 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. T he INT output can operate in either a comparator or event mode, whilst the
T _CRIT _A output operates in the comparator mode only.

- Advertis ement -

T he host can program both the upper and lower limits of the window as well as the critical temperature limit. T wo
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. T he address pins 6
and 7 are connected with Vcc as shown in Fig. 2.

Fig. 2: Circuit diagram of a weather logger


Fig. 3: MPLAB screenshot

Humidity sensor
T he SHT 11 is a single-chip relative humidity and temperature sensor module comprising a calibrated digital
output. T he 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. T he 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
T he 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. T his 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.
Pins 3 through 5 of IC1 are connected with EN, R/W and RS of LCD1 to control the LCD. Pins 25 through 28 of IC1
are connected with D4 through D7 data pins of LCD1. LCD1 shows the time, temperature, pressure and humidity

on the screen. Pins 15 and 16 of IC1 are connected with USB connector at D- and D+ as shown in Fig. 2. Switches
S1 through S4 are used to set the pressure reference and time. Switch S5 is used to reset the microcontroller.

Working of the weather logger is simple. Once powered on, the LCD shows the real-time values of the temperature,
pressure and humidity on the screen. T he microcontroller stores the values of temperature, pressure and humidity
every 30 minutes up to 35 hours. When this system is connected to PC via USB, all stored values of temperature,
pressure and humidity are transferred to the GUI program. T his program displays these values in the form of a
graph on the PC screen. T he ‘time’ is shown on the x-axis, and humidity, pressure and temperature are shown in y-
axis as shown in Fig. 1.

Software

T he software program for the microcontroller is written in ‘C’ language and compiled in MPLAB with C18 compiler.
Add source file as shown in Fig. 3. T he program is burnt in the MCU using a suitable PIC programmer.

Ste ps to run the Visual Studio pro gram in PC (suppo rts o nly 32-bit windo ws o pe rating syste m) are :

1. Do wnlo ad the USB drive rs fro m micro chip we bsite fo r PIC 18F2550 micro co ntro lle r and install the m in
PC .
2. C o nne ct the circuit to PC and co nfirm the co nne ctivity in de vice manage r.
3. Run e xe cutable file o f Visual Studio applicatio n name d ‘ We athe r Lo gge r.’
4. On the le ft-hand side , re al-time value s o f te mpe rature , pre ssure and humidity can be se e n.

Construction and testing


An actual-size, single-side PCB for the weather logger circuit is shown in Fig. 4 and its component layout in Fig. 5.
Assemble the circuit on the recommended PCB to minimise assembly time and errors. Use IC bases for all the ICs.
IC3 and IC4 are SMD ICs, so solder these ICs very carefully at the solder side of the PCB.

Fig. 4: An actual-size, single-side PCB for the weather logger

Fig. 5: Component layout for the PCB

Do wnlo ad the PC B and C o mpo ne nt Layo ut PDF: Click Here

Do wnlo ad So urce C o de : Click Here


T o test the circuit for proper functioning, verify 5V power supply at T P1 with respect to T P0. T he reset to the
system can be checked at T P2.

The author is an M.Tech in VLS I and Embedded S ystems from Cochin University of S cience and Technologies. He is
an electronics hobbyist and amateur radio operator

This article was first published on 13th January 2015.

You might also like