9.8. LABORATORY EXERCISE 311
other devices. In this laboratory exercise, you are tasked to build four sensor modules, each built
with a MSP430 controller along with the CC2530-ZNP transceiver: a power meter module, a
heater/ventilation/air-conditioning (HVAC) module,a refrigerator module,and a water heater mod-
Documentation: Users manual for your MSP430 controller board, Users manual for
Pre-Laboratory Exercise: Prepare a ﬂowchart or pseudo-code for your programs to run on
each of the four sensor modules.
Description: One of the main reasons researchers and engineers are looking to build smart
homes is its ability to make ‘smart’ decisions without human intervention. In this exercise, we want
to imbue a level of intelligence to the four sensor module system such that the modules in the system
can coordinate their actions to minimize the overall power use of the house based on a set of desired
house conditions and the time of the day to avoid peak-time use of power. We assume that the power
meter of the house can provide both the rate of power use and a peak-time power use indication
to the other sensor modules in the network. We also assume that both the HVAC module and the
refrigerator module can measure the temperature and the actions of their controllers. Finally, we
assume that the water heater module can detect the water temperature of the water in the water
heater tank and turn on its heater when temperature falls below a pre-set level.
Your tasks are shown below.
1. Program the power meter module to broadcast the overall power use rate (Watts/second)
and a peak-time use indication (a binary value will sufﬁce) to the other three sensor modules
once every minute - use the timer unit function of MSP430 to accomplish this broadcast rate
2. Requirements for the HVAC module: Check the ambient temperature once every minute.
If the ambient temperature falls in the range of 67 to 82 Fahrenheit, do nothing. If it is
below 67 degrees and it is during the non-peak-power usage time, turn on the heater until
the temperature rises to 70 degrees. The heater should turn on when the temperature is below
64 degrees, during the peak-power usage time, and stays on until the temperature rises to
67 degrees. When the temperature rises above 82 degrees, during a non-peak-power usage
time, it should turn on the air conditioner until the temperature falls to 76 degrees. During the
peak-power usage time, turn on the fan only. If the temperature continues to rise to 85 degrees,
turn on the air conditioner until temperature falls to 79 degrees.
3. The only requirement for the refrigerator module is to monitor the ice cube level. If the ice
level is low, generate ice only if it is not during the peak-power usage time.
4. Requirements for the water heater: During the off peak-power usage time, operate normally.
During the peak-power usage time, turn on the water heater only if the water level inside the
water heater tank is below the level pre-speciﬁed (say, 1/4).