help me :idea:

Sezione dedicata al sistema di sviluppo BASCOM-AVR per i micro AVR
At90s, Attiny, Atmega e Xmega

help me :idea:

Postby ...mohammad » 25 May 2014, 22:32

Hi all,
I launched ds18b20 sensor and it works very well
But there is a problem is that sometimes the sensor output will remain disconnected from the 0 degree
And his power is not interrupted to be true
I got up with a resistance of 4.7 k pull-up
Cable length is 2 meters, now I'm doing this is not true
Besides moisture sensor that works well but sometimes ds18b20 0 indicates power is interrupted to correct and should be
Do you have ideas to guide me?
Thanks
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby deluca » 26 May 2014, 07:48

@mohammad,
this is an italian forum, but we could somehow help you.
But first, according to the rules of the forum, you should first introduce yourself in section created for this purpose.
Next, you must indicate which microcontroller and development tools and are using.
Without these elements we can't help you.

Best regards.
Ciao
Il mio sito: http://www.delucagiovanni.com ......e la chat: chat/
User avatar
deluca
Site Admin
 
Posts: 1104
Joined: 19 Jun 2011, 10:44
Location: 95123 - Catania (Italy)

Re: help me :idea:

Postby ...mohammad » 26 May 2014, 13:37

I am an Iranian.
Allow to work in this forum
Thank you
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby einstein » 26 May 2014, 14:14

Dear mohammad, you're welcome.
To facilitate the work of those who might help you,
try to write or translate the next topics in Italian language.

Ciao.
User avatar
einstein
 
Posts: 88
Joined: 01 Mar 2014, 15:10
Location: Siracusa

Re: help me :idea:

Postby ...mohammad » 26 May 2014, 15:50

einstein wrote:Dear mohammad, you're welcome.
To facilitate the work of those who might help you,
try to write or translate the next topics in Italian language.

Ciao.


Ciao
occhio
Dalla mia traduzione in italiano
L'amministratore ringraziare anche
Grazie
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby ...mohammad » 26 May 2014, 15:52

deluca wrote:@mohammad,
this is an italian forum, but we could somehow help you.
But first, according to the rules of the forum, you should first introduce yourself in section created for this purpose.
Next, you must indicate which microcontroller and development tools and are using.
Without these elements we can't help you.

Best regards.


grato
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby ...mohammad » 26 May 2014, 15:54

Ciao a tutti,
Ho lanciato il sensore DS18B20 e funziona molto bene
Ma c'è un problema è che a volte l'uscita del sensore resterà scollegato dal 0 gradi
E il suo potere non viene interrotta per essere vero
Ho ottenuto con una resistenza di 4,7 k pull-up
Lunghezza del cavo è di 2 metri, ora sto facendo questo non è vero
Oltre sensore di umidità che funziona bene, ma a volte DS18B20 0 indica l'alimentazione viene interrotta per correggere e dovrebbe essere
Avete idee per guidare me?
grazie
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby einstein » 26 May 2014, 18:32

mohammad, prova a postare il codice bascom, intanto iniziamo da li,
poi cercheremo di capire i problemi dell'hardware.

ciao
User avatar
einstein
 
Posts: 88
Joined: 01 Mar 2014, 15:10
Location: Siracusa

Re: help me :idea:

Postby ...mohammad » 26 May 2014, 19:35

einstein wrote:mohammad, prova a postare il codice bascom, intanto iniziamo da li,
poi cercheremo di capire i problemi dell'hardware.

ciao

Grazie per il vostro aiuto
Ho messo questo codice
Piccolo sensore volte caldo che
Temperatura e diventa pari a zero
E non è stato fino a quando l'alimentazione non viene interrotta
Code: Select all
$regfile = "m8adef.dat"
$crystal = 1000000
$hwstack = 40
$swstack = 16
$framesize = 32

Config Lcdpin = Pin , Rs = Portb.1 , E = Portb.2 , Db4 = Portb.3 , Db5 = _
 Portb.4 , Db6 = Portb.5 , Db7 = Portb.6
Config Lcd = 16 * 2
Config 1wire = Portb.0


Deflcdchar 0 , 8 , 20 , 8 , 32 , 32 , 32 , 32 , 32

