Homework_5

advertisement
HTC UML Models
Homework 5
Anh Ngo, Michael Lowe, Thang Vo, Jules Alfani
Rev 1.0
[Type the abstract of the document here. The abstract is typically a short summary of the contents of the document. Type the abstract of the
document here. The abstract is typically a short summary of the contents of the document.]
2
HUMIDITY/ TEMPERATURE DATA LOGGER: LEVEL 0
Module
Inputs
Humidity/Temperature Data Logger
o
o
o
-Ambient temperature (0-40 C or equivalent 32 F to 104 F )
-Ambient humidity (0 – 100%)
-Temperature and Humidity limit
-Power from the USB port (5V – 500mA)
Outputs
-Humidity and temperature displayed on the LCD ( +/- 1 % RH, +/- 1 oF)
-Humidity and temperature stored in database in computer
-Alarm triggered when humidity or temperature over the acceptable range
This device measures and displays humidity/temperature on LCD. This information is
also sent to the database and can be plotted in the software for the application. Also,
user can set the limit for the humidity/temperature from the software. Once the
temperature or humidity goes above the limit, it will trigger the alarm
Functionality
Hum/Temp displayed on LCD
Ambient Temp/Hum
Temp/ Hum limit
Humidity/Temperature
Data Logger
Power supply
Temp/ Hum sent to database
Alarm
Figure1. Level 0 of system with input/output
3
HUMIDITY/ TEMPERATURE DATA LOGGER: LEVEL 1
SQL
Database
PC connection
(FTDI chip)
5V
PS
Humidity/Tempe
rature
sensor
(RHT03)
Digitalize
Temp/Hum
(1-wire
interface)
Data transfer
(UART
Interface)
Microcontroller
(Atmega328P)
LCD
4 bit data
(simple I/O)
Simple
I/O
Alarm
Figure2. Level 1 of humidity/temperature data logger system
4
Micro controller: Level 0
Module
Microcontroller
Inputs
-Power supply from USB port
-Digitalize information of humidity/temperature from sensor
-Limit of temperature/humidity from PC
Outputs
-4 bit data communication with LCD
-2 bit data to trigger alarm system
-Temperature/Humidity sent to PC
Functionality
Processing the received data from the sensor, compare with the limit to decide to
turn on the alarm or not. Also sends the data to the PC via USB port.
Power supply
Data sent to LCD
Data from sensor
Data from PC
Control signal for alarm
Microcontroller
(Atmega328P)
Figure3. Level 0 of subcomponent micro controller
5
Data to PC
Sensor RHT03: Level 0
Module
Temperature/Humidity sensor
Inputs
Outputs
-Power supply from USB port
-Handshake signal from micro controller
-Ambient humidity/ temperature
-Digitalize Humidity/Temperature send to micro-controller
Functionality
Sensing the humidity/ temperature environment and convert to digital signals.
Power supply
Control signal from uC
Sensor RHT03
Digitalize Humidity/ Temperature
Ambient Humidity/Temperature
Figure4. Level 0 of subcomponent humidity/temperature sensor
6
Liquid Crystal Display: Level 0
Module
Liquid Crystal Display
Inputs
-Power supply from USB port
-Data from the micro controller
Outputs
Functionality
- Information display on the screen
Display the humidity and temperature to the user
Power supply
Data from the uC
LCD
Figure5. Level 0 of subcomponent LCD
7
Information displayed on the LCD
Alarm System: Level 0
Module
Alarm system
Inputs
-Control signal from micro-controller
-Power supply from the USB
Outputs
-Light from LED
-Sound from Piezo electric
Inform the user that humidity or temperature is over the acceptable range
Functionality
LED blinks
Power supply
Alarm system
Control signal from uC
Buzzer sounds
Figure6. Level 0 of subcomponent alarm system
8
PC Connection: Level 0
Module
PC connection (FTDI)
Inputs
-Power supply from the USB port
-Data from the micro controller (TX pin)
-Data from the PC
-Data to RX pin on ATmega328 micro controller
-Data to PC through USB port
-Power Supply to board.
Connect the PC to the device.
+ Send the limit temp/hum to micro controller
+ Receive the temp/hum from the micro controller to store to the database
Outputs
Functionality
Power supply From
PC
Data from/to PC
Data from the uC
FTDI
Power supply to Board
Figure7. Level 0 of subcomponent PC connection
9
Getting Readings into the Database (Activity View)
Humidity Temperature Data Logger
Temperature/
Humidity
read
from
sensor
Temperature data
and newline sent to
computer
Humidity data and
newline sent to
computer
Temperature data
read from computer
com Port
Humidity data read
from computer com
Port
Data and Current
time
concatenated
into
SQL
insert
command string
10
Command executed
and data is inserted
into the database
UML
STATE MACHINE VIEW
Module
Inputs
Outputs
Humidity-temperature sensor RHT03
- uC sending: microcontroller presenting initialization
signal on the bus
- Request data: microcontroller needs data
- Data ready: the sensor is done with measuring
humidity and temperature
- Data on bus: the sensor present data on the bus
- Finish: the sensor is done with sending data
- Communicating: receiving/sending data
- Gathering: measuring temp and humidity
- Ready: be ready to receive my data
Functionality
11
Download