Temperature sensor handbook

The temperature sensor is the first of the wireless networked sensor nodes in a series. They contrast with the actuators, of which the heat stick is the first.

If the history of technology can be characterized by increasing energy use, the invention of glass blowing and the alcohol thermometer would have been a good means both by which to economize the use of that energy as well as to investigate how to apply it to maximum effect.

A jeenode-agnostic tour of the principles can be found here.

As for applications to jeenodes, understanding the ports library and what it is will begin the process of understanding the jeenode (http://arduino.cc upon which its based is more foundational reading).

More foundations from jeelabs.

The idea in outline.

Hacksaw

Parts list:
JB Weld
Small stainless tube
keg dip tube
brake line
22 ga wire
Heat shrink tubing or electrical tape
http://search.digikey.com/us/en/products/LM34DZ%2FNOPB/LM34DZ-ND/32485
http://shop.moderndevice.com/products/temperature-sensor

All of these plug into a JeeNode, thus making your very own analog electronic submersible temperature sensor!

Temperature sensor Bill of Materials (BOM)

Step by step procedure

Most of this is similar to what you can find here

Tools:
Angle Grinder (to cut keg dip tube or brake line)
Soldering station

When you've cut the top of the keg off as in and you've put holes in for the mixing bar on the electric hot composter (forthcoming) you'll still have a few inches of keg dip tube that you can cut off with the angle grinder. This will serve as a fancy container to hold the temperature sensor along with some JB Weld (which is used in many other places, especially in making the heat sticks. Exact dimensions will be available when the electric hot composter instructions are further along.

Cut some three wire 22 AWG wire to expose the wires. Solder one wire per lead on the temperature sensor. The middle one is your analog input so remember its color.

Secure the piece of keg dip tube to a piece of cardboard or a bar of soap with the soldered temperature sensor/wire also secured inside it. Mix the JB Weld. Without acetone thinner is fine (one teaspoon of acetone as a thinner per pack of JB Weld should be used when it's absolutely important for the JB Weld to flow, as when potting the heat stick connections but here it's fine not to use it). Glop it in. Make sure the wire doesn't stick too much to the sides. In several hours it should begin to firm. Waiting overnight, it will be ready.

(hours later)

You should have a working jeenode for this part. Expose the wires on your completed temperature sensor. Into Port 1 on your jeenode (the one of the four black six pin inlets marked P1) insert the wire connected to the middle lead/pin on the temperature sensor into the hole marked A (for Analog--D is for digital but this is an analog sensor so it goes into A). The other two wires go into G and + (for Ground and Positive respectively).

If, when your jeenode is connected to a power source or this test will be meaningless, this configuration causes your temperature sensor to get very hot then you have probably reversed the Ground and Positive wires so undo those and try again.

You'll need the JeeLib library for this to work. Place it in your arduino/libraries folder.

Connect your USB BUB II to a USB port on your computer as well as to your jeenode. In the Arduino IDE under Tools > Serial Port select the correct port. For a jeenode v6 you should select Tools > Board > Arduino Duelmilanove Atmega w/ Atmega328. Your jeelink (as opposed to node) may be an Arduino Uno, however.

Open a new window in the Arduino IDE and input the code found here:

Temperature sensor code

Verify (the checkmark) and Upload (the forward arrow) this code to your jeenode. If that didn't work, check your port and board type.

Disconnect the USB-BUB II. Put in the jeelink. This may change your COM (port) number even if you use the same USB port for whatever reason. Select the right port number. Change board type to the Arduino Uno. Open up Tools > Serial Monitor. If you don't see anything intelligible yet try changing the baud.

If it's working you should see something like this:

[RF12demo] A i1 g212 @ 433 MHz
Available commands:
[etc]

Congratulations! You're talking to the jeelink.

Type in:

1i 8b 1g

Which sets the node ID to 1, frequency band to 868 Mhz and net group to 1.

If your jeenode is connected to the temperature sensor and a power source (like an AA Power Board) you should see a series of packets coming in like this:

OK 33 212 0
-> ack
OK 33 209 0
-> ack
OK 33 212 0
-> ack
OK 33 209 0
-> ack
? 0 17 4 144 151 64 68 69 211 64 133 161 68 199 164 96 80 20 129 3 192
OK 33 212 0
-> ack

These are good packets and acknowledgements and the occasional bad packet beginning with a question mark. You can quiet bad packets by typing:

1q

and turn quiet mode back off by typing

0q

There's a header byte (33) and two data bytes. The formula for temperature is (byte1 + 256 * byte2) * 0.1°C. So

OK 33 212 0

would be 21.2°C