Dim Read__(8) As Byte
Dim A__ As Integer
Dim B__ As Single
Cls
Cursor Off
Lcd " DS18B20 Sensor"

Do

If Err = 1 Then
Cls
Lcd "Err"
Do
Loop
Else

   1wreset
   1wwrite &HCC
   1wwrite &H44
   Waitms 800
   1wreset
   1wwrite &HCC
   1wwrite &HBE
   Read__(1) = 1wread(8)
   Wait 1
   A__ = Makeint(read__(1) , Read__(8))
   B__ = A__ / 16
   Lowerline
   Lcd Fusing(b__ , "#.&") ; Chr(0) ; "C"
   End If
Loop
End
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby deluca » 26 May 2014, 20:13

@mohammad,
prova a modificare questo codice per il tuo micro. Ti assicuro che funziona benissimo su ATmega128

Code: Select all
'*******************************************
 '* Compiler : BasCom *
 '* Hardware : AVR-Ctrl *
 '* Temp.Sens : DS1820 *
 '* Chip type : MEGA128 *
 '* Clock frequency : 16,000000 MHz *
 '*******************************************
 $regfile = "m128def.dat"
 $crystal = 16000000
 Config 1wire = Portc.0                                     'use this pin

 Dim Ar(2) As Byte , A As Byte , I As Byte , Temperatur As Integer
 Dim Halb As Byte
 Cls

 Lcd "Temp:"
 Do
    Waitms 300
    1wreset                                                 'reset the device
    1wwrite &HCC                                            'read ROM command
    1wwrite &H44
    Waitms 200                                              'read ROM command
    1wreset                                                 'reset the device
    1wwrite &HCC                                            'read ROM command
    1wwrite &HBE                                            'read ROM command

      For I = 1 To 2
         Ar(i) = 1wread()                                   'place into array
      Next

    Locate 2 , 1
    Temperatur = Ar(1)

    If Ar(2) > 0 Then Temperatur = 0 Else Shift Temperatur , Right

    Lcd Temperatur ; ".";
    Halb = Ar(1) And 1
    If Halb = 1 Then Lcd "5" Else Lcd "0"

    Lcd " C"
 Loop
 End
Ciao
Il mio sito: http://www.delucagiovanni.com ......e la chat: chat/
User avatar
deluca
Site Admin
 
Posts: 1104
Joined: 19 Jun 2011, 10:44
Location: 95123 - Catania (Italy)

Re: help me :idea:

Postby ...mohammad » 26 May 2014, 22:47

deluca wrote:@mohammad,
prova a modificare questo codice per il tuo micro. Ti assicuro che funziona benissimo su ATmega128

Code: Select all
'*******************************************
 '* Compiler : BasCom *
 '* Hardware : AVR-Ctrl *
 '* Temp.Sens : DS1820 *
 '* Chip type : MEGA128 *
 '* Clock frequency : 16,000000 MHz *
 '*******************************************
 $regfile = "m128def.dat"
 $crystal = 16000000
 Config 1wire = Portc.0                                     'use this pin

 Dim Ar(2) As Byte , A As Byte , I As Byte , Temperatur As Integer
 Dim Halb As Byte
 Cls

 Lcd "Temp:"
 Do
    Waitms 300
    1wreset                                                 'reset the device
    1wwrite &HCC                                            'read ROM command
    1wwrite &H44
    Waitms 200                                              'read ROM command
    1wreset                                                 'reset the device
    1wwrite &HCC                                            'read ROM command
    1wwrite &HBE                                            'read ROM command

      For I = 1 To 2
         Ar(i) = 1wread()                                   'place into array
      Next

    Locate 2 , 1
    Temperatur = Ar(1)

    If Ar(2) > 0 Then Temperatur = 0 Else Shift Temperatur , Right

    Lcd Temperatur ; ".";
    Halb = Ar(1) And 1
    If Halb = 1 Then Lcd "5" Else Lcd "0"

    Lcd " C"
 Loop
 End

Grazie molto per l'aiuto
Posso utilizzare il micro interno 8 MHz?
Non causerà un problema?
Sto testando e risultato di reporting
Grazie
E grazie ragazzi forum

