3.1 Program Details / What parts were tricky to write?

Our program's user interface driven menu/options functionality is completely state machine driven. When a user enters a command via RS232, a UDR interrupt handles the user's command and stores it into a command[] array. That command is checked for validity, and then the appropriate state is entered to process their request. In order to make the menus very easy to use, several different sub states are often required for navigating options menus. By default and while not running any user commands, the program sits in an idle state, checking any flags have been changed which will affect its state.

Data collection runs using hardware interrupt based ISRs. This allows the core of the program to run completely independently of and at the same time as the user interface. Timer1 ISR runs every 1ms and is used to keep track of time and as a counter for storing data. Humidity sensor data is read by the external interrupt ISR and humidity is calculated using timer1. The other ISR we use is the ADC interrupt, to process new sensor data and assign it to the correct variables in converted form.

Many separate functions control sub tasks such as graphing, printing data, and changing options. By far, the most difficult part of the program to write was the graphing routines. Because the output is simply an ASCII 48 x 20 graph made up of asterisks, we felt we had to enhance the graphs as much as possible. The temperature graph auto-scales its Y axis based on the maximum and minimum data it has to output. The graphs, and data are fully configurable with difference colors, units, and X-Axis time scale. Making a static graph was our first approach, but adding all of this functionality got complicated fast.

3.2 Hardware Details

The four most important components of the hardware are of course the sensors themselves. There are two temperature sensors, both LM34's. One is attached closely to the breadboard, while the other is held at a distance from the breadboard and connected by wires; this sensor held at a distance is designed to simulate an outdoor temperature sensor. The output of each temperature sensor goes to its own LMC7111 op-amp. We arranged the op-amp with the appropriate resistor values to give it a non-inverting gain of two. This amplifies each of the temperature sensor's outputs, allowing the ADC to produce a value with higher resolution.

The third sensor in our weather station is the pressure sensor. This sensor, the SenSys ASCX15AN works in a rather straightforward manner. It outputs a voltage from 0 to 4.6V that is directly proportional to the absolute pressure, from 0 to 15 psi. We take this voltage and feed it directly to the ADC for conversion.

The fourth sensor is the humidity sensor. This sensor, as stated above, is simply a capacitor with a humidity-sensitive capacitance. It does not directly output a simple voltage like the other sensors of the weather station. Instead, it is connected to a TLC555 chip, along with a few resistors. The output of the setup is fed directly into the microcontroller. The output takes the form of a square wave which has a frequency modulated by the capacitance, which is in turned modified by the humidity. Thus, the microcontroller can extract the humidity by counting rising edges.

3.3 Things Tried Which Did Not Work

One of the things we tried which did not work was some kind of wind indicator. We found several different possible solutions, but none of them seemed like they would be a very realistic solution. We found several products online that were either way over our budget and/or they were completely self contained and impossible to interface with. We investigated using a hall sensor to measure rotation of a wheel blown by wind, but this was complicated enough to be a final project by its self.


High Level Design