ultimo aggiornamento il 10 novembre 2008

 
Quella visibile nelle figura a fianco è un piccolo modulo (la basetta misura 24x20mm) con le funzioni di sensore di temperatura ed è basato sull'integrato DS1620 prodotto dalla MAXIM.
Le sue caratteristiche sono
  • Non richiede componenti esterni
  • Alimentazione compresa tra 2.7V a 5.5V
  • Temperature misurate tra -55°C a +125°C con 0.5°C di incremento
  • La temperature è letta come un valore a 9-bit
  • Tempo di conversione 750ms (max)
  • Valori di settaggio del termostato sono salvati in una memoria non volatile
  • I dati solo letti e scritti tramite un'interfaccia a 3 fili CLK, DQ, RST )

La scheda utilizza 3 linee del processore, più alimentazione.
Si potrà utilizzare un circuito stampato oppure montare il tutto su una piccola basetta millefori.
La lettura della temperatura può essere fatta tramite il PC e la finestra DEBUG oppure tramite un LCD seriale.

PDF originale della Parallax con la descrizione del sensore.

homotix

PCBA

OurPCB

 

Questo modulo è descritto sul numero 277-278 in edicola nel mese di Luglio 2008 della rivista Fare Elettronica nella sezione ROBOT ZONE nell'articolo dal titolo Moduli input/output per la scheda robotica che descrive la costruzione di ben 11 moduli da collegare alla scheda basata sul processore BS2 SX di PARALLAX.

 

Schema a blocchi dell'integrato

 

 
Elenco componenti
R1 1 Kohm 1/4W
C1 0,1 uF multistrato
IC1 DS1620 codice RS 540-5258
SV1 strip 5 pin femmina

componenti_modulo_temeperatura-ds1620.jpg

Circuito stampato e disposizione componenti

 

DS1620 Termometro e termostato digitale
Piedinatura Datasheet Foto dell'integrato

 

Montaggio e collaudo
Per la costruzione del modulo si procederà iniziando dalla realizzazione del circuito stampato.
Per la la sua realizzazione, si utilizzerà una basetta in vetronite (monofaccia) delle opportune dimensioni.
Il metodo potrà essere quello della fotoincisione o del trasferimento termico utilizzando i cosiddetti fogli blu (PRESS-N-PELL)
Una volta inciso il rame, si verificherà in controluce o mediante l’utilizzo di un multimetro che non vi siano cortocircuiti soprattutto tra le piste più vicine.
Si passerà quindi alla foratura della stessa, utilizzando principalmente una punta da 0,8 mm o da 1 mm.
In seguito, si potrà passare al posizionamento e alla saldatura dei componenti.
Per la saldatura si utilizzerà un piccolo saldatore a punta fine, della potenza di circa 25 – 30 W.
Si collegheranno il connettore SV1 con il connettore X4, della scheda BS2 SX mediante appositi cavi, aiutandosi con lo schema.
Si passerà quindi al test del modulo, che non necessita di taratura. Utilizzando l’apposito programma, verrà visualizzato il valore della temperatura in gradi Celsius e Fahrenheit

dettaglio_collaudo_modulo-ds1620.jpg

Lettura della temperatura tramite la finestra DEBUG

 

 

' {$STAMP BS2sx}

' {$PBASIC 2.5}

'*************************************

'Programma:test_modulo_DS1620.bsx

'Versione: 1.0

'Collaudo modulo DS 1620

'*************************************

'====Define Pins and Variables ====

DQ     CON   2     ' Pin 2 <=> DQ.

CLK    CON   1     ' Pin 1  => CLK.

RST    CON   0     ' Pin 0  => RST (high = active).

DSdata VAR   Word  ' Word variable to hold 9-bit data.

Sign   VAR   DSdata.BIT8   ' Sign bit of raw temperature data.

T_sign VAR  Bit    ' Saved sign bit for converted temperature.

'==== Define DS1620 Constants ====

' >>> Constants for configuring the DS1620

Rconfig   CON   $AC   ' Protocol for 'Read Configuration.'

Wconfig  CON   $0C   ' Protocol for 'Write Configuration.'

CPU       CON   %10   ' Config bit: serial thermometer mode.

NoCPU    CON   %00   ' Config bit: standalone thermostat mode.

OneShot CON  %01' Config bit: one conversion per start request.

Cont      CON   %00   ' Config bit: continuous conversions after start.

' >>> Constants for serial thermometer applications.

StartC  CON   $EE   ' Protocol for 'Start Conversion.'

StopC   CON   $22   ' Protocol for 'Stop Conversion.'

Rtemp   CON   $AA   ' Protocol for 'Read Temperature.'

' >>> Constants for programming thermostat functions.

RhiT CON $A1 ' Protocol for 'Read High-Temperature Setting.'

WhiT CON $01 ' Protocol for 'Write High-Temperature Setting.'

RloT CON $A2 ' Protocol for 'Read Low-Temperature Setting.'

WloT CON $02 ' Protocol for 'Write Low-Temperature Setting.'

'==== Begin Program ====

LOW RST   ' Deactivate '1620 for now.

HIGH CLK  ' Put clock in starting state.

PAUSE 100 ' Let things settle down a moment.

HIGH RST  ' Activate the '1620 and set it for continuous..

SHIFTOUT DQ,CLK,LSBFIRST,[Wconfig,CPU+Cont]' ..temp conversions.

LOW RST   ' Done--deactivate.

PAUSE 50  ' Wait for the EEPROM to self-program.

