The first part will address the electric imp and how we connect a resistor and Thermistor to create a very simple circuit called a voltage divider and use the imp's built in analog to digital converter to take a reading and calculate what the temperature is. I'll also go into some detail on how the circuit and it's components work.
Remove these ads by
Signing UpStep 1: How it all fits together and what you need
Your web server receives this as parameters attached to the URL, logs it, and displays the result.
You're going to need the following:
• electric imp
• Sparkfun electric imp Breakout (April board)
• Thermistor - NTC 4.7Kohms 2% Radial as the temperature sensor.
• 10k ohm Resistor 1% 1/4W
• Some connectors (I used):
o Stackable Header - 1 x 10 – Standard as it allows me to plug into a breadboard, but also access from the top.
o Break away headers - straight - brake off three pins for the jumper connection to select USB/Battery
• Some hookup wire (I use a 40P 80mm dupont wire, male-male terminated with pins and tear off what I need).
• And a breadboard to put it together on
• A USB cable for power.
I got all my parts from Electron Hobbies.
























































Visit Our Store »
Go Pro Today »




first of all amazing site!!!
i am using your code with a few changes to build a digital meter and i have a question:
you the red box i the picture? how do i get rid of that??
i have never used php...
// Create the file that can be read for live updates in a web browser.
$fw = fopen("latestImpData.txt", 'w');
if(flock($fw, LOCK_EX))
{
fwrite($fw, $target . "|" . $channel . "|" . $dateTime . "|" . number_format($temp, 1) ."|" . number_format($volt, 2) . "|" . $location);
fflush($fw);
flock($fw, LOCK_UN);
}
?>
This is the file that is read by the web page. You can see the fwrite line which creates the string and then writes it to the file.
The contents of your latestImpData.txt file should have:
300e600a779951c4|1|2013-02-09 14:54:54|28.8|3.28|location
I've also posted the files at http://trev.id.au/imp/imp.zip if this makes it easier.
As to accuracy, I haven't used it below freezing (0C) but what I have found is Thermistors are pretty good for general use. I've used this project next to a known outdoor temp sensor for my weather station and it's been within 1C. I would base my decision to use on "if it's 2 degrees out, will it hurt".
Then just change the text in the this to suit so people know what timezone they are seeing.