Apr 17

Easy Arduino 1-Wire Sensor Network

A few months ago a friend of mine asked me if I could help him build a temperature monitoring solution for his home. After several failed attempts with various wireless temperature sensors/strategies I decided a wired solution was a better way to go. I built a solution based on an Arduino utilizing Maxim’s 1-Wire DS18B20 temperature sensors encased in off the shelf telephone jacks. The 1-Wire devices are low cost, require few extra components and can be networked together over a long distance. The telephone jacks provided a quick and easy well finished solution for cabling and networking the sensors together. The jacks also come with screws and double sided tape for quick and easy mounting. If you are interested in building one yourself read on…

Materials you will need:

Sensor assembly instructions: (click photos to enlarge)

  1. Remove the cover from the phone jack.
  2. Unscrew the red, black and green wires then cut away the plastic posts sticking up – highlighted in the photos by the black marks.
  3. Cut a piece of stripboard so that it is about 1/4 of an inch smaller on the sides and end of the jack. Clip the edges of the stripboard along the end of the jack at a 45 degree angle, this will prevent the board from becoming stuck in the jack when you put the cover back on.
  4. Solder the DS18B20 sensor in place as follows. The flat edge of the package should be facing up when soldering to the board. Be sure to keep the leads through the board very short since the leads will need to be long enough to protrude from the jack once the cover is back on.
  5. Solder the 4.K ohm resistor between the data lead (DQ) and the power lead (Vdd) and solder the wires from the jack to the board as shown. Tinning the wires before soldering will make it easier.
  6. Align the finished board as follows and gently bend the leads of the DS18B20 sensor down into the cavity in the jack base. Ensure that no leads from the sensor are touching.
  7. Snap the cover back on and you have a completed 1-Wire temperature sensor node. Repeat the steps above to build additional nodes.

Controller assembly instructions:

  1. Sorry, but I don’t have photos of the splitter before working on it, so the text will have to guide you here. Cut the existing 3 foot phone cable about 3 inches from the splitter then remove the cover. This might take some hard prying, but eventually the top and bottom will separate and the jack board will be visible inside. The phone wire will be soldered to the jack board and you can attempt to connect it directly to the Arduino, but in my case the wires were so small they snapped off while working with them. Remove the jack board to make it easier to work on. Ignore my already connected Nano in the photo:
  2. Solder the splitter to the Arduino. The easiest way to do this is to ignore all the wire colors and connect a single sensor node with the cover removed to the splitter with an off the shelf phone wire (NOTE: Phone wires can either be straight trough or crossed over, it doesn’t matter which type you use, just that you use all the same type.) Once you have a sensor connected use your multimeter in continuity mode one at a time between the red, black and green wires soldered to the sensor and the wires attached to the jack board, this will allow you to identify and map the wires correctly to the Arduino.
    1. Solder the sensor Vdd wire (red in photos) to the 5V pin on the Arduino
    2. Solder the sensor GND wire (black in photos) to the GND pin on the Arduino
    3. Solder the sensor DQ wire (green in photos) to digital pin 10 on the Arduino
  3. Test the board to make sure it is working correctly.
    1. Connect a sensor node
    2. Plug a USB cable into the Arduino and connect it to your PC
    3. Download the OneWire.zip file from http://www.pjrc.com/teensy/td_libs_OneWire.html
    4. Build the sketch and upload it to the Arduino
    5. You should see results similar to PJRC’s
  4. Orient the Arduino as follows to slide it and the jack board back into the splitter case.
  5. Fit the Arduino into the splitter case. Enlarge the existing hole from the phone cable removed earlier so that it allows access to the USB port from outside the case.
  6. Snap the cover back onto the splitter and enjoy your completed 1-Wire sensor network.

Additional Resources:

See my next post for something to do with all that new temperature data…


Apr 15

Welcome to NUEwire

Welcome to my new blog. No particular topic, just whatever crosses my mind.


» Newer posts