|
|
1672f9a |
|
|
|
1672f9a |
Howto build a Serial Adapter for Dallas DS1820 temperature sensors
|
|
|
1672f9a |
|
|
|
1672f9a |
Copyright (c) 2001 by Brian C. Lane <bcl@brianlane.com>
|
|
|
1672f9a |
All Rights Reserved
|
|
|
1672f9a |
|
|
|
1672f9a |
|
|
|
1672f9a |
|
|
|
1672f9a |
The DigiTemp program for Linux, DOS and Windows 95 uses a simple serial
|
|
|
1672f9a |
port adapter to communicate with the Dallas DS1820 digital temperature
|
|
|
1672f9a |
sensors. These sensors use a protocol called One-Wire or Micro LAN
|
|
|
1672f9a |
(depending on which Dallas documentation you are reading). This protocol
|
|
|
1672f9a |
requires only a ground and a data wire to the device. All power is derived
|
|
|
1672f9a |
from the data line while it is idle.
|
|
|
1672f9a |
|
|
|
1672f9a |
The protocol is NOT RS232! The adapter converts the RS232 voltages into
|
|
|
1672f9a |
the +5v needed to communicate with the DS1820. Each byte sent to the serial
|
|
|
1672f9a |
port represents one data bit to the DS1820. See Dallas Semiconductor App
|
|
|
1672f9a |
Note #74 for more information, or the sourcecode for DigiTemp.
|
|
|
1672f9a |
|
|
|
1672f9a |
How To build an adapter
|
|
|
1672f9a |
-----------------------
|
|
|
1672f9a |
|
|
|
1672f9a |
If you want a schematic diagram you need to look at page 20 of App.
|
|
|
1672f9a |
Note #74 from Dallas Semiconductor ( )
|
|
|
1672f9a |
|
|
|
1672f9a |
|
|
|
1672f9a |
Parts List
|
|
|
1672f9a |
----------
|
|
|
1672f9a |
|
|
|
1672f9a |
1 DB-25 connector or DB-9 connector
|
|
|
1672f9a |
1 1.5k ohm resistor
|
|
|
1672f9a |
2 1N5818 Schottky Diode
|
|
|
1672f9a |
1 1N5228 3.9v Zener Diode
|
|
|
1672f9a |
1 1N5234 6.2v Zener Diode
|
|
|
1672f9a |
1 2 position terminal block (for connecting the sensors to adapter)
|
|
|
1672f9a |
|
|
|
1672f9a |
Wire cutters and a soldering iron.
|
|
|
1672f9a |
|
|
|
1672f9a |
In this document I will refer to the pin functions. The pin numbers for
|
|
|
1672f9a |
DB-25 and DB-9 are as follows:
|
|
|
1672f9a |
|
|
|
1672f9a |
Name DB-25 DB-9
|
|
|
1672f9a |
---- ----- ----
|
|
|
1672f9a |
DTR 20 4
|
|
|
1672f9a |
RXD 3 2
|
|
|
1672f9a |
TXD 2 3
|
|
|
1672f9a |
GND 1,7 5
|
|
|
1672f9a |
|
|
|
1672f9a |
NOTE: I have not built a DB-9 version myself. Please let me know if you
|
|
|
1672f9a |
successfully build one or have problems with it.
|
|
|
1672f9a |
|
|
|
1672f9a |
On the DB-25 pins 1 and 7 must BOTH be connected together.
|
|
|
1672f9a |
|
|
|
1672f9a |
|
|
|
1672f9a |
Step Description
|
|
|
1672f9a |
------------------------------------------------------------------------
|
|
|
1672f9a |
1. Solder the 1N5228 3.9v Zener between GND and DTR with the
|
|
|
1672f9a |
Cathode(the stripe) towards DTR.
|
|
|
1672f9a |
|
|
|
1672f9a |
2. Solder the 1.5k ohm resistor between RXD and TXD.
|
|
|
1672f9a |
|
|
|
1672f9a |
3. Solder one of the 1N5818 diodes between RXD and TXD with the
|
|
|
1672f9a |
Cathode(the stripe) towards RXD.
|
|
|
1672f9a |
|
|
|
1672f9a |
4. Solder the other 1N5818 diode between RXD and DTR with the
|
|
|
1672f9a |
Cathode(the stripe) towsrds DTR.
|
|
|
1672f9a |
|
|
|
1672f9a |
5. Solder the 1N5234 6.2v Zener between RXD and DTR with the
|
|
|
1672f9a |
Cathode(the stripe) towards DTR.
|
|
|
1672f9a |
|
|
|
1672f9a |
6. Solder RXD to one pin of the terminal block and paint it
|
|
|
1672f9a |
black. This is the GND connection for the sensors.
|
|
|
1672f9a |
|
|
|
1672f9a |
7. Solder DTR to the other pin of the terminal block and paint
|
|
|
1672f9a |
it red. This is the DATA connection for the sensors.
|
|
|
1672f9a |
|
|
|
1672f9a |
|
|
|
1672f9a |
There! Now you have an adapter.
|
|
|
1672f9a |
|
|
|
1672f9a |
Connecting the sensors
|
|
|
1672f9a |
----------------------
|
|
|
1672f9a |
|
|
|
1672f9a |
You need to connect to wires to the sensor to attach to the terminal
|
|
|
1672f9a |
block. If you look at the sensor so that the label is towards you, with the
|
|
|
1672f9a |
pins facing down the pins are from left to right:
|
|
|
1672f9a |
|
|
|
1672f9a |
1. GND
|
|
|
1672f9a |
2. DATA
|
|
|
1672f9a |
3. +5v
|
|
|
1672f9a |
|
|
|
1672f9a |
Solder your wires to GND and DATA and connect them to the terminal block
|
|
|
1672f9a |
and you're done! Be careful not to overheat the sensor while soldering to
|
|
|
1672f9a |
it. My method is to tin the legs quickly and let them cool off (while
|
|
|
1672f9a |
tinning the others) and then to tin the wires, then attach them quickly with
|
|
|
1672f9a |
a minimum of heat applied.
|
|
|
1672f9a |
|
|
|
1672f9a |
One additional note: Because of the voltage(and current) drop across the
|
|
|
1672f9a |
resistor this adapter isn't capable of providing enough current to read
|
|
|
1672f9a |
temperatures above about +70C. This is a limitation of the design, not an
|
|
|
1672f9a |
error with the DS1820 or the software.
|
|
|
1672f9a |
|
|
|
1672f9a |
If you have any questions or comments, email me at bcl@brianlane.com or
|
|
|
1672f9a |
subscribe to the digitemp mailing list by sending a blank email to
|
|
|
1672f9a |
digitemp-subscribe@brianlane.com
|
|
|
1672f9a |
|
|
|
1672f9a |
Brian Lane
|
|
|
1672f9a |
bcl@brianlane.com
|
|
|
1672f9a |
http://www.brianlane.com
|
|
|
1672f9a |
|
|
|
1672f9a |
March 13, 2001
|