Last January, we had some trouble with the heat in my office. Specifically, the kind of trouble wherein the heat is not on, you turn it up, and it still not on. This went on for more than a few days, and finally ended a day or two after we got an email announcing that the heat was broken and speculating that it had probably been down for a few days. My teammates and I laughed a bit at this - we knew exactly when the heat had stopped working. We had a continuous record of the temperature in the office going back months, with 10-minute resolution.

You can do this too, and it's quick, cheap, and easy! This little gadget is built around an electric imp, and you can push the data from the imp out to anywhere you want. In my case, I found it handy to push the data to Sparkfun's Data Stream service, which stores the data for free. Even better, I can use imp.guru's Sparkfun Data Stream frontend to get nice graphs of the data I've collected.

This project takes about an hour to two hours, if you've never done a project with an electric imp before, and when you're done you'll have a thermometer that you can toss anywhere with WiFi and collect data for months to years on a single battery, depending on how often you check the temperature.

Step 1: Gather the parts

Here are the parts you'll need to build your internet-connected thermometer:

  1. An electric imp (currently available on Sparkfun and Adafruit) - $30
  2. An electric imp breakout board (again, Sparkfun or Adafruit) - $12.50
  3. A 9V battery - $2.00
  4. A 9V battery clip, like this one from Sparkfun (we're just going to cut the end off of it, so the connector doesn't matter) - $1.25
  5. A big capacitor, like this one on Digikey (220 uF, 50V). Make sure it's at least rated to 16V if you're going to connect it to a 9V battery, or you'll have a bad time. - $0.40
  6. A 100kΩ resistor, preferably 1% tolerance, like this one on Digikey. - $0.10
  7. An NTC (negative-temperature-coefficient) Thermistor. I used this one on Digikey. It needs to have a room-temperature resistance equal to your resistor (#6) - this one is 100kΩ at room temperature. - $3.25

Parts total: $49.50

You'll need some tools and supplies, as well:

  1. Soldering iron
  2. Solder
  3. A bit of foam tape or other thick, double-sided tape for securing the battery to the breakout board
  4. Angle cutters / wire cutters
  5. Wire strippers
  6. A smart phone for using BlinkUp to put the imp on your wifi network
  7. A computer to program the imp

Alright! Let's get started!

Step 2: Wire it up

Check out the breadboard diagram in the photos to see how we'll be wiring up your tempbug.

First, connect the battery clip to the breakout board.

  1. If your battery clip has a connector on the end, cut it off. Strip about 1/8" off the end of each wire and twist the strands to keep them together. If you don't want long leads hanging off your tempbug, you'll want to cut the wire to about 2" long or a little less.
  2. Secure your electric imp breakout board to your work surface and heat up your soldering iron.
  3. One pad at a time, use the soldering iron to heat the "P+" and "P-" battery pads on the breakout board. For each pad, when it gets hot, flow a good-sized bead of solder onto the pad. Take care not to short the pads together.
  4. Place the red lead from the battery clip against the bead of solder on the "P+" pad and heat the pad and wire together with the soldering iron. When the solder flows, hold the parts together and remove the iron. Let the solder cool, then let go.
  5. Repeat previous step with black lead and "P-" pad. Refer to photos to see how this should be arranged. Note that you should follow the label on the board, not right vs. left, as your breakout board may have the pads on opposite sides.

Connect the Capacitor

When the imp turns on its WiFi transmitter, it can draw a lot of current (up to 400 mA, during initial calibration) from your power supply. To keep this sudden current draw from "drooping" the power supply and browning out your tempBug, we've got a BIG HONKING CAP. We'll connect the capacitor in parallel with the battery, the battery will charge the capacitor to the same voltage as the battery, and if the imp suddenly demands more current than the battery can dish out, the capacitor will pitch in to help out.

  1. The leads on the capacitor go through the breakout board at "VIN" and "GND" which are next to each other along the bottom edge of the board. Note that the negative side of the capacitor is marked with a big stripe with a "-" sign in it, and should go to ground
  2. One pad at a time, use the soldering iron to heat the wire and the pad, then flow some solder onto the joint and remove the iron.
  3. When you're all secure, trim the excess from the capacitor leads with your angle cutters or wire cutters.

Connect the Resistor

  1. The 100kΩ resistor can go either way around and is connected between pin9 and 3V3 on the electric imp breakout board.
  2. Bend the wire leads to fit and push them through the holes marked "3V3" and "Pin9".
  3. Just as you did with the capacitor leads, solder ONLY THE 3V3 SIDE to the breakout board. The thermistor needs to share the Pin9 pad with the resistor, so don't solder that side yet!

Connect the Thermistor

  1. Just like the resistor, the thermistor is a passive component and can go either way around. If you bought the same one as me, the wire ends come pre-stripped. Push one end through the Pin9 hole and the other through the hole marked "Pin8".
  2. Now, solder the resistor and thermistor leads together through the Pin9 pad.
  3. Lastly, solder the last thermistor lead into the Pin8 pad.

Alright, all wired up! Let's take a look at what you just built.

Step 3: How's this thing work?

The operating principle behind the tempbug is really simple. All we're doing here is making a resistive divider using a resistor and a thermistor, and measuring the voltage in the middle using an Analog-to-digital converter in the electric imp.

Wait, what's a thermistor?

A thermistor is a temperature-dependent resistor; it has a specific resistance at room temperature, and its resistance varies in a known proportion with the temperature of the component. In our case, we've selected a NTC, or negative-temperature-coefficient thermistor; the resistance of the part will decrease as temperature increases.

Got it, but what's the deal with the resistor?

Together, the resistor and thermistor form a resistive divider; the two resistors, wired up in series (end-to-end) have an effective resistance equal to the sum of their individual resistances. This determines the amount of current that flows through them: V=I*R (ohm's law), V=3.3V (from the imp breakout board's 3.3V on-board power supply), R = the 100kΩ + the thermistor's resistance at the current temperature -> now we know how much current is flowing through the circuit.

Going back to Ohm's Law, we know that the voltage across the thermistor = I*R, where I is the current through the divider (they're in series, so both components see the same current), and R is the current resistance of the thermistor. Therefore, if we can measure the voltage at pin 9, we can solve for the resistance of the thermistor. Given the thermistor's resistance, we can determine the temperature of the part.

Hey wait, the other side of the thermistor isn't connected to ground!

Right you are. It's connected to pin 8. This is a sneaky trick we'll use to save the battery. Current flowing through the resistive divider drains the battery, so we'll only let the current flow when we want to measure the temperature. We do this by programming pin8 to be a digital output. When we set pin 8 high, the voltage drop across the divider is 0V, so no current flows. When we want to take a measurement, we drive pin 8 low and sink current from the divider through the imp.

