loading

Intel Edison based analog temperature meter.

the TMP36 can read temperatures that are -40 to +120 Celsius BUT the meter only shows temperatures between +40 to about 100 celcius.

Why?

Just because i coded it to show only that temperature range. This meter is in use that uses that kind of range and temperatures lower or higher are not needed.

The meter used is basic aftermarket car water temperature meter.

This is how to use it with Intel Edison and Arduino.

Step 1: Setting Up.

The setup is basic. Look up the two wires from the meter that will move the needle, In my case they were black and green. To do this just hook up something like 5 volts and see how the needle reacts.

The wires go to GND pin and 9 Pin on the board.

Then is the turn for the TMP36. Find more info from the datasheet.

The basic wiring is GND, "data". and Vcc.

Connect GND to Boards GND and "data" to A0 (analog 0) and Vcc to 5 volts on the board.

When that is done, let's start with the coding.

Step 2: Coding

First of all, you will need the information from the meter that how it works in differend positions. To do that load the Triscometer_test.ino file and try it out. The meter will not max out in the test.

After you have figured out the magic numbers for the meter, start writing the main code. Your measurements from the meter may differ from mine.

First the global variables.

// www.instructables.com/member/mkarvonen
//code by Miska Karvonen. //mizka90@hotmail.com

//TMP36 Pin analog input int temperaturePin = 0; int meter = 9; int level = 0; int meterMovement = 5;

Then setup.

void setup()
{ Serial.begin(9600); pinMode(meter, OUTPUT); }

And then the main program. You can see that it has got a lot of IF statements. These statements include all of the information that the meter need's to function at the current heat level. By doing as many IF statements as possible you can ensure that the meter is as accurate as it can be.

void loop()
{ float temperature = getVoltage(temperaturePin); temperature = (temperature - .6) * 100; Serial.println(temperature);

if (temperature <40) { analogWrite(meter, level); level = 0; }

if (temperature >45){ analogWrite(meter, level); level = level + meterMovement; level = 40; meterMovement = -meterMovement; delay(10); } if (temperature >50){ analogWrite(meter, level); level = level + meterMovement; level = 50; meterMovement = -meterMovement; delay(10); }

if (temperature >55){ analogWrite(meter, level); level = level + meterMovement; level = 60; meterMovement = -meterMovement; delay(10); }

if (temperature >60){ analogWrite(meter, level); level = level + meterMovement; level = 70; meterMovement = -meterMovement; delay(10); }

if (temperature >65){ analogWrite(meter, level); level = level + meterMovement; level = 100; meterMovement = -meterMovement; delay(10);

if (temperature >70){ analogWrite(meter, level); level = level + meterMovement; level = 130; meterMovement = -meterMovement; delay(10); }

if (temperature >75){ analogWrite(meter, level); level = level + meterMovement; level = 150; meterMovement = -meterMovement; delay(10); }

if (temperature >80){ analogWrite(meter, level); level = level + meterMovement; level = 180; meterMovement = -meterMovement; delay(10); }

if (temperature >85){ analogWrite(meter, level); level = level + meterMovement; level = 210; meterMovement = -meterMovement; delay(10); } if (temperature >90){ analogWrite(meter, level); level = level + meterMovement; level = 235; meterMovement = -meterMovement; delay(10); }

if (temperature >95){ analogWrite(meter, level); level = level + meterMovement; level = 250; meterMovement = -meterMovement; delay(10); } if (temperature <120){ analogWrite(meter, level); level = level + meterMovement; level = 255; meterMovement = -meterMovement; delay(10); } } delay(100); }

// for the TMP36 float getVoltage(int pin){ return (analogRead(pin) * .004882814); }

Step 3: Temperature Probe.

Solder wires to the TMP36.

I used hot glue to cover up the wires. Heat shrink would be much better but i had none...

Step 4: Simple Case

This case is just a cardboard box.

Why?

It's simple to work with and it hold's everything inside nicely.

Cut a hole for the USB, Temp-probe and the meter wire.

Put Edison in to the box, Connect wires to the board, put the USB cable in.

Close the box, put the meter into it's place and boot up the Edison.

Step 5: Where to Use It?

Note that this probe read's temperatures that are -40 to +120 Celsius BUT the meter only shows temperatures between +40 to about 100 celcius. Why? just because i coded it to show only that temperature range. This meter is in use that uses that kind of range.

If you like to use it in lower temperatures just change the IF statement temperatures from the code.

Here is few examples. In the first picture it shows the air temperature that is coming out of my laptop under heavy usage.

In the second example i measure hot glue gun temperature.

The meter work's pretty well and shows the temperature that it is reading.

Thanks for reading and remember to follow me to get the latest projects first!

Also if you are new, remember to look at my other projects.

HERE is my You Tube channel where you can find videos for many of my projects!

Happy building's!

About This Instructable

1,668views

19favorites

License:

Bio: I am 26 years old engineering student from Oulu in Finland. Currently living in Joensuu. I make these projects as a hobby, and it would ... More »
More by mkarvonen:PipBoy 3000 (working) DIY Piranha Plant Photo(s) to 3D model 
Add instructable to: