midon design 1-Wire Application Guide 1-Wire Application Guide v1.04 January 30, 2015 1-Wire Application Guide v1.
midon design Table of Contents List of Tables ....................................................................................................... 3 List of Figures...................................................................................................... 3 1 Introduction ........................................................................................................ 5 2 1-Wire Installations ............................................................................................
midon design 5.1.2 DooTemp08 ............................................................................................... 38 5.1.3 Thermd ...................................................................................................... 38 5.1.4 Premise...................................................................................................... 38 5.1.5 Roll your own ............................................................................................. 38 5.
midon design Figure 22 1-Wire Water Meter............................................................................. 32 Figure 23 DLJ75C Water Flow Meter.................................................................. 33 Figure 24 1-Wire Current Sensor........................................................................ 34 Figure 25 HyperTerminal Port Settings ............................................................... 40 Figure 26 Location of HyperTerminal Connect Button.........................
1 Introduction Thank you for considering Midon Design's 1-Wire Serial interface: TEMP08. This application guide has been put together after many, many questions from users about how to connect, what to connect, and how to use, these interfaces. This guide is intended to package all of the common questions (and answers) into one place as a reference for anyone thinking of using 1-Wire®, or even for those that have already implemented systems and want to expand or change it.
2 1-Wire Installations 2.1 1-Wire – What is it? 1-Wire® was a system originally developed by Dallas Semiconductor, now Maxim, to provide an easy way to communicate between microprocessors and peripheral devices using a minimum pin count, hence 1-Wire. 1-Wire devices only require 1 microprocessor pin, and a common ground connection, to achieve bi-directional communication. The 1-Wire system is sometimes also called MicroLAN, or iButton®.
Figure 1 1-Wire Bus Network A bus network is the simplest kind of network. It consists of a length of cable with sensors tapped into it along the way. Figure 1 shows an example. An advantage of a bus network is its electrical simplicity and transmission property performance. Bus networks generally exhibit very little electrical noise, and thus the communications are more robust than star networks.
Figure 2 1-Wire Star Network A star network is somewhat more complex than a bus network. A typical star network is shown in Figure 2. An advantage of a star network is that it can be easier to physically wire. Many sensor locations can be reached, and added, by stringing a cable from the main point to the sensor. Also, a break of one sensor’s wiring will not affect other sensors. The biggest disadvantage of a star network, however, is the electrical noise that can be introduced if not properly connected.
Figure 3 1-Wire Star Network with Resistors 2.2.3 Bus and Star Networks Figure 4 1-Wire Bus and Star Network 1-Wire Application Guide v1.
Of course, the two main types of network topologies can be combined to achieve required results. Figure 4 shows an example of a properly connected Bus and Star network. Note the locations of the 100-Ohm termination resistors, which are required to minimize noise in the network. Generally, the resistors should be placed at every branch of the network. 2.3 How to Wire Networks Properly 2.3.1 Types of interconnect cabling There are several types of cables that can be used for 1-Wire networks.
cables have the red and green wires (and the yellow and black wires) reversed between connectors. 2.3.1.2 CAT-1 Cable Figure 6 CAT-1 Cable CAT-1 cable is 4 conductor twisted pair cable that is usually used to wire between phone jacks inside the walls of a house. It can be used for most 1-Wire networks and usually exhibits decent noise performance for networks less than around 100 feet. Use the Red/Green wires for DQ and Ground. Use the Yellow and Black wires for remote power if needed. 2.3.1.
wiring. CAT-5 can be used for networks that are up to the maximum recommended reach for 1-Wire: 300 feet or about 100 meters. Use the Blue-White wire for DQ, and the White-Blue wire for Ground. Powering can be done over any of the other pairs. Pick a pair and then stick to it for all of your wiring to avoid mistakes in wiring later. 2.3.2 Connectors or Not? Most 1-Wire sensors sold by all the vendors today come equipped with modular connectors, either RJ-11, RJ-12 or RJ-45.
Sensors Texas Weather N/C GND DQ GND Instruments sensors Simon Atkins’ Hub +5VDC +5VDC DC DQ GND Supply AAG RJ-45 DQ GND +5VDC +12VDC +12VDC Sensors Hobby-Boards GND +5VDC GND DQ GND Sensors 1Wire.org draft GND +5VDC GND DQ GND standard for RJ45 RJ-12 N/C DC Supply DC Supply +5VDC GND GND RJ-45 GND GND RJ-45 +12VDC GND RJ-45 Analog +12VDC GND Signal RJ-45 N/C RJ-11 refers to the common 4-pin telephone plug. RJ-12 is the less common equivalent plug that has 6 pins equipped.
and the connections between the serial port and TEMP08. See the Troubleshooting PC Problems section later in this manual for other considerations. Issue a TMP command now and make sure that the on-board 1-Wire sensor is reporting back correctly. If it is, proceed to the next steps. If it is not, then something may have damaged the 1-Wire interface to TEMP08 and it may have become defective. Return to Midon Design for repair, if necessary. Now, connect one branch of your star network at a time to TEMP08.
3 Weather Monitoring 3.1 Types of Weather Sensors 1-Wire weather sensors are available from a variety of vendors, including, of course, Midon Design. All the standard weather parameters can be monitored with the sensors. The following sections will describe the available sensors, and the theory of operation of the sensors. It should be noted that most, of these sensors might be mounted outdoors, so be careful with how you mount them and most importantly about the wiring.
The DS18B20 offers 9, 10, 11 or 12 bit resolution, or ± 0.5°C, ± 0.25°C, ± 0.125°C or ± 0.0625°C precision respectively. Temperatures can be measured from –55°C to +125°C (-67°F to +257°F). Accuracy is ± 0.5°C (± 0.9°F) from – 10°C to +85°C. TEMP08 uses this device in 12-bit resolution mode. Note: Waterproof DS18B20 sensors are available from RFXCOM Products at http://www.rfxcom.com/sensors.htm#Additional or from other vendors on eBay.
There are lots of choices for temperature sensors available and all have slightly different characteristics. Your choice might depend on accuracy or precision, or a combination of both (see Figure 9). Be careful not to confuse the two. Precision is the resolution of the measurement, but accuracy is the variance between the actual temperature and the returned result. Many users have confused this and have been puzzled why two devices placed side by side would produce a variance in temperature.
however, later versions, such as those formerly available from AAG, and previously from Hobby Boards, used 2 reed switches, which meant that the counters were incremented twice as often as the original design. TEMP08 is designed to work with the later versions only. If you are not sure which are supported, contact Midon Design. When used with TEMP08, set the DS2423 type to “W” (wind). Only one wind speed counter is supported on TEMP08. Hobby Boards now sells the Inspeed and ADS Anemometers.
Figure 11 1-Wire Wind Direction Wind direction then becomes defined by the voltages reported from the DS2450 as per the table in Figure 12. Figure 12 Wind Direction Voltages Of course, knowing which position is not enough. You need to know which position is North, East, West, etc. TEMP08 has the NOR command available to be able to set the North position. Once that has been done, the other positions 1-Wire Application Guide v1.
are known and wind direction is now absolute. There are two conditions when West might become East, and vice versa; if you install the PCB upside down (easy to do!) and when you would rather know where the wind is blowing from rather than blowing to. TEMP08 offers the REV command to flip East and West, and all the other cardinal points, to do this. There are now new wind direction sensors on the market that use DS2438’s to determine direction.
Table 3 ADS Wind Direction Conversion (Sorted by Voltage) Direction W NW WNW N NNW SW WSW NE NNE S SSW SE SSE E ENE ESE 3.6 Voltage 0.89-0.95 1.54-1.60 2.20-2.26 2.66-2.72 3.54-3.60 4.28-4.34 4.59-4.65 5.96-6.02 6.49-6.55 7.57-7.63 7.95-8.01 8.48-8.54 8.98-9.04 9.27-9.33 9.35-9.41 9.50-9.56 Humidity Sensor Figure 13 1-Wire Humidity Sensor All 1-Wire humidity sensors are based on the original design shown in Figure 13.
Indoor placement is also critical – don’t install non-HIH4021 sensors in a wet environment, for example a bathroom shower, since the humidity sensor will eventually fail. Most of the sensor connectors will eventually corrode if exposed to high humidity or corrosive environments, which will lead to false or missing readings. When used with a TEMP08, set the DS2438 type to “H” (humidity). 3.7 Barometric Sensor An important weather parameter is air pressure.
Figure 15 Bray-Jennings Barometer This design was modified slightly over time, and the currently available production unit is shown in Figure 16. The operating principle remained the same over all versions of the design. 1-Wire Application Guide v1.
Figure 16 Tim Bitson 1-Wire Barometer The Motorola MPX4115 device outputs a voltage proportional to the air pressure. This voltage is scaled up by the amplifier(s) to be within a useable range for the DS2438 ADC and then converted to digital on the 1-Wire bus. These devices do not need to be placed outdoors. Unless you have an extremely airtight building, the air pressure indoors will always be the same as the air pressure outdoors. When used with a TEMP08, set the DS2438 type to “B” (Barometer). 3.
Figure 17 Tim Bitson 1-Wire Lightning Monitor Tim Bitson (see References) designed the original 1-Wire Lightning Monitor shown in Figure 17. The 1-Wire side of the design is the same as the rain gauge and wind speed sensor, in other words a DS2423 counter. The input to the counter is not a reed switch, but rather an amplified antenna pickup.
Figure 19 Solar Sensor 2 As can be seen from the figures above, there are two types of solar sensor designs. The Solar Sensor 1 design in Figure 18 is the more common one. Both designs work on the same principle however. Light falling on the sensor, either a solar cell or a photodiode, causes a small voltage to appear at the Vs inputs of the DS2438. These inputs are normally used in DS2438 battery monitoring applications to measure current flow, however, they work equally well in this application.
4 Environmental Sensors 4.1 Relay Driver Midon Design offers 2 types of 1-Wire relay drivers. 1. 1WIO, which has 4 SPDT relays, and 2. MD3020G, which has one SPDT relay. The 1WIO is DS2408 based and up to 40 of these devices are supported on TEMP08. When using the 1WIO in relay mode (it is also available as an input device), make sure to turn off input sensing by the EIN OFF command to avoid false readings from the DS2408. 1WIO is supported by both TEMP08 and 1WSwitch. The MD3020G is DS2406 based.
Figure 20 1WIO Input Wiring Up to 40 1WIO’s can be connected to TEMP08 in this manner. Mixing input and LED versions of 1WIO on TEMP08 can be tricky since connecting at least 1 1WIO input device will require the use of the EIN ON command, which will cause issues with 1WIO LED devices in some early versions of TEMP08 software. The top 4 LED’s on a 1WIO LED device would blink out when EIN ON is set on TEMP08. If this occurs, consider upgrading your TEMP08 software.
Figure 21 Using a 1-Wire Device as a Contact Sensor 4.3 Counter Sensor Counter sensors are useful for measuring any changing parameter that is provided via contact closure, such as water flow meters, some electrical meters, etc. Counter sensors are generally DS2423 based, and if so are directly compatible with TEMP08. Set the DS2423 type to “C” (counter) when used in this mode. A Water Meter counter example is shown in Figure 22. Figure 22 1-Wire Water Meter 1-Wire Application Guide v1.
In Figure 22, the Flow counter could be as shown in Figure 23, a DLJ75C pulse counting water meter from www.watermeters.com , which registers one pulse per gallon of water flowing through the meter. Figure 23 DLJ75C Water Flow Meter 4.4 Indicator Sensor Midon Design offered two LED indicator devices, which might be useful for displaying the state of something remotely via the 1-Wire network. One sensor, the MD3020H, was DS2406 based and is supported by the 1WSwitch and earlier versions of TEMP08.
directly proportional to the current flowing through whatever wire the CT3110 current probe is clamped on to. The CT3110 current probe is available from Midon Design. Resistor R1 in Figure 24 can be chosen by the formula R1 = V x 3100 / I Where V = 10 Volts (the maximum input to a DS2438) x 1.414 (scaled to DC) = 14.14 Volts And I = the maximum expected current on the circuit being measured. As an example, if you expect to see no more than 20 Amps on a circuit, then R = 14.
bus, make sure to disable wind direction reporting (which will allow the voltages from the DS2450 to be visible) by using the EWN OFF command. 4.6 1-Wire Devices Not Supported by TEMP08 4.6.1 Moisture Sensor Moisture sensors are available from some vendors as a DS2760-based device. These devices are not compatible with TEMP08, however. Similar sensors can be built using a DS2438 current sensor input, which would be supported by TEMP08. A Leaf Wetness Sensor is also available.
Table 4 Sensor Compatibility Sensor DS18S20 Temperature DS18S20-PAR Temperature DS18B20 Temperature DS1822 Temperature DS2438 Voltage & Current DS2423 Rain Gauge DS2423 Wind Speed DS2450 Wind Direction DS2450 Voltage DS2438/DS2423 Wind Speed/Direction Compatibility TEMP08 1WSwitch LOG08-II Midon Design Y N Y Y Y Y Y Y Y Y Y (Note 1) N N N Y N N N N N Y TAI8520 Y Y Y Y MES1276 Y (Note 1) N N Y Y (Note 1) Y Y (Note 1) Y DS2438 Humidity Sensor Y Y (Note 1) Y (Note 1) DS2438 Barometric Sensor Y N Y DS2
Unfortunately, Dallas Semiconductor, now known as Maxim, has begun to phase out some of the semiconductors used in 1-Wire sensor devices. Most production houses have a fairly large supply of these critical components, however, check first before designing in any specific sensor.
5 Connecting To a PC 5.1 What software is available 5.1.1 HomeSeer HomeSeer is perhaps the most popular method of interfacing to TEMP08. HomeSeer is available at www.homeseer.com and interface scripts and plug-ins are available on the HomeSeer Forum. Midon Design also provides a simple script interface on our website. Jim Doolittle, Ken Mitchell and Michael McSharry have written HomeSeer plugins for TEMP08. These are available from the Forum or direct from the authors. 5.1.
The RS232 settings should be 9600 bps, no parity, eight bits, with no flow control. RS232 cables should not be longer than 50 feet (about 15 meters) for proper communication at the 9600 bps rate used. Of course, if your PC does not have a serial port, use a USB to serial port adapter to make the connection. Many types are available and they should all work fine. 5.
Figure 25 HyperTerminal Port Settings If your software is still unable to work properly with TEMP08, please contact the author of the software and make sure that you include any HyperTerminal session logs to illustrate your problems. It is possible that TEMP08 command or response syntax is different than the version the author originally coded from. 1-Wire Application Guide v1.
Figure 26 Location of HyperTerminal Connect Button 1-Wire Application Guide v1.
6 References 1. “Transmitting Data and Power over a One-Wire Bus”, Dan Awtrey, Sensors Magazine, February 1997 http://archives.sensorsmag.com/articles/0297/onewire/index.htm 2. “The 1-Wire Weather Station”, Dan Awtrey, Sensors Magazine, June 1998 http://archives.sensorsmag.com/articles/0698/wir0698/index.htm 3. “A 1-Wire Rain Gauge”, Dan Awtrey, Sensors Magazine, December 1999 http://archives.sensorsmag.com/articles/1299/56_1299/index.htm 4.
7 Glossary Term ADC DQ GND LCD LED NC NO PC PCB Plug-In RX SPDT TX VAC VDC 1-Wire Application Guide v1.
8 Legal Notices © Copyright 2015 Midon Design. All rights reserved. No part of this document may be reproduced, recorded, transmitted or distributed in any form or by any means without the written consent of Midon Design. 1-Wire is a registered trademark of Maxim Integrated Products, Inc. MicroLAN is a trademark of Maxim Integrated Products, Inc. iButton is a registered trademark of Maxim Integrated Products, Inc. End of Document 1-Wire Application Guide v1.