AT90S8515PDIP

AVR-Microcontroller
in the Ham-Shack

ATMEL Controller

deutschenglish
deutsche Seiten englisch pages

Homepage

AVR-Projects

APRS-
Telemetry-
Interface

APRS-
Thermometer

GPS-Simulator

AVR-circle

AVR-Programmer

AVR-Megaprog

RCEN-Blower

     

The APRS-Thermometer

Digi von vorne

My DIGI_NED APRS Digipeater DK5JG-2 (Foto -->) was located in a room not continuously heated. I wanted to know the temperature at the digipeater but I did not want to leave my shack. So I had to measure the temperature remotely.

The Digipeater was already running DIGI_NED digipeater software. It seemed quite easy to use the telemetry system of DIGI_NED for the measurement.

The Thermometer

In my shack I used a "Temperatur-Zeit-Modul" which I purchased form Conrad-Electronic some years ago, ordering number 195588. It has a serial output for the temperatur-data.
Download the datasheet for the module in german language.

Temperaturmodul

The serial interface of the thermometer does not match the interface of DIGI_NED. I used an Atmel AT90S1200 microcontroller to decode the serial data and provide the multiplexed parallel data for the input of the DIGI_NED telemetry system.

The Circuit

The transistors at the left match the logical levels of the module to the TTL-signals of the controller. The module is powered by an 1,5V battery. The positive pulses on the data-pin and the clock-pin of the module switch the transistors and create a TTL-Low-signal at their collectors and the input-pins of the controller.

Schaltbild

The controller needs only a few external parts to work. The xtal and the capacitors C1 and C2 and the small reset-circuit R1, C5. The capacitors C3 and C4 bypass the powerline for RF. The outputs PB0 to PB3 are connected to the inputlines of the printerport. (PB0: Pin 13, PB1: Pin 12, PB2: Pin 11, PB3: Pin 10 - according to the DIGI_NED documentation). The strobe-signal, Pin 1, of the printerport is connected to pin PD2.

The Construction

The circuit is mounted on a small PC-board which can be attached directly to the PC's printerport by a 25-pin sub-D connector. It may be wired freely anyway. I have placed the transistors inside the case containing the module some years ago for another project, so you will not find them on the foto of the board.

Platine Temeraturmodul im Gehäuse

 

The Powersupply

Stromversorgung

First I wanted to use the voltage from the data-pins of the printerport to supply the controller, but 2.5V is too low. You can see the space and the unused holes for the diodes on the foto of the board.

I wanted to avoid an external supply. The PC provides just the right voltages with sufficient current for the whole digipester system. In a cover of a PC-slot I drilled four holes, two for 4mm connectors and two for 2.3mm connectors.

I took a cable with a connector that fits into the cable for power supply of the disks and connect the wires to the jacks:

  • The red one, +5V, to the red 2,3mm connector
  • The next black one, 0V, to the black 2,3mm connector
  • The yellow one, +12V, to 4mm connector
  • The other black one, 0V, to the 4mm connector
The other end of the cable is connected to the cable for power supply of disks.

The 5V und 12V lines are bypassed by two 100nF capacitors and put though a ferrite choke to supress RF from inside the PC.

You should test the voltages for RF with an oszilloscope. The amount should be a few millivolts only.

I have connected the controller board to the PC's 5V by a cable with a red (+) and a black (-) 2.3mm connector.

The Transceiver of the Digipeater is connected to the 4mm, 12V connectors. It needs about 2.5A when transmitting. The PC only contains the mainboard (486/40), the graphic card, a muli-I/O-controller and a floppydrive. The PC's power supply is designed for 8A at 12V. This is sufficient to drive the PC and the transceiver. My PC handles this load without any problems, no guarantee for other PC power supplies.

Please be careful working with the voltages from inside the PC. You must not shorten the lines !
I do not intend to pay your bills for reparing your PC. You work on your own risk

Thermometerinterface

The interface, attached to the printerport of the digipeater-PC

The Software

The graphic shows the serial transmission protocol of the temperature-module. The first pulse of the clock-signal is longer than the others. It is followed by 12 short pulses. The first databit indicates positive or negative temperatures. This bit is ignored by the software. The other bits carry three BCD-Numbers coding the temperature with a resolution of 1/10°C.

