Arduino FIO Internal Voltmeter and Thermometer

Let’s extend the low power Ardunio Fio + Xbee setup that I previously blogged about.  I wanted to see if I could create a simple wireless temperature sensor that could allow for long(er) term logging.  Interestingly, the ATmega328P on the Arduino Fio has both a “secret” internal thermometer and internal voltmeter, meaning that I could (potentially) create a wireless sensor with no external additional external components (other than the Fio, XBee, and battery).

So, taking advantage of the available hardware and the code available, I went about creating a wireless temperature logger using an Arduino Fio (available from Amazon.com) and two XBees (one for the Fio and one for the coordinator).

I already have code for a very low power logger setup that takes advantage of the Arduino Fio’s sleep mode as well as the XBee’s hibernation mode (see here).  So, all I needed to do was to add the thermometer and voltmeter code that tinkerit documented.

Here is their internal thermometer example code:

I modified the readTemp() function so that it returned a “human-readable” float in Fahrenheit (my local method of measuring temperature). In addition, I added a small calculation to return a more accurate temperature (calibrated against a thermometer at my house). If you want to calibrate the internal thermometer, put the Arduino Fio into a glass of ice water (I recommend putting it into a plastic bag and vacuuming out as much air as possible!), measure the values it returns, then put it into a cup of hot water, of known temperature, and measure the values it returns. It would be best to have multiple measurements along a series of temperatures, confirmed with a pre-calibrated thermometer (i.e., mercury thermometer). After making the measurements, you can fit a linear model (i.e., best fit line) to the data to get the slope and y-intercept for your device.

I also added their internal voltmeter example code:

The only modification was to convert the decimal to a float for (again) human readable format:

And last, but not least, I’ve been finding “trash data” that can be transmitted when the XBee is woken from hibernation, so I added a sync byte (DEC 170), that allows for easier parsing of the data. Here is some example output from TeraTerm (I measured the ambient temperature for measurements 1-10, then put my thumb onto the ATmega328P for measurements 11 & 12, and then allowed the Arduino to return to ambient for readings 13-20):

[code gutter=”false”]
ª 0 0 0
~
?ª 1 3.303 69.83
~
?ª 2 3.303 69.62
~
?ª 3 3.303 69.62
~
@ª 4 3.303 69.41
~
?ª 5 3.303 69.41
~
?ª 6 3.303 69.83
~
?ª 7 3.303 69.41
~
?ª 8 3.303 68.78
~
?ª 9 3.303 69.20
~
#ª 10 3.303 69.20
~
Ի 11 3.303 72.35
~
(ª 12 3.303 72.77
~
#ª 13 3.303 72.14
~
>ª 14 3.303 72.35
~
?ª 15 3.303 70.88
~
>ª 16 3.303 70.25
~
>ª 17 3.303 69.62
~
>ª 18 3.303 69.41
~
>ª 19 3.303 69.41
~
>ª 20 3.303 68.36
[/code]

Yes, I have poor circulation in my hands (hence only a 3 degree jump). I stored the data for another 30 readings, cut out all of the trash data between the carriage returns (deliminating the readings) and sync characters (which visually show up as “ª” in TeraTerm), removed the initial sync reading, and plotted the temperature data in Mathematica (voltage was constant for the ~50 minutes while I wrote this post):

Nice!

Here’s all of the Arduino Fio SuperSleepyTempAndVolts code:

2 thoughts to “Arduino FIO Internal Voltmeter and Thermometer”

  1. I see the unit stores the data for 8×8 second cycles, what is the maximum number of samples that could be used?
    I’m looking for something that we can use to measure the temperature of guillemot eggs in the wild. The idea being we come back once a week (or more frequently if required daily is possible) and upload the data, rather then being there all the time.

    Thanks
    Patrick

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.