How do we actually do the measuring?

To measure the voltage across the thermistor, we set up pin 9 as an analog-to-digital converter, which allows us to take an accurate measurement of the analog voltage on the pin using the imp. Check out the software in a few steps to see how that's done.

Step 4: Power up!

Ok, enough math, let's get to the actual temperature-measuring part.

Connect the battery

To secure the battery to the breakout board, a little square of foam tape will do the trick. Cut a small piece off with a pair of scissors and stick the sticky side to the back of the breakout board. Peel back the backing film, and stick the battery on, making sure to keep it nice and square - this stuff is sticky! Once you've got it stuck in place, go ahead and connect the battery clip.

Check the jumper

Make sure the jumper on your breakout board is set to connect the middle pin and the "BAT" pin. Check the photos if you're not sure. If your imp doesn't power up when you click it into the socket, double-check the jumper.

Plug in the imp

Insert your imp into the socket on the breakout board, and it should start to blink red or orange (unless you've connected it before on this network, in which case it will just connect again). Congrats! You're powered up and ready to blink up and program.


If you haven't already registered as an electric imp developer, you'll need to do that now. Head to ide.electricimp.com to sign up (it's free). You'll also need to download the electric imp app on your smart phone, which is also free - just search for "electric imp". Log into the app with the same account credentials you used to register at ide.electricimp.com.

Once you're logged in, add your wireless network to the list of networks in the electric imp app. If you're on iOS, it will prompt you to allow it to use the network you're already on, and you'll just need to add the password yourself. To add a new network manually, select "other network" and type in your SSID and password. Check the "save this network" button!

Once you've added the network, you're ready to configure the device with BlinkUp. Make sure the imp is powered up. If it's powered up but stopped blinking, reset the power by "push-pushing" the card (push once to disconnect, count to 3, push again to reconnect) so you can be sure it's listening for the BlinkUp signal.

Hold the screen of your phone against the top edge of the imp and press "send BlinkUp" in the electric imp app. The screen on your phone will begin to blink quickly for about 10 to 20 seconds, then stop. The imp should blink green once ("got it!"), then start to blink red/orange ("found the network, connecting to the electric imp server"). After a second or so, the imp should be able to phone home to the electric imp server, and will start to blink green. You're connected. Excellent.

Now it's time to program the imp! Head to the next step.

Step 5: Setting your imp firmware

Point your browser to ide.electricimp.com again and log in. This takes you back to the IDE window.

If you've connected this imp breakout board before (you pro), it will pop back up in the IDE under the model it was last a part of. If this is a brand-new breakout board, it will appear in the IDE's left-hand nav panel under "New Devices", at the top of the panel. You'll see a little number in this panel showing the number of new devices there waiting to be configured - probably just one!

Click "New Devices" to see the list of new devices. Again, if you've never configured this device before, it won't have a name, so it will default to a long hex string (this device's Device ID). Click on the small gear next to the device name to open up the settings for the device. This is where you can name the device and assign it a model. Go ahead and name it whatever you like, and create a new model by typing a name for your new model in the model drop-down and pressing enter. When you hit "save changes", you'll be taken to the code window for this new model, and you'll see your new device is now listed under that model in the left-hand nav.

A model has two parts: an agent and a device. The device firmware is simply the code that runs on the imp itself. The agent is that device's partner - a tiny server that runs in the electric imp cloud. The device and agent can send information back and forth, and the agent can talk to the rest of the internet and has its own URL. You get to write code for both of them.

... Or you can use the code that's already written for you :) Head to github, and notice that there are two files here - one for the agent and one for the device. Accordingly, there are two windows for you in the IDE - one will say "agent" and the other "device". Copy the correct code into each window.

If you hit "Build and Run" now, you'll see the device read the temperature and then go to sleep, but the agent will have an error when it tries to log the data to Sparkfun because you haven't added your Sparkfun account yet. Let's do that next. If you did do this, and your device has gone to sleep for 15 minutes, you can disconnect and reconnect power (by simply pulling and re-inserting the jumper) to get the imp to wake up again.

Let's connect your new thermometer to Sparkfun to log the data, then we can come back and take a look at what makes the firmware work.

Step 6: Connecting to Sparkfun Data Stream

To connect your thermometer to Sparkfun, you'll first need to create a new Sparkfun Data Stream. Head to data.sparkfun.com and click on "Create" on the right side of the page.

You'll need to fill in a few details about your new stream: a title, a description, and some data fields. What you call the data fields is important: make sure you create a field called "temp". The electric imp code is set up to post the temperature data with this field name, and if the fields don't match, your code will throw errors. You can create other fields if you want, too, but the only one you need (and the only one your code is already set up to use) is "temp".

Once you've filled in the details and clicked "save", you'll be taken to a page with the keys to your new stream. Save the public and private keys from this page. You'll need to add these keys to your electric imp agent code in order to tell your TempBug which Sparkfun Data Stream to post the data to. Save the stream URL you configured, too - it'll be a quick and easy place to see your data arrive in the Sparkfun stream.

Paste your keys into lines 6 and 7 in the agent back in the electric imp IDE:


Click "Build and Run" in the electric imp IDE to deploy the code that now includes your keys. Your thermometer is probably asleep, so if you want to test it right away, do a quick push-push (push the imp card to eject it from the SD socket, count to 3, push it in to the socket again) to reboot the imp, and you should see the logs report a successful post to Sparkfun!

2015-01-30 09:15:05 UTC-8[Status]Device Booting; 5.14% program storage used
2015-01-30 09:15:05 UTC-8[Agent]PUSH: 200 - 1 success
2015-01-30 09:15:05 UTC-8[Device]sleeping until 1422639001000 2015-01-30 09:16:51 UTC-8[Status]Device disconnected

Point your browser at the Stream URL you configured when you set up your data stream to see the data logged in the Sparkfun stream. Of course, you'll probably want a graph. Good news: that's easy.

Head to imp.guru and you'll find a page that asks for your Sparkfun stream public key. Paste the public key in here and hit enter, and the page will build you a graph of your temperature data!

Let's head back to the code editor and take a look at how the imp is working this magic.

Step 7: Digging into the Code

Imp firmwares are written in an object-oriented language called squirrel, which looks and feels a lot like javascript. Squirrel runs in a virtual machine on top of the imp OS inside the imp, so runtime errors won't knock your device offline, and you have access to a lot of nice OS-based features, like buffered serial input and easy one-line APIs to set GPIOs or communicate with peripheral devices.

To take a look at all the things you can do in your imp firmware, check out the electric imp API reference and electric imp worked examples page. To see which pins can do what, check out the imp pin mux.

Our code here is pretty simple. Here's our basic operating procedure:

  • Set some constants
  • Define a class for our temperature sensor
  • Instantiate our class to create a temperature sensor object
  • Read the Temperature Sensor
  • Send the datapoint to the agent
  • Schedule ourselves to wake up in a bit and do it all again

The constants on lines 8 and 9 look a little ominous, but they're simple. These are the parameters for your thermistor - you can find them on the datasheet for the thermistor you're using. If you're using the thermistor I linked to earlier, you can even keep the parameters already set here.

Lines 20 to 71 are a class definition - this is basically a set of instructions for how to do various important things with a thermistor, like read the temperature. This comes straight from github - it's a nice, modular piece of code so that it can easily be reused.

After that, we just need to define our high-level logic. On lines 79 to 83, we configure the two pins we're using. Remember from when we built the device - one of the pins is an enable pin, which will allow current to flow through the thermistor when it is set low. The other pin is our analog input pin, which we'll use to read the voltage across the thermistor.

// Configure Pins
// pin 8 is driven high to turn off temp monitor (saves power) or low to read
therm_en_l <- hardware.pin8;
// pin 9 is the middle of the voltage divider formed by the NTC - read the analog voltage to determine temperature
temp_sns <- hardware.pin9;

On Line 86, we call on our class definition from earlier to create a thermistor object. This object takes in the constants we set earlier, and has methods that allow us to read the temperature in Celsius or Fahrenheit.

// instantiate our thermistor class
myThermistor <- thermistor(temp_sns, b_therm, t0_therm, 10, false);

Lines 88 to 96 are where the magic happens - we enable the sensor, take a reading, send it to the agent, and disable the sensor again to save battery.

local id = hardware.getdeviceid();
local datapoint = {
    "id" : id,
    "temp" : format("%.2f",myThermistor.read_f()),

And lastly, schedule a wakeup in fifteen minutes. We'll go to deep sleep in the mean time, saving the battery:

//Sleep for 15 minutes and 1 second, minus the time past the 0:15
//so we wake up near each 15 minute mark (prevents drifting on slow DHCP)
imp.onidle( function() { 
    //server.sleepfor(1 + 15 - (time() % (WAKEINTERVAL_MIN*15)));
    server.sleepfor(1 + WAKEINTERVAL_MIN*60 - (time() % (WAKEINTERVAL_MIN*60))); 

That's the device firmware - let's take a look at the agent. You've already seen part of the agent - we set the Sparkfun Public Key and Private Key lines 6 and 7 of the agent earlier. Below that, we have another class definition; this one defines methods for interacting with a Sparkfun Data Stream.

Lines 62 to 65 are a really interesting bit of code - this is the hook that the agent uses to receive new temperature data from the device. This is done by registering an agent "callback" with agent.on. This says, "when the device sends you an event called "temp", call the following function with the data marked with that tag". Looking back at line 95 of the device firmware, we see that we sent data marked "temp" with a function called "agent.send". This is where that data went!

device.on("data", function(datapoint) {
    local resp = stream.push({"temp": datapoint.temp});
    server.log(format("PUSH: %i - %s", resp.statuscode, resp.body));

Lastly, we see the agent do two things when it first starts running. The first: it sends a log message letting us know that it started and is ready to get data. Second, it instantiates a Sparkfun Data Stream object with the class we defined earlier, letting us use the methods of those classes to send data to Sparkfun as it comes in.

The agent doesn't restart or sleep; it starts the first time the device boots with this model, and continues to run forever, handling each new datapoint when it comes in by calling the "device.on" callback. It's the device's brain in the cloud!

That's the firmware! Enjoy your new Internet-connected thermometer.

<p>This device looks to fit my needs exactly, but does anyone know what the accuracy is at temperatures of -20 degrees Celsius +/- 15 degrees C.?</p>
<p>The accuracy would be dependent on the thermistotr you select. The IMP and database provide .01 degree resolution using the agent and device code.</p>
<p>This device looks to fit my needs exactly, but does anyone know what the accuracy is at temperatures of -20 degrees Celsius +/- 15 degrees C.?</p>
Awesome tutorial, how do you graph the data?<br><br>Also, the time stamp on the Sparkfun Stream is 3 hours ahead of the device. Any thoughts?
<p>Hi there. It's fantastic. So straightforward, worked first time and tells me exactly how (and if) my solar PV panels are heating my hot water through an ImmerSUN device. I didn't thin k it wasm but this Tempbug proves it is doing exactly as it should. I have it monitoring the hot-water pipe leading out of the tank. I would really like to also be able to monitor the 9v battery voltage too, so I know when to change the battery. I have tried to follow Lathyrus's code, but I get completely lost. and very cold feet! Are there any <strong>simple</strong> lines of code I can insert into Tombrew's code that will give me this, without breaking what already works? If it ain't broke ...! Thank you all. I am alos using Luke Beno's excellent Analog.io to see the data logged in Sparkfun, as imp.guru is no longer available. Brilliant!</p>
<p>Hi there and thanks for the tutorial. I built the TempBug on a breadboard and when it runs I get nothing in the datastream. I the code, I only changed the b_therm value (4600 for my thermistor) and obviously, the keys from sparkfun.</p><p>The log shows something like:</p><p>expecting: batteryvoltage, temp</p><p>2015-06-16 20:45:03 UTC+3[Status]Device connected</p><p>2015-06-16 20:45:03 UTC+3[Status]Device disconnected</p><p>2015-06-16 20:45:03 UTC+3[Device]sleeping until 1434477601000</p><p>2015-06-16 20:45:03 UTC+3[Agent]PUSH: 400 - 0 batteryvoltage missing from sent data.</p><p>Any ideas on where I could start troubleshooting?</p><p>Thanks in advance,</p><p>Marius</p>
<p>Well ... this is just random. Now I soldered the parts on the breakout board and I get single digit values :|</p>
<p>UPDATE: The cod will work only if I remove the &quot;batteryvoltage&quot; tag from sparkfun. But now I'm getting huge values for my temp in celsius ... 150 degrees</p>
<p>This is the first time I've ever made anything like this. I found the instructions to be very detailed and helpful. But I'm not sure why I can't get my Tempbug to work. Here is an example of the idea log I am getting:</p><table><tbody><tr><td>2015-05-30 23:16:14 UTC-7</td><td>[Status]</td><td>Device connected</td></tr><tr><td>2015-05-30 23:16:15 UTC-7</td><td>[Device]</td><td>ERROR: the index 'device' does not exist</td></tr><tr><td>2015-05-30 23:16:15 UTC-7</td><td>[Device]</td><td>ERROR: at main:63</td></tr><tr><td>2015-05-30 23:16:20 UTC-7</td><td>[Status]</td><td>Device disconnected</td></tr><tr><td>2015-05-30 23:16:20 UTC-7</td><td>[Status]</td><td>Device connected</td></tr><tr><td>2015-05-30 23:16:20 UTC-7</td><td>[Device]</td><td>ERROR: the index 'device' does not exist</td></tr><tr><td>2015-05-30 23:16:20 UTC-7</td><td>[Device]</td><td>ERROR: at main:63</td></tr><tr><td>2015-05-30 23:16:25 UTC-7</td><td>[Status]</td><td>Device disconnected</td></tr></tbody></table><p>Can you help me understand what I may have done wrong and how I might be able to fix it?</p>
<p>Could you use a 9v wallwart or a USB wall charger instead of a battery(you could use a small solar panel and run indefinetly) ? And, could you print the data to an excel sheet? Could you manage several of these and have them all printed in one excel?</p><p>This Seems more practical for me at least. Im no expert but these conversions dont seem very difficult.</p>
Wow! Despite not having soldered anything for about 30 years, I was able to build this thermometer without any real difficulty in a couple of hours, and I understand how it works! Thanks Tombrew for the excellent instructions. The only problem I had was that the guy in Maplins gave me the wrong size fixed resistor, so the first time I built it the reading in my livingroom was a chilly -159 degrees C... but with the correct 100k Ohm resistor everything is fine. I also couldn't get blinkup to work with my Sony Android phone so I had to borrow my wiffe's iPhone to do the setup. And getting Xively (Cosm) to draw graphs was tricky until I figured out that I needed a MASTER API key, available under the Settings tab.
<p>Follow-up: The tempbug has been running smoothly in my attic for 9 months now. My first 9 volt battery lasted only a month, checking the temperature every 15 mins. So I changed the interval to 2 hours and my second battery lasted 6 months. I also noticed that the first temperature reading in each cycle is a bit higher than the others (by about 0.5 degree, I don't know why) so I modified the code to ignore the first reading and average the next 10:</p>2014-07-14 06:00:08 UTC+1[Device]ignore: voltage: 3.315 temp: 19.4 C2014-07-14 06:00:08 UTC+1[Device]loop: 0 voltage: 3.313 temp: 18.9 C2014-07-14 06:00:08 UTC+1[Device]loop: 1 voltage: 3.311 temp: 18.4 C2014-07-14 06:00:08 UTC+1[Device]loop: 2 voltage: 3.311 temp: 18.2 C2014-07-14 06:00:08 UTC+1[Device]loop: 3 voltage: 3.311 temp: 18.1 C2014-07-14 06:00:08 UTC+1[Device]loop: 4 voltage: 3.313 temp: 18.2 C2014-07-14 06:00:08 UTC+1[Device]loop: 5 voltage: 3.309 temp: 18.3 C2014-07-14 06:00:08 UTC+1[Device]loop: 6 voltage: 3.311 temp: 18.2 C2014-07-14 06:00:08 UTC+1[Device]loop: 7 voltage: 3.313 temp: 18.2 C2014-07-14 06:00:08 UTC+1[Device]loop: 8 voltage: 3.311 temp: 18.6 C2014-07-14 06:00:08 UTC+1[Device]loop: 9 voltage: 3.311 temp: 18.1 C<p>Building and programming the Imp was so much fun that I bought 2 more and made a phone-controlled electric gate opener, and a gizmo for forcibly rebooting my Wowwee Rovio...</p><p>Thanks again Tombrew for the great intro and instructions!</p>
<p>how did you change to a 2 hour interval? was it in the code inserted into electric imp? if so where?</p>
<p>Here's the complete Device and Agent code that I'm using. It logs the temperature on odd-numbered hours (1 a.m., 3. a.m. etc). It uploads to Xively the temperature (Celsius), WiFi signal strength, battery voltage, and lag (how long it took to do the measurement cycle).</p><blockquote><br></blockquote><blockquote>//KW tempbug device code v2 20nov2013</blockquote><blockquote>// April with a 100k resistor from 3V3 to pin9 and 100k NTC Thermistor from pin9 to pin8</blockquote><blockquote>// pin8 TEMP_READ_EN_L - drive low to enable temp reading (great for batteries!)</blockquote><blockquote>// pin9 ANALOG NTC value</blockquote><blockquote>// benchmarking runtime: first tick with hardware.micros</blockquote><blockquote>local tick = hardware.micros();</blockquote><blockquote>// turn on WiFi powersave to reduce power consumption when awake</blockquote><blockquote>// WiFi is not used until line 44 (no communication with agent until end of program)</blockquote><blockquote>imp.setpowersave(true);</blockquote><blockquote>// Configure Pins</blockquote><blockquote>// pin 8 is driven high to turn off temp monitor (saves power) or low to read</blockquote><blockquote>hardware.pin8.configure(DIGITAL_OUT);</blockquote><blockquote>hardware.pin8.write(1);</blockquote><blockquote>// pin 9 is the middle of the voltage divider formed by the NTC - read the analog voltage to determine temperature</blockquote><blockquote>hardware.pin9.configure(ANALOG_IN);</blockquote><blockquote>// all calculations are done in Kelvin</blockquote><blockquote>// these are constants for this particular thermistor; if using a different one,</blockquote><blockquote>// check your datasheet</blockquote><blockquote>const b_therm = 4450;</blockquote><blockquote>const t0_therm = 298.15;</blockquote><blockquote>// turn on the thermistor network</blockquote><blockquote>hardware.pin8.write(0);</blockquote><blockquote>// gather several pin9 ADC and battery voltage readings and average them </blockquote><blockquote>// (just takes out some noise)</blockquote><blockquote>local val = 0;</blockquote><blockquote>local v_high = 0;</blockquote><blockquote>//skip first measurement (always low)</blockquote><blockquote>imp.sleep(0.01);</blockquote><blockquote>local val_now=hardware.pin9.read(); </blockquote><blockquote>local v_high_now=hardware.voltage();</blockquote><blockquote>local v_therm = v_high_now * val_now / 65535.0;</blockquote><blockquote>local r_therm = 100000.0 / ( (v_high_now / v_therm) - 1);</blockquote><blockquote>local ln_therm = math.log(100000.0 / r_therm);</blockquote><blockquote>local t_therm = (t0_therm * b_therm) / (b_therm - t0_therm * ln_therm) - 273.15;</blockquote><blockquote>local t_str = format(&quot;%.01f&quot;, t_therm);</blockquote><blockquote>local batt_str = format(&quot;%.03f&quot;,v_high_now);</blockquote><blockquote>server.log(&quot;ignore: voltage: &quot; +batt_str +&quot; temp: &quot; +t_str+&quot; C&quot;);</blockquote><blockquote>//then measure 10 times</blockquote><blockquote>for (local i = 0; i &lt; 10; i++) {</blockquote><blockquote> imp.sleep(0.01);</blockquote><blockquote> val_now = hardware.pin9.read();</blockquote><blockquote> v_high_now = hardware.voltage();</blockquote><blockquote> v_therm = v_high_now * val_now / 65535.0;</blockquote><blockquote> r_therm = 100000.0 / ( (v_high_now / v_therm) - 1);</blockquote><blockquote> ln_therm = math.log(100000.0 / r_therm);</blockquote><blockquote> t_therm = (t0_therm * b_therm) / (b_therm - t0_therm * ln_therm) - 273.15;</blockquote><blockquote> t_str = format(&quot;%.01f&quot;, t_therm);</blockquote><blockquote> batt_str = format(&quot;%.03f&quot;,v_high_now);</blockquote><blockquote> server.log(&quot;loop: &quot; +i +&quot; voltage: &quot; +batt_str +&quot; temp: &quot; +t_str+&quot; C&quot;);</blockquote><blockquote> val += val_now;</blockquote><blockquote> v_high += v_high_now;</blockquote><blockquote>}</blockquote><blockquote>val = val/10;</blockquote><blockquote>v_high = v_high / 10.0;</blockquote><blockquote>// turn the thermistor network back off</blockquote><blockquote>hardware.pin8.write(1);</blockquote><blockquote>// scale the ADC reading to a voltage by dividing by the full-scale value and multiplying by the supply voltage</blockquote><blockquote>local v_therm = v_high * val / 65535.0;</blockquote><blockquote>// calculate the resistance of the thermistor at the current temperature</blockquote><blockquote>local r_therm = 100000.0 / ( (v_high / v_therm) - 1);</blockquote><blockquote>local ln_therm = math.log(100000.0 / r_therm);</blockquote><blockquote>local t_therm = (t0_therm * b_therm) / (b_therm - t0_therm * ln_therm) - 273.15;</blockquote><blockquote>// format into a string for the string output port</blockquote><blockquote>local t_str = format(&quot;%.01f&quot;, t_therm);</blockquote><blockquote>server.log(&quot;Current temp is &quot;+t_str+&quot; C&quot;);</blockquote><blockquote>// update the current battery voltage with a nicely-formatted string of the most recently-calculated value</blockquote><blockquote>local batt_str = format(&quot;%.03f&quot;,v_high);</blockquote><blockquote>server.log(&quot;Battery Voltage is &quot;+batt_str);</blockquote><blockquote>// benchmarking runtime</blockquote><blockquote>local tock = hardware.micros();</blockquote><blockquote>server.log(format(&quot;Read cycle took %d us&quot;, (tock-tick)));</blockquote><blockquote>local lag = ((tock-tick)/1000000.0);</blockquote><blockquote>local lag_str = format (&quot;%.06f&quot;,lag);</blockquote><blockquote>//log WiFi signal strength</blockquote><blockquote>function ReportRSSI() {</blockquote><blockquote> local rssi = imp.rssi();</blockquote><blockquote> if (rssi &lt; -87) {</blockquote><blockquote> server.log(&quot;WiFi signal is: &quot; + rssi + &quot; dBm (0 bars)&quot;);</blockquote><blockquote> }</blockquote><blockquote> else if (rssi &lt; -82) {</blockquote><blockquote> server.log(&quot;WiFi signal is: &quot; + rssi + &quot; dBm (1 bar)&quot;);</blockquote><blockquote> }</blockquote><blockquote> else if (rssi &lt; -77) {</blockquote><blockquote> server.log(&quot;WiFi signal is: &quot; + rssi + &quot; dBm (2 bars)&quot;);</blockquote><blockquote> }</blockquote><blockquote> else if (rssi &lt; -72) {</blockquote><blockquote> server.log(&quot;WiFi signal is: &quot; + rssi + &quot; dBm (3 bars)&quot;);</blockquote><blockquote> }</blockquote><blockquote> else if (rssi &lt; -67) {</blockquote><blockquote> server.log(&quot;WiFi signal is: &quot; + rssi + &quot; dBm (4 bars)&quot;);</blockquote><blockquote> }</blockquote><blockquote> else {</blockquote><blockquote> server.log(&quot;WiFi signal is: &quot; + rssi + &quot; dBm (5 bars)&quot;);</blockquote><blockquote> }</blockquote><blockquote> return rssi;</blockquote><blockquote>}</blockquote><blockquote>local rssi = ReportRSSI();</blockquote><blockquote>//attempt to send it to Xively...</blockquote><blockquote>agent.send(&quot;Xively-temp&quot;, t_str); // send data to Xively</blockquote><blockquote>agent.send(&quot;Xively-lag&quot;, lag_str); // send data to Xively</blockquote><blockquote>agent.send(&quot;Xively-battery&quot;, batt_str); // send data to Xively</blockquote><blockquote>agent.send(&quot;Xively-rssi&quot;, rssi); // send data to Xively</blockquote><blockquote>// wake up every 2 hours on odd-numbered hours (prevents drifting on slow DHCP)</blockquote><blockquote>imp.onidle( function() {</blockquote><blockquote> local secsToEvenHour = (1+ 120*60 - (time()%(120*60)) );</blockquote><blockquote> local secsToOddHour = secsToEvenHour - (60*60);</blockquote><blockquote> if (secsToOddHour &lt; 0) {secsToOddHour += (120*60);}</blockquote><blockquote> local snoozelength = secsToOddHour;</blockquote><blockquote> server.log(&quot;snoozing for &quot; + (snoozelength / 60) + &quot; minutes and &quot; + (snoozelength % 60) + &quot; seconds&quot; );</blockquote><blockquote> server.sleepfor(snoozelength);</blockquote><blockquote>});</blockquote><blockquote>// full firmware is reloaded and run from the top on each wake cycle, so no need to construct a loop</blockquote><blockquote>##################### CUT HERE ######################</blockquote><blockquote>//KW tempbug agent code v2 20nov2013</blockquote><blockquote>//********************BEGIN XIVELY********************</blockquote><blockquote>//Code written by @beardedinventor modified for use by Joel Wehr</blockquote><blockquote>API_Key &lt;- &quot;pdyL6p9fp9zVtakiNqFGTaKGXPwqnMuxCdfM7258b1D8D6LI&quot;; //Type your Xively API Key</blockquote><blockquote>Feed_ID &lt;- &quot;1282406454&quot; //Type your Feed ID</blockquote><blockquote>/// Channel_ID &lt;- &quot;thermistor&quot;; //Type your Channel ID -- modified by KW - see bottom of program</blockquote><blockquote>Xively &lt;- {}; // this makes a 'namespace'</blockquote><blockquote>class Xively.Client {</blockquote><blockquote> ApiKey = null;</blockquote><blockquote> triggers = [];</blockquote><blockquote> constructor(apiKey) {</blockquote><blockquote> this.ApiKey = apiKey;</blockquote><blockquote> }</blockquote><blockquote> /*****************************************</blockquote><blockquote> * method: PUT</blockquote><blockquote> * IN:</blockquote><blockquote> * feed: a XivelyFeed we are pushing to</blockquote><blockquote> * ApiKey: Your Xively API Key</blockquote><blockquote> * OUT:</blockquote><blockquote> * HttpResponse object from Xively</blockquote><blockquote> * 200 and no body is success</blockquote><blockquote> *****************************************/</blockquote><blockquote> function Put(feed){</blockquote><blockquote> local url = &quot;https://api.xively.com/v2/feeds/&quot; + feed.FeedID + &quot;.json&quot;;</blockquote><blockquote> local headers = { &quot;X-ApiKey&quot; : ApiKey, &quot;Content-Type&quot;:&quot;application/json&quot;, &quot;User-Agent&quot; : &quot;Xively-Imp-Lib/1.0&quot; };</blockquote><blockquote> local request = http.put(url, headers, feed.ToJson());</blockquote><blockquote> return request.sendsync();</blockquote><blockquote> }</blockquote><blockquote> /*****************************************</blockquote><blockquote> * method: GET</blockquote><blockquote> * IN:</blockquote><blockquote> * feed: a XivelyFeed we fulling from</blockquote><blockquote> * ApiKey: Your Xively API Key</blockquote><blockquote> * OUT:</blockquote><blockquote> * An updated XivelyFeed object on success</blockquote><blockquote> * null on failure</blockquote><blockquote> *****************************************/</blockquote><blockquote> function Get(feed){</blockquote><blockquote> local url = &quot;https://api.xively.com/v2/feeds/&quot; + feed.FeedID + &quot;.json&quot;;</blockquote><blockquote> local headers = { &quot;X-ApiKey&quot; : ApiKey, &quot;User-Agent&quot; : &quot;xively-Imp-Lib/1.0&quot; };</blockquote><blockquote> local request = http.get(url, headers);</blockquote><blockquote> local response = request.sendsync();</blockquote><blockquote> if(response.statuscode != 200) {</blockquote><blockquote> server.log(&quot;error sending message: &quot; + response.body);</blockquote><blockquote> return null;</blockquote><blockquote> }</blockquote><blockquote> local channel = http.jsondecode(response.body);</blockquote><blockquote> for (local i = 0; i &lt; channel.datastreams.len(); i++)</blockquote><blockquote> {</blockquote><blockquote> for (local j = 0; j &lt; feed.Channels.len(); j++)</blockquote><blockquote> {</blockquote><blockquote> if (channel.datastreams[i].id == feed.Channels[j].id)</blockquote><blockquote> {</blockquote><blockquote> feed.Channels[j].current_value = channel.datastreams[i].current_value;</blockquote><blockquote> break;</blockquote><blockquote> }</blockquote><blockquote> }</blockquote><blockquote> }</blockquote><blockquote> return feed;</blockquote><blockquote> }</blockquote><blockquote>}</blockquote><blockquote>class Xively.Feed{</blockquote><blockquote> FeedID = null;</blockquote><blockquote> Channels = null;</blockquote><blockquote> constructor(feedID, channels)</blockquote><blockquote> {</blockquote><blockquote> this.FeedID = feedID;</blockquote><blockquote> this.Channels = channels;</blockquote><blockquote> }</blockquote><blockquote> function GetFeedID() { return FeedID; }</blockquote><blockquote> function ToJson()</blockquote><blockquote> {</blockquote><blockquote> local json = &quot;{ \&quot;datastreams\&quot;: [&quot;;</blockquote><blockquote> for (local i = 0; i &lt; this.Channels.len(); i++)</blockquote><blockquote> {</blockquote><blockquote> json += this.Channels[i].ToJson();</blockquote><blockquote> if (i &lt; this.Channels.len() - 1) json += &quot;,&quot;;</blockquote><blockquote> }</blockquote><blockquote> json += &quot;] }&quot;;</blockquote><blockquote> return json;</blockquote><blockquote> }</blockquote><blockquote>}</blockquote><blockquote>class Xively.Channel {</blockquote><blockquote> id = null;</blockquote><blockquote> current_value = null;</blockquote><blockquote> constructor(_id)</blockquote><blockquote> {</blockquote><blockquote> this.id = _id;</blockquote><blockquote> }</blockquote><blockquote> function Set(value) {</blockquote><blockquote> this.current_value = value;</blockquote><blockquote> }</blockquote><blockquote> function Get() {</blockquote><blockquote> return this.current_value;</blockquote><blockquote> }</blockquote><blockquote> function ToJson() {</blockquote><blockquote> local json = http.jsonencode({id = this.id, current_value = this.current_value });</blockquote><blockquote> server.log(json);</blockquote><blockquote> return json;</blockquote><blockquote> }</blockquote><blockquote>}</blockquote><blockquote>client &lt;- Xively.Client(API_Key);</blockquote><blockquote>//********************END XIVELY********************</blockquote><blockquote>device.on(&quot;Xively-temp&quot;, function(v) {</blockquote><blockquote> channel1 &lt;- Xively.Channel(&quot;temperature&quot;);</blockquote><blockquote> channel1.Set(v);</blockquote><blockquote> feed1 &lt;- Xively.Feed(Feed_ID, [channel1]);</blockquote><blockquote> client.Put(feed1);</blockquote><blockquote>});</blockquote><blockquote>device.on(&quot;Xively-lag&quot;, function(v) {</blockquote><blockquote> channel1 &lt;- Xively.Channel(&quot;lag&quot;);</blockquote><blockquote> channel1.Set(v);</blockquote><blockquote> feed1 &lt;- Xively.Feed(Feed_ID, [channel1]);</blockquote><blockquote> client.Put(feed1);</blockquote><blockquote>});</blockquote><blockquote>device.on(&quot;Xively-rssi&quot;, function(v) {</blockquote><blockquote> channel1 &lt;- Xively.Channel(&quot;WiFi&quot;);</blockquote><blockquote> channel1.Set(v);</blockquote><blockquote> feed1 &lt;- Xively.Feed(Feed_ID, [channel1]);</blockquote><blockquote> client.Put(feed1);</blockquote><blockquote>});</blockquote><blockquote>device.on(&quot;Xively-battery&quot;, function(v) {</blockquote><blockquote> channel1 &lt;- Xively.Channel(&quot;battery&quot;);</blockquote><blockquote> channel1.Set(v);</blockquote><blockquote> feed1 &lt;- Xively.Feed(Feed_ID, [channel1]);</blockquote><blockquote> client.Put(feed1);</blockquote><blockquote>});<br></blockquote>
<p>Great. Thanks! How would I have it run every 6 hours starting at 8:00 am? I can see where to do it every 6 hours - just 60 *6. But how would I make it start the 6 hour cycle at 8:00 am, 2:00 pm, 8:00 pm, or 2:00 am? </p>
<p>Here are the graphs on Xively for 3 months</p>
<p>And here's what my code writes to the Electric Imp IDE log window every 2 hours.</p>
<p>Is there a way to send the remaining battery life data as well as the temperature reading?</p>
<p>This is really great and the simple to follow instructions got me up and running very easily. I'm trying to take this to the next level now and I've created an amazon cloud instance with Phant.io running. I'm not a great coder, certainly not for squirrel, and I was wondering what I need to change in the IMP agent code to redirect to my own cloud instance running Phant.io rather than sparkfun. Any help much appreciated. </p>
<p>Thanks for making this easy to build! but I'm having a problem Xively isn't allowing any new accounts now. so i have this but have no where to sent the info. i tried to use another site thingspeak.com but the code wont work with the way its wired. i was wondering if you have any ides what i can do. thanks for any help you can give!</p>
Wondered if that would happen. <br><br>imp.guru has a nice graphing front end for devices like this. They built their front end on top of Sparkfun's data store. It looks pretty good - I should get around to switching my examples all over to it. Try it out here: http://imp.guru/<br><br>
<p>Hi, I just found a blog entry about temperature logging using the Electric Imp and using a graph from ThingSpeak here:</p><p><a href="http://www.slickstreamer.info/2013/09/electric-imp-solar-powered-temperature.html" rel="nofollow">http://www.slickstreamer.info/2013/09/electric-imp...</a></p><p>I'm a novice at programming, but do you think it would be possible to reuse the code from Slickstreamer in the Tempbug project?</p>
<p>Absolutely, though I haven't dug into slickstreamer at all. If you can send HTTP requests to post data, then the imp can do it!</p>
<p>Just updated this instructable to use Sparkfun and imp.guru, so no more Xively troubles!</p>
<p>What kind of wireless range does the imp have?</p>
<p>It's very good! Better than your phone or computer; it has the same WiFi chip in it your phone probably has, but the antenna isn't surrounded by a battery and a metal frame. </p>
<p>Similar to a laptop's wifi card. My Imp in the attic and the router is in the hallway 2 floors below it on the opposite side of the house. When the Imp's battery begins to run out, the WiFi signal it detects drops, and when if falls below about -93 dBm it can't connect anymore.</p>
<p>hah, finally read through all the comments and my Qs are answered. Thanks again for the writeup. This will be perfect for my situation!</p>
<p>wow! awesome instructions! I was planning on hacking sth together with an arduino I've got hibernating in a drawer since last xmas, but you won me over with this tutorial. </p><p>going to set this up in a utility room at home. I already set up a raspi webcam for visual access, now for temp readings. I've got water pipes that are at risk of freezing in severe weather and this puppy will help me set up alarm notifications for my computer and phone when the temp gets too low. </p><p>After that I plan on adding a wifi connected water sensor with notification to monitor for leaks. </p><p>If I have an outlet nearby I assume that I can simply use a usb power supply for the board instead of the battery, right?</p><p>I assume squirrel enables the option for sending temp readings to anywhere I like, right? I'm building a simple website with a dashboard of info from a bunch of devices, like a couple home security webcams i made with raspis and probably two or three of these tempbugs. Got any advice on whether SQLite would be a good choice or another database? Or perhaps I can tap into the Xively API to feed my webpage dashboard...</p><p>Thanks for a great project idea!</p>
<p>hello sir i need to build a wake up signal with int pin with other exisiting pins through pushbutton, like pin1 can be wake by pin2 and pin5 via pushbutton pressed..</p>
<p>I had the thermometer up on Xively yesterday, but was having trouble with measuring temperature. Then I tried to modify the code, made a mess, and then decided to start from scratch and got rid of everything on electric imp. I started by attempting to relink via BlinkUp and can't get it to link up. Any thoughts on how to get BlinkUp to work again?</p>
<p>You actually don't need to BlinkUp again; you can just edit the code in the model you've already created. When you hit &quot;build and run&quot; in the IDE, the code you have in the IDE is built and sent to the imp, wiping out the previous code. </p><p>BlinkUp is only needed when initially configuring or changing the WiFi credentials on the imp. As long as you're in the same Electric Imp account and on the same WiFi network you were on before, there's no need to do it again. </p><p>If you've lost your WiFi configuration and are now having trouble using BlinkUp to get it back, you can take a look at the documentation and tips on BlinkUp here: https://electricimp.com/docs/gettingstarted/1-blinkup/</p>
<p>Thanks for a great list of instructions. You really have done an outstanding job making this manageable for a for someone with limited tech skills! </p><p>I have been able to setup the code and the integration to Xively but am having trouble with the readings. The readings remain steady at say 50 for quite a while then spike up to 120 or plunge to -119. Sometimes they stay at say -10 for an extended period of time. Attached is a picture of the Xively graph.</p><p>Have tested the readings by placing the E-Imp next to hot and cold items but there is little fluctuation in the readings. </p><p>No doubt I have made a simple error somewhere but am struggling to find it.</p><p>For the moment the power supply is by USB from a laptop. Am planning on soldering on the battery once the readings work properly.</p><p>Any feedback or suggestions would be appreciated.</p><p>Thanks again!</p>
<p>Sounds like a flaky connection somewhere in your thermistor circuit. Go back over your solder joints and make sure they're all holding together properly. It might be a good idea to look up a tutorial on soldering if you're unfamiliar; I've covered the basics here but a more in-depth of cold solder joints and how to avoid them might save you some time. </p>
<p>Thanks for the instructions, there were one thing that was not mentioned in putting this together, the 2 pin jumper. I temporarily made one from wire. One problem that I am having is I am not getting temperature reads. The request log is running properly - there are request and responses - but nothing shows up in the graph to the left. Any thoughts?</p>
<p>Try to write the temperature as a server.log() statement in the Imp IDE first, to make sure the thermistor is working correctly, before you try to draw graphs in Xively. Uploading data to Xively is tricky - I eventually got something to work, but I don't really understand how it works! </p>
<p>I tried to build it--great, thorough, easily understandable instructions, but I am not getting any info posted to Xively. I copied the info for lines 7 and 8, and although the project seems to cycle as expected, the log states:</p><p>Posted to Xively: 120.21, got return code: 56, msg: &lt;html&gt;</p><p>&lt;head&gt;&lt;title&gt;400 Bad Request&lt;/title&gt;&lt;/head&gt;</p><p>body bg color=&quot;white&quot;&gt;</p><p>&lt;center&gt;&lt;hi&gt;400 Bad Request&lt;/hi&gt;&lt;/center&gt;</p><p>&lt;hr&gt;&lt;center&gt;nginx/1.1.19&lt;/center&gt;</p><p>&lt;/body&gt;</p><p>&lt;/html&gt;</p><p>I am getting no data posted, and the Request log sits empty with the &quot;waiting for requests area&quot; just cycling. Where have I screwed up? I could send you any additional information you request, if needed</p>
<p>Hi Lenny,</p><p>Sorry, that sounds frustrating! Let's look over your code on a direct message.</p>
<p>I have also just built this and get this message when it tries to send data to Xively. Perhaps I have the same issue as Lenny.</p><br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> 2014-07-21 14:45:04 UTC-4 <br> [Agent] <br> Posted to Xively: 71.60, got return code: 56, msg: &lt;html&gt; <br>&lt;head&gt;&lt;title&gt;400 Bad Request&lt;/title&gt;&lt;/head&gt; <br>&lt;body bgcolor=&quot;white&quot;&gt; <br>&lt;center&gt;&lt;h1&gt;400 Bad Request&lt;/h1&gt;&lt;/center&gt; <br>&lt;hr&gt;&lt;center&gt;nginx/1.1.19&lt;/center&gt; <br>&lt;/body&gt; <br>&lt;/html&gt; <br><br><br> <br> <br>
<p>Tombrew,</p><p>With Lenny's help I found the problem! The Feed ID is a number and should not have quotation marks around it.</p><p>My unit now works.</p><p>Thanks,</p><p>Dave</p>
<p>I've been wanting to create a wifi thermometer for a while, this plan looks perfect! I'm a newbie when it comes to building electronics so I have a few questions if you can share some knowledge.</p><p>Are the 2 breakout boards you link to different from each other, or one an older version or something? I noticed one is the April breakout and is green, and the other just lists as a plain breakout board and is red. Any different and is one better than the other? I see in your pics you used the green april breakout board I think.</p><p>Any way to add a humidity sensor into the mix? Would that require a whole set of different details, or can it be blended into the existing coding and add either a combo temp/humidity sensor, or a separate humidity sensor?</p><p>I can in theory build this on a mini breadboard before doing any soldering, right? Maybe i'll do that and practice my soldering skills on a test board so I don't mess up the breakout board.</p><p>Any recommendations on a soldering iron that is decent, but won't break the bank for someone who hardly does soldering? Any tips on resources for getting into learning more about how all of this works? I'm a complete newbie so I can use tips on soldering, recommended entry level equipment, understanding of circuits and all the components, etc. I see that Amazon (and AdaFruit) sell breadboard starter kits that mention Arduino. Is that a good thing to buy to start playing and learning? Is Arduino way harder to use vs. Electric Imp?</p><p>Seems like DigiKey has everything needed to build this, I think i'll order from them.</p><p>Thanks!!!</p>
<p>The green and red breakout boards are identical - use either of the ones I linked to. </p><p>This instructable doesn't cover what you need to do temperature and humidity sensing, but you might take a look at the electric imp reference code for the DHT11: <a href="https://github.com/electricimp/reference/tree/master/hardware/DHT11" rel="nofollow">https://github.com/electricimp/reference/tree/mast...</a></p><p>You certainly can build this on a breadboard, but you'll need to make sure you get an electric imp breakout board with headers, or put headers on your breakout board. You should check with google for the best soldering iron recommendations; I've got a pretty nice one and am therefore spoiled.</p><p>Arduino vs. Electric Imp isn't really harder/easier; they're different device with different purposes. I can't speak to much on Arduinos goals as a project or tool, but I can say the Electric Imp is made specifically to connect things to the internet, and it does that quite well. </p><p>Best of luck and have fun!</p>
<p>I have made it but it shows around 80. I assume thies is in fahrenheit. What do i need to change that it will be displayed in celsius? TNX</p>
Yep, it defaults to fahrenheit. You can change it to celsius by calling &quot;read_c&quot; instead of &quot;read_f&quot; on line 103 of the device code.
<p>Excellent article! I'd like to build this for a swimming pool thermometer. Do you think this would work with the sensor submerged?</p>
<p>I think it could (not the imp and power supply, though!) The longer the leads on your thermistor, the less accurate it will be. A creative mechanical design could help, or you could look into thermocouples.</p>
<p>hi im trying to build the temp bug and i have it all wired up and i have used the imp before to turn on and off a light. but now that i have it programed and all hooked up and cap hooked up the right way. the imp card blinks red 3 times then flashes green for half a sec then it turns off. what does this mean??? Ive tried powering it via usb and 9v battery. same thing... any help would be great! </p>
<p>That's actually just it working! The three red blinks are the imp attempting to connect to your WiFi, the one green blink happens when it connects. As soon as it connects, it runs the entire firmware and uploads the measurement in about a second, then goes to deep sleep - which is why you see it stop blinking. You should see it do this once every 15 minutes. </p>
<p>THanks.... just what I was looking for! Didn't even know about IMP.</p>

About This Instructable


527 favorites

Bio: Developer at Electric Imp
More by tombrew: NeoWeather: Ambient Weather Indicator Imp Chef: Internet-Connected BBQ Thermometer imPrinter: the Electric Imp wireless, internet-connected thermal printer
Add instructable to: