A while back, I wanted to start adding some temperature sensors to my place. The eventual intent is to tie it all in to a control system of sorts. Eventually...
I looked at a bunch of different ways of reading data. The Raspberry Pi was the logical choice, since it supports a lot of different input methods right out of the box, including 1-wire devices. I eventually settled on a commercially available product designed for data center monitoring that I was able to purchase on the cheap from an auction site. It has a whole host of inputs and outputs, and has a built in alarm and email server, all in a nice rack mount case.
Since this thing is targeting commercial customers, the sensor prices are commercial prices. Expensive! But all the components they use are just standard 1-wire devices in special packages. Their outdoor sensor is around $100, which is too much for a hobbyist.
I set out to replicate that outdoor sensor. I disassembled one of the other sensors received with the original purchase (it was dead) to see how they wired it, and got to work.
- A Maxim DS18x20. I used DS18S20 to maintain compatibility with my device.
- Some cable and connectors as needed. I used 4-wire telephone cable.
- A thin metal tube, cut to about 1.5" or so, cleaned and deburred. Size for your sensor.
- A cap to fit the tube.
- Some heat shrink tubing.
- Two-part epoxy. You may need to experiment to find epoxy that doesn't corrode your leads.
- Tool Dip.
- Some sort of mount.
- Solder the cable directly to the sensor's legs. You'll want to have heat shrink on the wires to slide up afterwards. Make sure all the joint are clean and solid, and shrink the tubing on.
- Put your cap on the tube and slide the assembled sensor into the tube. Ideally, you'll want to have the outer jacket protruding from the bottom of the tube. Use heat shrink as needed to provide protection for the cable jacket as needed.
- Fill the tube with epoxy and allow to cure.
- Place another piece of shrink at the bottom of the tube to hold the cable in place, if needed.
- Dip the entire assembly in Tool Dip and allow to cure.
I'm guessing there is some small delay in the sensor's reading, due to the mass of the material around it. It's not terribly important in my application, and this setup has been working flawlessly for the past few years.
Total cost was probably $10, and could be cheaper depending on how well stocked your junk box is.