Final Report for Digital Thermostat(full version)

Abstract

A digital thermostat is designed, simulated and tested. The thermostat regulates room temperature according to user input and it is programmable to change room temperature to specific values at specific times. However, the number of modules for this design is 1260 modules which is much larger than ACT1 chip can allowed. So, we are unable to build this design into Act1 chip and do the IC testing. Nevertheless, we are managed to let our design to go through all the simulations (including Actel) and get all the functions working. This ensures that once we have the available resources, we can implement and get our design working in hardware.

This document provides detail report about the design, implementation and simulation of the digital thermostat(full version).

Overview

The overall system for the digital thermostat consists of an FPGA, 5-bit input for current temperature, 8 7-segment displays, push buttons, as well as LED's.

IC Data Sheet

There are total of 34 I/O pins. clock.
Pin TypePin NameFunction
Push Buttons(inputs)set_pgmControls program-setting sequence
set_timeControls time-setting sequence.
set_dayControls day-setting sequence.
holdIncrements day, time, or temperature.
upDecrements day, time, or temperature.
downDecrements day, time andtemperature.
Clock (input)clk(0)These pins are reserved for an external
Current Temp(inputs)C_temp(0)To receive current temperature
C_temp(1)
C_temp(2)
C_temp(3)
C_temp(4)
Indicator Lights(outputs)enter_hrThese lights turn on to prompts user to enter the correct values of hour, minute, and temperature.
enter_min
enter_temp
dayThese lights indicate which entry of a program is being set.
night
holdIndicates whether the program function is turned on or turned off.
Signal to furnace(output)furnaceTurns on/off the furnace.
Signal to Seven Segmentled(0)Each line corresponds to a segment in a seven segment display. Together these lines control what is displayed.
led(1)
led(2)
led(3)
led(4)
led(5)
led(6)
Display Select(output)sel(0)There are a total of 8 seven segment displays in the system, but only one of them is activated at any instance. These lines select which display to activate.
sel(1)
sel(2)
sel(3)
sel(4)
sel(5)
sel(6)
sel(7)

Design Details

The digital thermostat has two main operating modes: normal and configuration. For most of the time, the system is in normal mode. However, when the user modifies parameters such as current time, current day (of the week), or any component of the program, the thermostat runs in the configuration mode.

In the normal mode, the thermostat displays the following information: current time, current temperature, desired temperature, and program status (program is on if light for hold is on, otherwise, it is off). The thermostat periodically (once per minute) compares the current temperature to the desired temperature. If current temperature is below the desired temperature, the furnace will turn on. Otherwise, it will turn off.

It is assumed that the furnace can be controlled by a single signal - turns on when signal is high, and turns off when signal is low. (Inputs and outputs will be discussed in detail in the latter sections.) The comparison period is chosen to be 1 minute to prevent the furnace from switching on and off rapidly. It is also assumed that the room temperature cannot rise or fall rapidly. Therefore, a comparison period of 1 minute should produce good temperature stability without causing damage to the furnace by constantly switching it on and off. At any time, the user can change the desired temperature and switch the program on (desired temperature changes automatically at designated times) and off (desired temperature stays at the current value). Changes to the desired temperature can be carried out through pressing the "up" and "down" buttons, while the "hold" button toggles the on and off of the program function.

In the configuration mode, the user can change various system parameters. The configuration mode can be invoked by pressing one of the following buttons: "set_time" (sets the clock), "set_pgm" (sets program or view the contents of the program). When the "set_time" button is pressed, a light labeled "enter hour" turns on, indicating that the hour of the current time is being changed. Changes can be made by pressing the "up" and "down" buttons. If the "set_time" button is pressed once more, the light "enter hour" turns off and another light labeled "enter minute" turns on. At this time, "up" and "down" buttons can increment or decrement the minute field of the current time. When the "set_time" button is pressed once more, the system exits the configuration mode and goes back to the normal mode of operation.

Before discussing the function of the "set_pgm" button, it should be noted that the thermostat has two programs: day and night. In each program, each time value associated with a desired temperature. As a result, when a designated time is reached, the desired temperature on the thermostat automatically changes to the programmed value. In the normal mode, when the "set_pgm" button is pressed, the system goes into configuration mode. The lights for "enter_hour" and "day" are lit. This means the user is now looking at the day entry of time and temperature for the program. Meanwhile, the display for time and desired temperature now changes to the values stored in the morning part of the weekday program:

At this time, the user can press "up" and "down" to change the hour of the designated time. When "set_time" is pressed again, the light labeled "enter_hr" goes out and is replaced by the "enter_min" light. Pressing "set_time" once more will turn off the "enter_ min" light and turn on the "enter_tmp" light. Now the user can use the "up" and "down" buttons to change the desired temperature for the morning section of the weekday program. The events that occur when "set_pgm" is pressed are summarized in Table 2. As described in Table 2, when all the fields are set, the "set_pgm" sequence terminates and the system returns to normal state.


No. of Times PressedProgramField Being Set
0normal operationnormal operation
1DayHour
2DayMinute
3DayTemperature
4NightHour
5NightMinute
6NightTemperature
7normal operation

Design Verification

In our design, we have decided to use a clock frequency of 1/250 Hz. This is because we are going to display 8 LED's in a cyclic fashion using 1 output (7 pins) from the chip. In order to allow human eyes to view these 8 LEDs as steady output, a minimum clock frequency of 1/30 Hz per LED is required. Thus, we have decided to use the clock frequency of 1/250 Hz. As the initial clock frequency is 1 MHz, we have planned to use 555 timers to slow down the clock. So, throughout the simulation, we will use 1/250 Hz as our clock frequency.

There are total of 17 entities in our design that can be break down as follow: back