HIGH RST  ' Now activate it again and send the..

SHIFTOUT DQ,CLK,LSBFIRST,[StartC] ' Send start-conversion protocol.

LOW RST   ' Done--deactivate.

'The loop below continuously reads the latest temperature from

'the DS1620.

again:

  PAUSE 1000  ' Wait a second between readings.

  HIGH RST    ' Activate the '1620.

  SHIFTOUT DQ,CLK,LSBFIRST,[Rtemp] ' Request to read temperature.

  SHIFTIN DQ,CLK,LSBPRE,[DSdata\9] ' Get the temperature reading.

  LOW RST

  T_sign = Sign         ' Save the sign bit of the reading.

  DSdata = DSdata/2     ' Scale reading to whole degrees C.

  IF T_sign = 0 THEN no_neg1

    DSdata = DSdata | $FF00 ' Extend sign bits for negative temps.

no_neg1:

DEBUG CLS

  DEBUG SDEC DSdata," Gradi C",CR   ' Show signed temperature in C.

    DSdata = (DSdata */ $01CC) ' Multiply by 1.8.

  IF T_sign = 0 THEN no_neg2  ' If negative, extend sign bits.

    DSdata = DSdata | $FF00

no_neg2:

    DSdata = DSdata + 32            ' Complete the conversion.

    DEBUG SDEC DSdata," Gradi F",CR ' Show signed temperature in F.

GOTO again                     ' Repeat forever.

 


Programma
TEST_MODULO_DS1620.BSX

 

Lettura della temperatura tramite LCD seriale

' {$STAMP BS2sx}
' {$PBASIC 2.5}
'*************************************
'Programma:test_modulo_DS1620.bsx
'Versione: 1.0
'Collaudo modulo DS 1620
'Adattamento di Adriano Gandolfo
'www.adrirobot.it
'Originale della Parallax, Inc.
'*************************************
' ===================== Define Pins and Variables ================
DQ CON 2 ' Pin 2 <=> DQ.
CLK CON 1 ' Pin 1 => CLK.
RST CON 0 ' Pin 0 => RST (high = active)
SO CON 12 ' serial output
Baud CON 240 '9600, 8 bit, no parity, 1 bit stop
DSdata VAR Word ' Word variable to hold 9-bit data.
Sign VAR DSdata.BIT8 ' Sign bit of raw temperature data.
T_sign VAR Bit ' Saved sign bit for converted temperature.
' ===================== Define DS1620 Constants ===================
' >>> Constants for configuring the DS1620
Rconfig CON $AC ' Protocol for 'Read Configuration.'
Wconfig CON $0C ' Protocol for 'Write Configuration.'
CPU CON %10 ' Config bit: serial thermometer mode.
NoCPU CON %00 ' Config bit: standalone thermostat mode.
OneShot CON %01 ' Config bit: one conversion per start request.
Cont CON %00 ' Config bit: continuous conversions after start.
' >>> Constants for serial thermometer applications.
StartC CON $EE ' Protocol for 'Start Conversion.'
StopC CON $22 ' Protocol for 'Stop Conversion.'
Rtemp CON $AA ' Protocol for 'Read Temperature.'
' >>> Constants for programming thermostat functions.
RhiT CON $A1 ' Protocol for 'Read High-Temperature Setting.'
WhiT CON $01 ' Protocol for 'Write High-Temperature Setting.'
RloT CON $A2 ' Protocol for 'Read Low-Temperature Setting.'
WloT CON $02 ' Protocol for 'Write Low-Temperature Setting.'
' ===================== Begin Program ============================
SEROUT SO, Baud, ["&$"]
PAUSE 100
SEROUT SO, Baud, ["1TermometroDS1620C#$"]
PAUSE 100
LOW RST ' Deactivate '1620 for now.
HIGH CLK ' Put clock in starting state.
PAUSE 100 ' Let things settle down a moment.
HIGH RST ' Activate the '1620 and set it for continuous..
SHIFTOUT DQ,CLK,LSBFIRST,[Wconfig,CPU+Cont] ' ..temp conversions.
LOW RST ' Done--deactivate.
PAUSE 50 ' Wait for the EEPROM to self-program.
HIGH RST ' Now activate it again and send the..
SHIFTOUT DQ,CLK,LSBFIRST,[StartC] ' Send start-conversion protocol.
LOW RST ' Done--deactivate.
' The loop below continuously reads the latest temperature from
' the DS1620.
again:
PAUSE 1000 ' Wait a second between readings.
HIGH RST ' Activate the '1620.
SHIFTOUT DQ,CLK,LSBFIRST,[Rtemp] ' Request to read temperature.
SHIFTIN DQ,CLK,LSBPRE,[DSdata\9] ' Get the temperature reading.
LOW RST
T_sign = Sign ' Save the sign bit of the reading.
DSdata = DSdata/2 ' Scale reading to whole degrees C.
IF T_sign = 0 THEN no_neg1
DSdata = DSdata | $FF00 ' Extend sign bits for negative temps.
no_neg1:
SEROUT SO, Baud, ["2Valore: ",SDEC DSdata,"C#$"]' Show signed temperature in C.
PAUSE 100
GOTO again


Programma TEST_MODULO_DS1620_LCD.BSX

 

Elenco revisioni:
10/11/2008 Inserito listato programma per gestione LCD seriale
07/07/2008 Inserito listato programma, altre immagini
10/06/2008 Aggiornato pagina.
28/04/2008 Emissione preliminare
Private Policy Cookie Policy