The Rochanda Serial Temperature Measurement System

Specifications and Assembly

copyright, Peter H. Anderson, Towanda Malone,
Nicole Ambrose and H. Paul Roach
Dept of Electrical Engineering, Morgan State University, Baltimore, MD 21239
August, '97

Note to Internet Readers.

This is the documentation which is shipped with the Temperature Measurement Kits. However, the referenced figures do not appear here. (My scanner is very poor and my internet service provider charges me for disk space). The purpose in providing this on the web is to provide additional technical information and to help you decide whether the assembly is within your reach.

Note.

This kit was developed by undergraduate electrical engineering students at Morgan State University. Rochanda is a concatenation of students names who began this embedded processor control effort. The goal in making this kit available is to encourage people to experiment and tinker; it's the way people learn. All profits are used to purchase additional parts and tools to further efforts of this type.

We certainly value our reputation. If you are not completely satisfied with this kit, simply send e-mail to pha@access.digex.net (http://www.access.digex.net/~pha) and we will return your money.

Description.

The unit interfaces with up to eight Dallas 1-Wire devices to make measurements and sends the results in degrees C to a PC or Basic Stamp at 2400 baud serial using EIA levels.

The unit consists of a processor (programmed PIC16558) including a 4.0 MHz ceramic oscillator and various pullup resistors, thermal sensors; either DS1820 or DS1821 digital thermometers and a MAX232 EIA transceiver. Ease of assembly is assured by a very low parts count; processor, ceramic resonator, two SIP resistor networks, a MAX232 IC and four electrolytic capacitors and the thermal sensors.

Up to eight DS1820 sensors may be accommodated on the K1820 processor. Each sensor is interfaced with the processor using a single twisted pair with a series 330 Ohm limiting resistor to protect the processor if the DQ lead is accidentally grounded.

Up to eight DS1821 sensors may be accommodated on the K1821 processor. These may be any mix of DS1821 in a PR35 package or DS1821T in a TO-220 package. Three leads are required for each remote device; a processor output which provides power, the data lead and ground.

Note that DS1820 and DS1821 devices may not be mixed on the same processor. Different processors are used for the two different components.

When either processor input MEAS is at a logic one or /MEAS is at a logic zero, or both, a measurment sequence is initiated. The processor first determines if there is a device on RB.0 and if so, the measurement result is sent to the PC or Basic Stamp. This process requires nominally 1.0 seconds. If no thermal sensor is detected, a nominal one second delay is provided and the value -99.99 is then returned to the PC or Basic Stamp.

The processor then moves to RB.1 and repeats this process. This is repeated for RB.2 - RB.7 and the processor again monitors inputs MEAS and /MEAS. If they are at logic zero and logic one, respectively, the processor idles until either MEAS goes high or /MEAS goes low and another measurement sequence is initiated.

A MAX232, including the necessary capacitors converts the TTL serial output from the processor to EIA levels suitable for interfacing with a PC. A receiver section of the MAX232 may be used to receive a character from the PC and bring the /MEAS input on the processor low, thus initiating a measurment sequence.

The eight measurements are returned as a string of ASCII characters. Two formats are available selected by a user strap on processor input 1_LINE.

The one line format consists of each measurment in signed decimal, with two significant figures after the decimal point. Each measurment is separated by a space and the entire line is terminated with ASCII characters "return" and "linefeed".

For example;

     120.67 -99.99 -6.02 -99.99 32.40 0.04 -0.08 -45.45

Note that -99.99 indicates the corresponding device is not present.

In the multiline format, each measurment is returned as a single line. This consists of the channel, followed by a space, followed by the measurment and a "return" and "linefeed".

For example;

     0 120.67
     1 -99.99
     2 -6.02
     3 -99.99
     4 32.40
     5 0.04
     6 -0.08
     7 -45.45

Accuracy.

     0-70 degrees C + 0.5, -0.5 degrees C

     -55 to 0       +1.0, -2.0
     70 to 125      +2.0, -1.0

Resolution.

     0.03 degrees C

Limits of Operation.

     DS1820 and DS1821   -55 to +125 C, (-67 to 257 degrees F)
     Processor           0 to 70 C

Maximum Distance from PC to Processor.

     150 feet when using MAX232

Maximum Distance from Processor to Remote Sensors.

This is very hard to say. Using very inexpensive twisted pair we have reliably made measurements at distances of 200 feet. Limiting factors are cable capacitance and of course noise which may be coupled into the run.

Power Requirements.

     +5VDC +/- 0.25 VDC
     
     Current drain is less than 10 mA.

Assembly Instructions.

Content of Kit.

Please take a few seconds to acquaint yourself with the content of the kit.

It consists of;

The Processor.

Note that some of the pins have been removed from the SIP networks and the two SIP networks differ from one another; one has one pin removed, the other has four pins removed.

EIA Interface.

Protection Network.

This permits the direct connection of the EIA serial output to a Basic Stamp input.

Thermal Sensors.

Kit K1820 includes one DS1820. Additional sensors may be ordered for $5.50 each. The kit includes eight 330 Ohm limiting resistors, one for each DS1820. These protect the PIC processor from permanent damage if the DQ lead associated with a sensor is accidentally grounded.

Kit K1821 consists includes two DS1821T devices. Additional DS1821T devices may be ordered for $3.50 each. Eight 330 Ohm limiting resistors are included to protect against permanent damage if the power lead to the DS1821T devices is accidentally shorted to ground.

Test LED.

This consists of an LED with a built in 330 Ohm series limiting resistor. This is intended to perform testing during the assembly process.

Assembly of the Processor.

Installation of Pull-up Resistors. Refer to Figure #1.

Figure #1A is a functional schematic showing 13 pull-up resistors and just looking at it probably has dampened your eagerness. Please continue as hopefully, we have made this very easy.

Figure #1B is a physical representation. Note that all 13 pullup resistors may quickly be installed using two 10-pin SIP resistor networks.

Locate the SIP which is missing pin 6 and install it such that terminal 2 of the SIP is aligned with terminal 1 of the PIC. Locate the other SIP which is missing terminals 2, 4, 5 and 6 and install such that the missing terminal 2 of the SIP is aligned with terminal 18 of the PIC.

Installation of the 4.0 MHz Ceramic Resonator and Power. Refer to Figure #2.

Install the ceramic oscillator as shown. Note that the center terminal is connected to ground and the two outter terminals to termianls 16 and 15 on the PIC. The ceramic oscillator is a symmetrical device and it doesn't matter which of the outter terminals is connected to OSC1 and which is connected to OSC2.

Connect ground to terminal 5 of the PIC.

Connect +5 VDC to terminal 14 of the PIC and also to terminal 1 of each of the SIP resistor networks.

Testing the Processor.

The overall schematic is shown in Figure #3 (on a separate page).

Bear with me for a bit of description.

When the processor "boots", it continually scans MEAS and /MEAS. If MEAS is a logic one or /MEAS is a logic zero or both, a measurment sequence is initiated. The sequence begins by the processor bringing output V_DEV to ground for nominally 1.0 seconds and then back to +5V for one second. The processor then makes measurments at each of the eight channels and V_DEV remains at +5V during this time. Each measurement requires nominally one second and thus, measurments of all eight channels requires eight seconds. The processor then returns to scan MEAS and /MEAS.

Note that MEAS is currently open which is interpretted as a logic one. Thus, when the processor is turned on, it will immediately initiate a sequence by bringing V_DEV to ground for one second, and then high for a total of nine seconds. The processor will again return to scan MEAS and /MEAS and on finding MEAS at a logic one, it will repeat the sequence.

Please refer to Figure #4.

Apply power to the processor.

Connect the black lead of the test LED to ground and monitor output V_DEV at terminal 18 of the PIC using the red or yellow lead. (Note that the 330 Ohm limiting resistor is built in to the LED).

Observe that the LED turns off for one second and then turns on for nominally nine seconds and this repeats indefinitely.

Now, ground input MEAS. Now, MEAS is at a logic zero and /MEAS is at a logic one. No sequence is intiated and V_DEV will stay at +5V (LED lit).

Now ground both MEAS and /MEAS inputs. As /MEAS is now at a logic zero, continuous measurement sequences will be intiated. That is, LED off for nominally one second and on for nominally nine seconds.

Remove the grounds from both MEAS and /MEAS. We are again in the continuous measurment mode.

A few more words of description.

After a measurment is made on each channel the result is sent on processor output TX. A STOP or idle condition is a logic one. When sending a byte, a START bit (logic zero) is sent followed by the eight data bits, followed by the idle condition (logic one).

Thus, TX is at a logic one most of the time.

Connect the yellow (or red) lead of the test LED to TX (black to ground) and observe the LED appears to always be on. The zero transitions are present for nominally 400 usecs and can't be discerned by the human eye.

Now connect the yellow (or red) lead of the test LED to the +5V source and connect the black lead to TX. The LED will now turn on only when TX is at a logic zero. Thus, most of the time, the LED will be off. However, about every second you should see a slight flicker as data is being sent.

(You might wonder, how can we be measuring anything as there are no sensors connected. The unit was designed to check whether a thermometer device exists and if it doesn't a value of -99.99 is sent. The one second pause is maintained whether a device is or is not present.)

This concludes the testing of the processor.

Assembly of the MAX232 Transceiver.

Figure #5 illustrates a typical configuration when interfacing with a PC in an "on-demand" mode. That is, a measurment sequence is initiated when the PC sends a character to the measurment unit. Note that the MEAS input is grounded.

Figure #6 illustrates a similar arrangement, except that the measurment unit is operating in a continuous mode. Note that the MEAS input is open (logic one).

Figure #7 illustrates a typical interface with a Basic Stamp where a measurement is initiated by bringing Stamp output P1 momentarily low.

Note that wiring of the MAX232 is similar in all cases, the only difference being whether the EIA receiver between terminals 8 and 9 is used.

Wire the MAX232 as shown in in the figure appropriate for your use. Note that +5 is supplied on terminal 16 and ground on terminal 15.

Check and recheck the polarity of the four electrolytic capacitors. Note that the negative side of the capacitors are at terminals 3, 5, 16 and 6.

If you have a voltmeter, verify you have greater than nominally +8.0 Volts at terminal 2 and more negative than -8.0 volts on terminal 6.

Connection to a PC or to a Basic Stamp.

Use either Figure 5, 6 or 7 to conect the unit to either a PC or to a Basic Stamp.

Note that when interfacing with the PC as shown in Figures 5 and 6, we used hardware flow control; that is, looping RTS back to CTS and looping DTR back to DSR.

With the Basic Stamp, a series 22K resistor and a shunt 6.1 V diode is used to protect the Stamp from EIA voltages which may be as large as +10 and -10 VDC. The zener limits positive voltages to 6.1V and negative voltages to -0.7VDC which are well within the safe operating range of the Stamp.

Although no sensors are currently connected, you might verify that you are receiving data. A typical QBASIC program for the PC and a PBASIC routine for the Basic Stamp are included in this package.

Note that Figures #5 and #6 show input 1_LINE as open (logic one). This causes all eight measurment results to be sent on a single line, each measurement separated by a space and the whole line is terminated with a return and a linefeed character.

Note that Figure #7 shows this input grounded (logic 0). This causes each measurment result to appear on a separate line.

With no sensors connected, all measurements will appear as -99.99.

Connection of the Sensors.

Note that only DS1820 sensors may be used on the K1820 processor. Only DS1821 sensors may be used on the K1821 processor.

K1820.

Figure #8 illustrates the connection of the DS1820 sensors to the processor.

When a measurment sequence is initiated, the processor attempts to make a measurement on RB.0 (terminal 6). If a device is found, the processor commands the DS1820 to perform a measurement and returns this value via the serial lead to the PC or Basic Stamp. However, if no device is found, a value of -99.99 is returned. The processor then moves on to RB.1 (terminal 7) and this is repeated for each of the eight devices.

Thus, the first measurment corresponds to the device on RB.0 (terminal 6) and then RB.1 (terminal 7), etc through to RB.7 (terminal 13).

Therefore, it is suggested that the user begin by connecting the first device to RB.0, the second to RB.1, etc. However, there is no need for this ordered approach. If only one sensor is to be used, it could just as well be placed on RB.7. The processor would then return -99.99 for RB.0 through RB.6 and then the measurement made on RB.7.

Each connection to a remote sensor consists of a twisted pair from one of the RB processor outputs (terminals 6 - 13) and from the processor's ground to the DQ lead and ground on the remote DS1820. Note that a series 330 Ohm resistor protects the RB output of the processor if the lead should be accidentally grounded.

The DS1820 is operated in the parasite mode; that is, the power required for the device is derived from the data lead. In this mode, V_DD on the DS1820 must be connected to ground. Thus the two outter terminals of the DS1820 are connected to ground and the data lead from the processor is connected to the center lead.

K1821.

Figure #9 illustrates the connection of the DS1821 sensors to the processor.

As with the K1820, measurments begin with the device associated with RB.0 (terminal 7) and then RB.1 (terminal 8), etc, to RB.7 (terminal 13). If a device is found on an RB ouput, the measurement is returned to the PC or Basic Stamp via the serial interface. If no device is found on an RB output, a value of -99.99 is returned.

Thus, one might connect the first sensor to RB.0 (terminal 6), the second to RB.1 (terminal 7), etc.

Note that power for the DS1821 is provided by processor output RA.1 (terminal 18). Series 330 Ohm limiting resistors are suggested to limit the current drawn from this output if the lead to the remote device is accidentally grounded.

Note that the pin configurations for the DS1821 in a PR35 package differs from a DS1821T in a TO-220 package.

Final Testing.

Two discussions are included in this package. One is a simple QBASIC routine for a PC which periodically transmits a character, initiating a measurement sequence which is displayed on the terminal. The other is a PBASIC routine for a Basic Stamp 2 which periodically brings /MEAS low, initiating a measurement sequence. This is then read as eight lines using the SERIN command.