Ho un'altra domanda
Il sensore di temperatura è di 2 metri di distanza dal circuito.
La mia domanda è
Resistenza di pull-up è posizionato vicino al sensore o il circuito stesso?
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby ...mohammad » 27 May 2014, 00:24

Ciao
Ho provato questo programma di lavoro con mega128
Ma non ha funzionato
Solo mostrano lo zero :shock:
Ho anche provato a Proteus
Essa mostra anche solo 0.5
Questo programma funziona davvero?

********************************
Prima che il programma di test per
Ho provato il programma e
Sono sicuro che i collegamenti siano corretti sensore
Cosa faccio?
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby deluca » 27 May 2014, 07:18

Il programma che ti ho postato funziona perfettamente ;)
https://www.dropbox.com/s/47bm1nyaqtw9gs2/DS1820.jpg
Qui il valore della temperatura viene trasmesso sulla seriale.

Quindi, controlla i tuoi collegamenti e le alimentazioni. Nel caso in cui il problema si presenti ancora, prova ad accorciare il collegamento tra il micro e il sensore, oppure prova ad abbassare il valore della res-pullup.
Ciao
Il mio sito: http://www.delucagiovanni.com ......e la chat: chat/
User avatar
deluca
Site Admin
 
Posts: 1104
Joined: 19 Jun 2011, 10:44
Location: 95123 - Catania (Italy)

Re: help me :idea:

Postby ...mohammad » 27 May 2014, 15:02

deluca wrote:Il programma che ti ho postato funziona perfettamente ;)
https://www.dropbox.com/s/47bm1nyaqtw9gs2/DS1820.jpg
Qui il valore della temperatura viene trasmesso sulla seriale.

Quindi, controlla i tuoi collegamenti e le alimentazioni. Nel caso in cui il problema si presenti ancora, prova ad accorciare il collegamento tra il micro e il sensore, oppure prova ad abbassare il valore della res-pullup.


Grazie,
Un programma in cima a questa foto appartiene a voi?
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby deluca » 27 May 2014, 18:49

cosa intendi dire?

Di questi esempi ce ne stanno molti su google.
Alcuni sono nostri, altri no.
Ciao
Il mio sito: http://www.delucagiovanni.com ......e la chat: chat/
User avatar
deluca
Site Admin
 
Posts: 1104
Joined: 19 Jun 2011, 10:44
Location: 95123 - Catania (Italy)

Re: help me :idea:

Postby ...mohammad » 27 May 2014, 19:41

È molto probabile
Zero problema di temperatura sia software o hardware?
ringraziare
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby ...mohammad » 27 May 2014, 19:46

Ho allegato il sensore di portg.2 la mega 128
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby deluca » 27 May 2014, 19:49

You need to check with an oscilloscope the waveform of the 1wire signal.
for capacitive effects, the signal may be degraded. Try lowering the value of the resistance or to shorten the length of the cable. Are you using shielded cable? Post the wiring diagram of your sensor.
Ciao
Il mio sito: http://www.delucagiovanni.com ......e la chat: chat/
User avatar
deluca
Site Admin
 
Posts: 1104
Joined: 19 Jun 2011, 10:44
Location: 95123 - Catania (Italy)

Re: help me :idea:

Postby ...mohammad » 27 May 2014, 20:02

It works up to 20 meters in Datasheet
But my cable length is 2 m.
I am using this connection for regular telephone wires (3 wires)
What do you mean shields?
Can you sent me the full picture?
Sorry I ask too much
Thank you
...mohammad
 
Posts: 14
Joined: 25 May 2014, 22:24

Re: help me :idea:

Postby deluca » 27 May 2014, 20:10

https://www.dropbox.com/s/lwuqibloks11q ... 96-640.jpg

This is a typical shielded cable.
Connect the three wires to gnd, +5 volt and signal.
The shield must be connected to the gnd only microcontroller side.
Ciao
Il mio sito: http://www.delucagiovanni.com ......e la chat: chat/
User avatar
deluca
Site Admin
 
Posts: 1104
Joined: 19 Jun 2011, 10:44
Location: 95123 - Catania (Italy)

Next

Return to BASCOM-AVR

Who is online

Users browsing this forum: No registered users and 9 guests