MSP430 Temperature Logger – Part 4

Using the temperature monitor in the Incubator, I’ve run into a problem.

Temperature Monitor In Incubator

Temperature Monitor In Incubator

The problem is that the temperature seems to be fluctuating more than I’ve expected. Since we haven’t noticed any problems with the other thermometers, I’m going to assume that the problem is with my code. Perhaps it has something to do with my oversampling code? Do I need to average the samples better? Well, let us take a look at some data. Lets first look at the offending data here.

Wave Data

Wave Data

As you can see, it looks like the data is forming a wave. Is this something cause by the incubator itself. Perhaps noise on the ADC line? Lets look at some more data.

Missing Wave

Missing Wave

This is what the data looks like when the temperature logger is sitting around the house. Notice how it is missing the wave effect.

The following is roughly another 9 days with recording data at fifteen minute intervals. Notice how we still have the wave going on through out the data.

9 Days in Incubator

9 Days in Incubator

Well, after a lot of logging, it seems that we still have a problem. Now I decided, lets record more data, but let us record extra data points. So now instead of just storing the over sampled value, we will also store the average of the over sampled value, the non over sampled value, and the average of non over sampled value. The averages will be from four sequential readings. Here are the results from storing them once every fifteen minutes(so far all the temperature recordings have been taken at 15 minute intervals in hopes of storing an entire incubation period worth of data).

More Data!

More Data!

This new set of data seems to rule out problems with the oversampling; however, it does show that using averaging appears to provide some better results. This still leaves the question, are we still just getting ADC noise? To rule out getting a group of bad readings, let us try recording the temperature every minute and see what that looks like.

Every Minute

Every Minute

This appears to rule out getting noise on the ADC line; however, it does leave a few questions unresolved. Why do the other thermometers not report the same type of behavior? Is this just an problem of observing the analog thermometers at the right time? Is this a sensitivity issue? Perhaps the MSP430 calibration is off?

MSP430 Temperature Logger – Part 3

When running the data logger, I found that I ended up with a big hole in the data that I’ve been storing to flash.

Data Logging Hole

Data Logging Hole

The program is supposed to find the next available memory location for writing.


{
int i;

for (i = 0; i < INTS_TOTAL; i ++) { if (*(INFOE + i) == 0xffff) break; } if (i > INTS_TOTAL)
{
i = 0;
flash_erase(INFOE);
}
next_memory = i;
}

So what is going wrong?

I’ve come up with two possible theories as to the failure. The first idea is that the MSP430 is under powered when attempting to write to flash. The second idea is that the oscillator has not yet stabilized when writing to flash.

Using a voltmeter, I was able to determine that the MSP430 battery voltage was running low when this data was being collected; but why the hole in the data? This could be temperature related. As the temperature drops in the household, this would cause the battery voltage to drop as well. Is that enough to cause the hole? I’m not sure.

Possible solutions?

1) Move the logging event to occur later, as this may allow for the oscillator to stabilize before attempting to write to flash.

2) Ensure that the battery has the proper voltage. This could be done by checking battery voltage manually, or making the MSP430 use the built-in ADC to monitor the battery.

MSP430 Temperature Logger

My family has started incubating eggs, and it has been a real struggle to keep the temperature in the right range. Perhaps it is the incubator, perhaps user error. At any rate, I wanted to lend a hand with my technical know how, so I have begun working on a project. The basic concept is that I want to create a temperature logger to store data for the entire period of incubation, and also an alarm or buzzer for when the temperature is out of bounds. Here are the results for three days of incubating.

Three Days of Logging

Three Days of Logging

The temperature is in F multiplied by 100. Basically 98.00 degrees equals 9800.

For the project I’m using the MSP430 with factory calibrated temperatures. The ADC in the MSP430 is a 10 bit ADC, but is only sensitive to about 0.5 degrees C. To increase the sensitivity, I’m using oversampling to get about 13 bits of accuracy. I then use Integer math to convert the temp to F with two decimal places. I check the temperature every 10 seconds and alarm if the temp is to high or too low.

Right now the data logger is storing temperature at about 15 minute intervals. I need to add a crystal so that I can measure this more precisely, as the times right now are approximate.

The buzzer / alarm is proving a bit problematic for me. Right now, I have a 70 dB buzzer, but it seems to quiet.

The other problem I have is battery life. I’m currently using one or two CR2032s( http://en.wikipedia.org/wiki/CR2032_battery ). When I’m using one battery should last two or maybe three incubations. When I’m using two batteries I need to regulate the voltage, but the current voltage regulator I’m using uses too much power, so battery life is estimated to be roughly 30 hours. The two battery approach may be needed to keep the buzzer well powered. I’m looking at a new LDO voltage regulator, and that should take care of the problem.

I’ll put some pictures up of my temperature logger as I progress. Right now it is in the prototype stages on a breadboard.

Kim