Build Your Own Data Logger – We Want Fahrenheit!

Okay, so far this tutorial was quite European based. But you might want to have your data in Fahrenheit. There are two ways of doing this: In the arduino software or in the spreadsheet software. Because I left you with the spreadsheet software Calc in the last post, we will first do it this way. The formula to convert Celsius into Fahrenheit is to multiply the temperature in Celsius by 1.8 and then add 32.

In our spreadsheet software we add a new column and write the formula “=D1*1.8 + 32” for the first of our temperature values in D1:

The formula for converting Celsius into Fahrenheit.

The formula for converting Celsius into Fahrenheit.

Like last time we want a formula to apply for all our data so we write the first and the last cell into our address field, this time it’s “C1:C8484”:

For which cells the formula should apply.

For which cells the formula should apply.

Don’t forget to hit the enter/return key after you wrote this. Now we choose again the “fill–>down” option from our “edit” menu:

Filling the formula into all other fields of this column.

Filling the formula into all other fields of this column.

But our graph is still in Celsius? Don’t worry, we will fix that now. We double-click our diagramm and then go to our “format” menu to choose “data range”.

Changing the data range

Changing the data range

Here we can choose to add and remove columns. If we want to ditch the Celsius, we click on the column D and change the D into a C in the formula:

Changing column D to C.

Changing column D to C.

Changing column D to C.

Changing column D to C.

We see that the column D is now displayed as column C and in the graph we have the Fahrenheit values instead of the Celsius values. If we want to add the Celsius values to the graph again, we choose the Y-values, then “add” and change the “unknown data” to the column with the Celsius values:

Add a column.

Add a column.

Change added column to column D.

Change added column to column D.

By the way, if the color of our graph bothers us, we can change that by double-clicking the line and change the color to whatever we like:

Changing the color of a line.

Changing the color of a line.

And if we want the Fahrenheit right from the start in our Arduino code? well, search for this line:

And change it to:

What? That simple? Yep, the “true” tells the library that you want the temperature values in Fahrenheit. If this value isn’t set or you write dht.readTemperature(false) it shows the value in Celsius. Easy!

Even if you change it in the software, you might like to keep the two conversion formulas in the back of your mind in case you are exchanging temperature data with partners in the U.S. or in other parts of the world:

degree Fahrenheit (°F) = degree Celsius (°C) × 1,8 + 32
degree Celsius (°C) = (degree Fahrenheit (°F) − 32) / 1,8

In the next part we will do some more awesome things with our data, so stay tuned.
Keep your climate lines straight!

Weitere Beiträge zu diesem Projekt:

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmail

This post is also available in: German

Leave a Reply

Your email address will not be published. Required fields are marked *