Note, (Oct 18, '03). This module was originally offered as the IOM #135. All units shipped after Oct 18, '03 are identified as IOM #135E. The IOM #135 was compatible only with DS18S20 temperature sensors on the eight Dallas runs. The IOM #135E expands this to also include the DS18B20 and DS1822 temperature sensors, the DS2438 temperature and A/D converter, the DS2450 Quad A/D converter and the DS2423 dual 32-bit counter. Any mix of these devices may be accommodated on each run.
The original intent of the 'T' command was to measure temperature using DS18S20s. In providing the capability of interfacing with the A/D converters associated with the DS2438 and DS2450 and the counters associated with the DS2423, this is not as meaningful and thus, three additional commands have been introduced. The 'D' command displays all temperatures, all A/D voltages and all 32-bit counters of all devices found on the designated run. The 'V' command measures and displays the A/D voltages associated with all DS2438 and DS2450 sensors found on the designated run. The 'C' command displays the values of the 32-bit counters associated with the DS2423. The meaning of the 'T' command has been revised to display all temperatures associated with DS18S20, DS18B20, DS1822 and DS2438 devices.
Anyone who has purchased the IOM #135 may upgrade to the IOM #135E by simply swapping out the 40-pin PIC. The new PIC is available for $8.00. Please order as IOM #135 Upgrade. No changes to the hardware are required.
Overview.
The IOM #135E is an assembled unit that is controlled by a PC COM port or similar (9600 baud, 8 data bits, no parity, no flow control). The intent is to provide a programmable input, output, A/D, temperature measurement and counter design which you may customize to meet your specific applications.
The IOM #135E uses only the Tx, Rx and GRD terminals on the serial port. If you do not have a COM Port, consider a USB to RS232 converter.
The module provides eight addressable TTL level outputs (15 mA source and sink) which may be used to operate LEDs, transistors or FETs which in turn may operate mechanical or solid state relays.
It also provides for the reading of six TTL level inputs.
In addition, it provides seven 10-bit analog to digital converters.
Access to the eight outputs, six inputs and seven A/Ds is available at holes adjacent to the processor.
Further, the unit provides the capability of measuring the temperatures on each of various Dallas 1-Wire devices on up to eight twisted pairs. In theory, up to 256 1-wire sensors may be accommodated on each twisted pair. However, the limiting factor is the capacitance and my suggestion is up to sixteen devices on a maximum of 200 feet on each twisted pair run. Note that the hardware has been wired for only four of these eight runs. If the user desires to use the others, it is a simple matter of adding 4.7K resistors and wiring from solder pads near the PIC to the screw type terminal block.
The Dallas sensors which may be accommodated are the DS18S20 (or the older DS1820 in a PR35 package), DS18B20 and DS1822 temperature sensors, the DS2438Z temperature sensor and 10-bit A/D converter, the DS2450 Quad A/D Converter and the DS2423 dual 32-bit counter.
The printed circuit board is an
The module includes a female DB9 connector, RS232 level shift circuitry (MAX232), an on-board 5 VDC supply (7805), a Microchip PIC processor and associated 20 MHz crystal. All of this is fully assembled.
An 8-hole screw type connector is provided for the twisted pair runs to the mutltiple DS18S20s operating in the parasitic power mode. As noted above, only four of these have been connected. A separate 4-hole screw type connector provides two grounds, a courtesy 5 VDC output (200 mA) and a reset lead. Momentarily ground to reset the processor.
An LED is provided which blips one time nominally every ten seconds when idle to indicate the unit is alive and blips multiple times when a command is received from the PC.
The unit is mounted on four 0.5 inch nylon hex standoffs (#4-40 screws).
One DS18S20 temperature sensor is provided. Additional DS18S20, DS18B20, DS2438 and DS2450 sensors may be purchased separately. Currently I do not stock the DS2423 dual counter, but will do so if there is a demand.
The unit includes a coaxial power connector which will accommodate a 9 - 12VDC (2.5mm ID x 5.5mm OD female center positive) wall power unit and compatible 120 VAC wall power unit.
A DB9M to DB9F through serial cable is also included.
Again, please note that this module provides eight addressable outputs, six addressable inputs and seven addressable 10-bit A/D converters. However, all of these functions are available at the solder pads near the processor. It is left to the user to add additional circuitry as required for their specific application. In addition, the module provides for eight twisted pair runs to multiple Dallas 1_wire devices on each run. However, only four of these have been wired to the terminal block.
Pricing.
Guarantee
The intent in designing modules such as this is to involve my undergraduate students in meaningful design experiences, while at the same time providing useful low cost products for hobbyists and tinkerers.
In the spirit of this activity, I don't want people buying items that do not work for them or do not meat their expectations. Thus, this unit may be returned at any time for a full credit.
Detailed Description - Command Format
All commands consist of two characters, the first indicating the operation and the second, a digit, indicating the specific output, input, A/D or temperature run. Operations are;
Hx ' output high Lx ' output low Sx ' read output status Ix ' read input Ax ' read A/D Dx ' read from Dallas 1-W devices.where x is a digit.
On receipt of any command, the processor rapidly flashes the LED. If the command is not valid, the processor returns an error message.
All valid commands are echoed followed by a new line followed by the results of the command.
Outputs.
The outputs are identified as 1, 2, 3 through 8. Each may be independently operated by issuing either an "H" (High) or "L" (Low) command. Note that a 0 brings all outputs high or low.
For example;
H1 ' high on output 1 H3 ' high on output 2 L1 ' low on output 1 H4 ' high on output 4 L0 ' brings all outputs low H0 ' bring all outputs highThe processor echoes the command followed by a new line and provides the state of the addressed output (or outputs). For example in response to H3, the processor echoes the command followed by the state of the output;
H3 3 1In the case of the H0 and L0 commands, the state of all outputs are returned.
H0 1 1 2 1 3 1 ... 8 1This may appear a bit ridiculous. However, I tried to be consistent with all functions and with the other commands.
In addition, the state of an output or all outputs may be determined by issuing the "S" (status) command.
S1 ' read state of output 1 S0 ' read state of all outputsThe processor echoes the command followed by the state or states of the addressed output(s).
S1 1 0 ' output 1 is at zeroWith the S0 command, the state of all eight outputs are returned.
S0 1 1 2 1 3 0 4 1 ... 8 0
Inputs
The state of the inputs may similarly be determined using the "I" (input) command.
I1 ' read input 1 I4 ' read input 4 I0 ' read all 0 inputs.The processor echoes the command followed by the state of the input or inputs;
I3 1 1With the I0 command, the state of all six inputs is returned.
I0 1 1 2 1 3 0 ... 6 0
A/D Measurements
A 10-bit A/D conversion is performed using the "A" (analog) command.
A2 ' performed an A/D conversion on A/D channel 2 A0 ' perform A/D conversions on all seven A/D inputsThe processor echoes the command followed by the A/D reading or readings in decimal (0-1023).
A2 2 567With the A0 command, A/D measurements are performed on all seven channels.
A0 1 0 2 59 3 598 4 901 5 1023 6 0 7 999
Dallas 1-W Measurements
Data measurements on any of the eight "runs" may be performed using the "D" command.
D2 ' perform temperature and A/D measurements on all Dallas 1-W devices found on run 2. D0 ' perform temperature and A/D measurements on all Dallas 1-W devices found on all runs.The processor echoes the command followed measurements.
D0 3 00 20 29AE 3.862 0.062 0.060 0.061 3 01 10 6A0B 24.12 3 02 10 9DD7 24.12 3 03 28 DB9C 24.12 3 04 22 5BFC 24.43 3 05 26 09CE 23.81 0.17 5.03 3 06 1D C827 00000000 00000000 >Note that in this example, seven devices were found on run 3. As each was found, it was assigned a sequential number in the range of 00 - FF. The third field is the device code; DS18S20 - 10, DS18B20 - 28, DS1822 - 22, and DS2438 - 26, DS2450 - 20 and DS2423 - 1D) followed by a 16-bit serial number. Note that the device code and the serial number has been assigned by Dallas. The last fields are the data.
Thus, in the example, one DS2450 (code 20) was found and the four voltages are displayed with three places after the decimal point. Two DS18S20 devices (code 10) were found and the temperatures were both 24.12 degrees C. One DS18B20 (code 28) and one DS1822 (code 22) were also found. One DS2438 (code 26) was found and the temperature is displayed, followed by V_ad and V_dd with two places after the decimal point. One DS2423 (code 1D) was found and the values of the two 32-bit counters is displayed in hexadecimal format.
If no sensor is found on the designated run, the command is echoed, but no other data is returned.
With the "D0" command, data measurements are performed on all of the eight runs.
D0 1 00 20 29AE 3.846 0.063 0.060 0.061 1 01 10 0C26 27.81 1 02 10 0AD7 26.93 2 00 10 9DD7 23.06 2 01 10 BD53 23.00 3 00 28 DB9C 23.00 3 01 22 5BFC 23.37 3 02 26 09CE 26.12 0.09 5.03 4 00 1D C827 00000000 00000000Note that in this case, three sensors were found on "run" 1 and two on "run" 2, three on "run" 3 and one on "run" 4.
(The order in which devices are found is a bit like an telephone directory arranged with the last names spelled in reverse. Thus, 0x20 is 0010_0000, 0x10 is 0001_0000 and 0x28 is 0010_1000. Reversed, these are 0000_0100, 0000_0010 and 0001_0100. Thus, 0x20 is found before 0x10.)
The time to measure a temperature is nominally one second. Other measurements require less than 100 ms.
Voltage measurements on any of the eight "runs" may be performed using the "V" command.
V2 ' perform voltage measurements on all Dallas 1-W devices found on run 2 which have ' voltage measurement capability; DS2438 and DS2450. V0 ' perform voltage measurements on all Dallas 1-W devices found on all runs.The processor echoes the command followed measurements.
V2 2 00 20 29AE 3.846 0.063 0.060 0.061 2 07 26 09CE 0.09 5.03As each device is found, the IOM #135E determines if the device is a DS2450 or DS2438 and if so, performs the A/D measurements and displays the voltages. Note that there is a gap in the sequential numbering as a number of devices not having A/D converters were found. Note that the temperature associated with the DS2438 (Code 26) is not displayed.
Temperature measurements on any of the eight "runs" may be performed using the "T" command.
T2 ' perform temperature measurements on all Dallas 1-W devices found on run 2 which have ' temperature measurement capability; DS18S20, DS18B20, DS1822 and DS2438 T0 ' perform temperature measurements on all Dallas 1-W devices found on all runs.The processor echoes the command followed measurements.
T2 2 01 10 0C26 27.81 2 02 10 0AD7 26.93 2 03 10 9DD7 23.06 2 04 10 BD53 23.00 2 05 28 DB9C 23.00 2 06 22 5BFC 23.37 2 07 26 09CE 26.12As each device is found, the IOM #135E determines if the device is a DS18S20, DS18B20, DS1822 or DS2438, andd if so, performs the temperature measurement. Note that the sequential number 00 is not reported as a DS2450 was found first and this does not have temperature measurement capability. Note that the voltages associated with the DS2438 (Code 26) are not displayed.
Counter measurements on any of the eight "runs" may be performed using the "C" command.
C2 ' perform counter measurements on all DS2423 devices on run 2. C0 ' perform counter measurements on all DS2423 devices found on all runs.The processor echoes the command, followed by the two 32-bit results.
C4 4 00 1D C827 00000000 00000000
Note that if you modify your system, the sequential number in the second field associated with a particular sensor is simply a running number which is assigned as each device is found. The order that each device is found is in no way related to its physical location on the twisted pair rail. This will probably change if you modify your configuration. Modifying your system may be inadvertent. If you rely on this sequential number and the beagle eats the sensor in the living room, you might actually be measuring the temperature in the freezer and believe it to be that in the living room. This is, of course, an extreme case, but hopefully it drives home the idea of using the serial number in field four to specifically identify which measurement is associated with each physical sensor.
If there is a communications error performing a measurement, the value -88.88 (or in the case of the DS2450; -8.888) is displayed. If this occurs frequently, it is a red flag that there is too much cable on the run. Too much cable (actually, the capacitance associated with the cable) will cause intermittent communication problems with all devices on the run, and not simply those sensors which are most distant from the IOM #135E unit.
The range of the temperatures at which operation is assured for the DS18S20, DS18B20, DS1822 and DS2438 is -40 to 85 degrees C. The unit provides a resolution of 0.03125 degrees C for the DS18S20 and DS2438 and 0.0625 resolution for the DS18B20 and DS1822. Please refer to the data sheets at Dallas Semiconductor for absolute accuracy over the full temperature range. (Note that the DS1822 is functionally the same as the DS18B20. In fact, the DS1822 was designed as an economy version of the DS18B20 at some sacrifice in accuracy. However, I have found the inferior DS1822 costs just about the same as the DS18B20).
The DS2438 A/D converter is a ten bit A/D and the device uses an internal band gap reference such that the readings are reported in VDC over the range of 0.0 to 10.23 VDC. The resolution is 10 mV.
The DS2450 Quad A/D is operated in a 12 bit mode using an internal badgap reference which quantizes the input voltage on each of the four channels over the range of 0.0 to 5.12 VDC. The resolution is 1.25 mV.
The DS18S20, DS18B20 and DS1822 operate in the parasitic power mode. That is, the power required to operate the sensor is obtained from the signal line. Thus, only the DQ and GRD leads are connected to these devices.
However, with DS2438, a power source in the range of 2.5 to 10.0 VDC capable of providing 100 uA is required at Vdd. This may be locally supplied, or a source of +5 VDC may be run from the IOM #135E unit. In some situations, you may have a local voltage source having a low internal impedance and in the range of 2.5 to 10.0 VDC that you wish to measure and this may be used to supply Vdd. In this case, the DS2438 is actually performing two useful 10-bit A/D conversions, one on Vad and the other on Vdd.
Similarly, a power source in the range of 4.0 to 6.0 is required for the DS2450 quad A/D coverter. It is suggested that +5 VDC be run from the IOM #135E unit.
Note that as both the DS2438 and the DS2450 use internal bandgap references, the accuracy of the voltage used as power does not affect the accuracy of the measurement.
A power source in the range of 2.8 to 6.0 VDC is required for the DS2423 dual counter. It is suggested that +5 VDC be run from the IOM #142A unit.
I have seen arrangements which use diodes and filter capacitors to derive the Vdd from the DQ signal line. I hesitate to suggest this is good design as even the 0.1 mA required for the DS2438 drops the voltage on the DQ lead by a full 0.5 VDC. What is worse is using this technique to also power a remote MPX4115 pressure sensor of an HIH-3610 relative humidity sensor. Dallas used this technique with a humidity module which I see is still available from a firm in Mexico. Terrible design. Add one of these units on a run and there is a good chance of being unable to communicate with any of the other devices on the run.
In today's world, we have inexpensive CAT 5 low capacitance cable with four twisted pairs. Use one pair for DQ and GRD for all devices on the run. Use another pair to provide power at Vdd for the DS2438, DS2450 and DS2423. Add a 0.01 to 0.1 ceramic capacitor between Vdd and GRD at the device. Notes.
Ordering Information. Please order as IOM #135E.