Protokol of the Temperatur-Modul
Serial protocol of the Temperatur-Module

The program waits until it finds a long clock-puls. It reads each of the 13 databits at the next falling edges of the clock-signal. The bits are shifted into a shiftregister. In the lower 12 bits of the register we find three BCD-numbers coding the temperature.

This BCD-number ist transformed to an 8 bit binary, (10)*100 + (1)*10 + (0,1)*1. So the temperature range is 0°C to 25,5°C. I did not expect higher temperatures because it was winter. Higher temperatures than 25.5°C start over with 0°C. In summertime one should subtract 100 from the binary number and add it in the APRS-equations again. The temperature range would then be 10°C to 35.5°C. You have to add two lines in the sourcecode. You can taylor the range to your needs with a little bit of mathematics. Negative temperatures can not be displayed. There was no need because the digpeater is located inside the house.

The beginning of a clock signal from the thermometer is recognized by an external interrupt. As the normal external interrupt line is occupied by the communication with DIGI_NED, the second external interrupt must be simulated by the timer interrupt. The timer counts external signals and has an initial value of -1. The clock signal of the thermometer counts the timer up to 0 and the timer generates an overflow interrupt.

DIGI_NED reads the 8 input bits in two parts in multiplexed mode from the printerport. First the "Strobe"-signal is set to "1" then DIGI_NED reads the first four bits B1 - B4. After resetting the "Strobe" to "0" it reads the other bits B5 - B8.

DIGI_NED protokol
The DIGI_NED-Protocol

The program places the high-nibble of the temperature to the output after the rising edge of the strobe-signal of the printerport. After the falling edge it places the low-nibble. An external interrupt of apropriate direction makes shure that the data can be provided fast enough for the PC, about 1 microsecond.

DIGI_NED Setup

To set up the telemetry system of DIGI_NED, you have to edit the configuration file:

digi_ned.ini

If DIGI_NED shall send the telmetry values as a beacon, you have to prepare the "telemetry:" section.
At DK5JG-2:

telemetry: 60 all lpt1_8 DIGI_DEST

This means:
Send all 60 minutes on all APRS-ports from port LPT1 to the path in DIGI_DEST. The thermometer is connected to LPT1.

You can use the file "digi_tlm.ini" to format the output of the telemetry system. It is activated by:

tele_info: digi_tlm.ini

This file has four items in wintertime:

:DK5JG-2  :PARM.Temp.
:DK5JG-2  :UNIT.deg.C
:DK5JG-2  :EQNS.0,0.1,0
:DK5JG-2  :BITS.11111111,DIGI_NED Telemetry

This file has four items in summertime:

:DK5JG-2  :PARM.Temp.
:DK5JG-2  :UNIT.deg.C
:DK5JG-2  :EQNS.0,0.1,10
:DK5JG-2  :BITS.11111111,DIGI_NED Telemetry

This means:
The value is a temperature
Unit is degree Celsius
The equation is T = 0*x²+0,1*x+0 (T : temperature, x : value). The thermometer gives values between 0 and 255. This equation in wintertime transforms this value to the range 0°C to 25.5°C. The equation T = 0*x²+0,1*x+10 (T : temperature, x : value) in summertime transforms this value to the range 10°C to 35.5°C. Look at the APRS-reference for further details.
The last line concernes the digital inputs and it has no meaning for analog channels.

Sending of this file is forced at DK5JG-2, the entry is:

send: 60 all DIGI_DEST
digi_tlm.ini

If you want to read the temperature at the digipeater, send the simple message

tlm a1

to the digipeater DK5JG-2.
It will answer with a line like this:

Temp. 21.3 deg.C

depending on the temperatur at the digipeater.

The path DIGI_DEST is short at DK5JG-2 so you can only read it from a short distance.

Download

This software for the interface is free under the terms of the GNU Public License.

As Linux/Unix and DOS have different file formats for textfiles there are two files for distribution. The Text is identical in both versions.

Linux/Unix-version of the source code, unpack with: "tar xzf thermos_linux.tgz".
Dos-Version of the source code, unpack with Winzip.

 

Many thanks to Dieter, DL2GK for his tips to the translation of this text.

Zaehler

 





Home Home
Top Top
mailto Burkhard John
5.7.2006