WEATHER MONITORING SYSTEM
User Requirements Design a weather monitoring system that detects the following parameters Temperature Pressure Relative humidity Wind Speed Wind Direction Rainfall Solar Radiation This information is sent to a remote system every 5 minutes
All parameters sensed - every minute
EEvery 5 minutes – data collected AAveraged & sent to Central computer
CCommunication is Serial WWired RRS232C in null Modem CCommunication Speed is 9600 Baud
Temperature RRange: - 20° C to + 50° C RResolution - 1° C
Wind Speed RRange: MPH RResolution: 0.5 MPH
Wind Direction RRange: 0 to 360° RResolution: 2 o
Pressure RRange: millibars RResolution: 2 millibars
Humidity- Relative Humidity RRange: % RResolution: 1%
Solar Radiation RRange: W/m 2 RResolution: 10W/m 2
Rainfall RRange: mm/min RResolution: 0.1mm /min
WEATHER MONITORING SYSTEM Step 1 of the Design
WHERE TO START ?
SENSORS Analog Output Varying Current Varying Voltage Serial Digital output Pulses/ Second
TEMPERATURE SENSOR SYSTEM SPECIFICATIONS Range: - 20° C to +50° C Resolution: - 1° C WE 700 Output: 4-20mA Range: -50° C to + 50° C Resolution: 2° F or 1° C Operating Voltage: 10-36VDC Warm Up Time: 5 seconds minimum Operating Temperature: - 50°C to +100°C
WIND SPEED SENSOR SENSOR SPECIFICATIONS Range: MPH Resolution: 0.5 MPH WE 550 Output: 4-20mA MPH Resolution:.5 MPH over the range 11 to 55 MPH Operating Voltage: 10-36VDC Warm Up Time: 3 seconds minimum Operating Temp: -40° to +55°C
WIND DIRECTION SENSOR SENSOR SPECIFICATIONS Range: 0 to 360° Resolution: 2 o WE570 Output 4-20 mA Range 0 to 360° Sensitivity 1 m/s (2.2 mph) Resolution 1% full scale Operating Voltage 10 to 36 VDC Warm-up Time 3 seconds minimum Operating Temperature:-40° to +55°C
BAROMETRIC PRESSURE SENSOR SYSTEM SPECIFICATION Range: millibars Resolution: 2 millibars WE 100 Output: 4-20mA Range: millibars Resolution: 0.5% of full scale Operating Voltage: 10-36VDC Warm Up Time: 3 seconds minimum Operating Temp: -40° to +55°C,
RELATIVE HUMIDITY SYSTEM SPECIFICATIONS Range: % Resolution: 1% WE 600 Output: 4-20mA Range: 0-100% RH Resolution: + 0.5% RH Operating Voltage: 10-36VDC Current Draw: 3 mA plus sensor Warm Up Time: 3 seconds minimum Operating Temp: -40° to +55°C
SOLAR RADIATION SENSOR SENSOR SPECIFICATIONS Range: W/m 2 Resolution: 10W/m 2 WE 300 Output: 4-20mA Range: W /m 2 Resolution: 1% of full scale Operating Voltage: 10-36VDC Warm Up Time: 3 seconds minimum Operating Temperature: -40°C to +55°C.
RAINFALL SYSTEM SPECIFICATIONS Range: mm/min Resolution: 0.1mm /min LAMBRECHT – PRECIPITATION SENSOR Output: 4-20mA Range: 0-25 mm/m Resolution: 0.1mm/min Operating Voltage: 10-36VDC Current Draw: 3 mA plus sensor Warm Up Time: 3 seconds minimum Operating Temp: -40° to +55°C
OUTPUT SYSTEM SPECIFICATIONS Communication is Serial Wired RS232C in null Modem Communication Speed is 9600 Baud 16550
TIMING SYSTEM SPECIFICATIONS Every 5 minutes – data collected Every 1 Minute – Data Sensed 8253/8259
WEATHER MONITORING SYSTEM Step 2 Interfacing the sensor
STEP 2 : HOW TO INTERFACE SENSOR TO SYSTEM Analog Current mA Generally Measure Voltage Current to Voltage Conversion ??
CURRENT TO VOLTAGE CONVERSION V 5V
ANALOG TO DIGITAL 7 Analog outputs from 0-5V Size of ADC Resolution of sensor 19.6mv ( 8-bit ADC) (5.0 – 0.0 )V/256
SENSOR RESOLUTION VS ADC RESOLUTIONS TEMPERATURE SENSOR Range: - 20° C to +50° C Resolution: - 1° C 70 5/ mV ADC mV
SENSOR RESOLUTION VS ADC RESOLUTIONS WIND SPEED SENSOR Range: MPH Resolution: 0.5 MPH / mV ADC mV
SENSOR RESOLUTION VS ADC RESOLUTIONS WIND DIRECTION SENSOR Range: 0 to 360° Resolution: 2 o / mV ADC mV
SENSOR RESOLUTION VS ADC RESOLUTIONS PRESSURE SENSOR Range: millibars Resolution: 2 millibars / mV ADC mV
SENSOR RESOLUTION VS ADC RESOLUTIONS RELATIVE HUMIDITY SENSOR Range: % Resolution: 1% / mV ADC mV
SENSOR RESOLUTION VS ADC RESOLUTIONS SOLAR RADIATION SENSOR Range: W/m 2 Resolution: 10W/m / mV ADC mV
SENSOR RESOLUTION VS ADC RESOLUTIONS RAINFALL SENSOR Range: mm/min Resolution: 0.1mm /min / mV ADC mV
STEP 2 : HOW TO INTERFACE SENSOR TO SYSTEM No of analog i/ps-7 8-channel ADC 8-bit 0808 – 8 channel, 8-bit ADC
ADC 0808 IN 0 IN 1 IN 2 IN 3 IN 4 IN 5 IN 6 IN 7 Analog I/ps CLK DB 0 – DB 7 AD 0 AD 1 AD 2 V REF+ V REF- 5V 0V Vcc GND Supply EOC SOC ALE OE 5 V = mV 255
INTERFACE THE ADC
How to interface ADC to 8086 ? ■2 ports available use it for ADC
ADC 0808 IN 0 IN 1 IN 2 IN 3 IN 4 IN 5 IN 6 IN 7 sensors 1 MHz CLK DB 0 – DB 7 PB 0 –PB 7 AD 0 AD 1 AD 2 PC 0 PC 1 PC 2 V REF+ V REF- 5V 0V Vcc GND Supply EOC INTR SOC ALE OE PC 3 PC 4 PC 5
Generate 1 MHz ■Use 8254 ■Any other timing ■Read every 1 Minute
STEP 3 : 1 MHz clock & 5 MIN Interrupt ■Use 8254
CLK 0 GATE 0 OUT 0 5 MHz 5V OUT 1 GATE 1 CLK 1 1 MHz Count = 5 d mode 3 mode 2 CLK 2 GATE 2 OUT 2 5V 1 minute Count =6000 d mode 2 ADC CLK 5 MHz Count = d 5V 100 Hz TIMER INT
STEP 4: Interrupt Generation ■Use 8259
8259 IR 0 INT INTA CAS 0 CAS 1 CAS 2 SP/EN 5V IR 1 Timer ADC
Step 5: Output Interface ■Serial Port Null Modem DTR RTSDSR CTSDCD RXD TXD
STEP 6: How to interface 8255, 8254 & 8259,16550 ■Memory mapped/ IO mapped ? ■Fixed/ Variable addressing ? ■Address ■ H ■90 H - 96 H – 8254 ■A0 H – A2 H ■B0 H - BE H ■Incremental Addressing
LS138 A0A0 G 2A G 1 G 2B I2I1I0I2I1I0 A6A5A4A6A5A4 O1O O0O0 O2O M/IO’ A7A O3O3
STEP 7: HOW to Interface Memory ■How much memory ? ■ROM/RAM? ■RAM – minimum 2k chip- 4k ■ROM – minimum 2k chip – 4k + 4k ■ROM H ■ROM2 FF000 H ■RAM01000 H
LS138 GND G 2A G 1 GND G 2B I2I1I0I2I1I0 A 16 A 13 A 12 O1O1 RAM O0O0 O7O7 ROM 1 ROM 2 M/IO’ A 0 WR’ BHE’ WR’ WRL’ WRH’ Memory Decoder
Interface to the processor 8255 A0A0 A1A1 A1A1 A2A2 CS RD WR RD WR D 0 – D 7 RESET RESET from 8284
8086 A 16 -A 19 S 6 -S 3 BHE’/S 7 LS373 G ALE LS373 G G AD 8 -AD 15 AD 0 -AD 7 OE’ A 16 -A 19 BHE’ A 8 -A 15 A 0 -A 7 MN/MX’ 5V System Bus of 8086 (Address)
8086 AD 8 -AD 15 AD 0 -AD 7 MN/MX’ 5V LS245 DIR LS245 OE’ DIR DT/R’ DEN’ D 8 -D 15 D 0 -D 7 RD WR IO/M MEMR MEMW IOR IOW LOGIC CIRCUIT LS244 OE’ System Bus of 8086(Data + Control) next
CLK RESET MN/MX READY VCC GND HOLD NMI 5 V M Hz 8086 Inputs
Step 8: Software Main Branch to end of IVT Initialize 8255, 8254,8259 A A Start Conversion for sensor Wait for Int All sensors read Y N B B send data Wait for 5 min INT ISR 1 IRET SOC (S1-S6) ISR 2 IRET Read ADC
Step 8: Software - ISR ISR 1 A Start Conversion for sensor All sensors read Y N Send via ISR 2 IRET Read ADC Wait for Int Enable INT A IRET
Initializing 8255 i8255:moval, b out86 H, al
Initializing 8254 i8254:moval, b out8E H, al moval, b out8E H, al moval, b out8E H,al
Initializing 8254 moval,5 out88 H, al moval,0 out88 H, al moval,50h out8A H, al moval,0C3h out8A H, al moval,30h out8C H,al moval,75h out8C H, al
Initialising 8259 I8259:moval, b out90h,al moval, b out92h,al moval, b out92h,al moval, b out92h,al
16550 Initialization ■9600 baud ■8 data ■Odd parity ■1 stop ■SA – F0 H
16550 initialization LINEEQU0A6H LSBEQU0A0H MSBEQU0A2H FIFOEQU0A4H INIT: MOVAL, B OUTLINE,AL MOVAL,120 OUTLSB,AL MOVAL,0 OUTMSB,AL MOVAL, B OUT LINE,AL