Datalogger Axe110p DS18B20

ernio

New Member
DS18B20 sensor in the input7 always gives me the value 127. I have used the wizard and put the sensor facing down.
Thanks
 

Attachments

Last edited:

BeanieBots

Moderator
Sounds like a memory issue.
An error with the DS18B20 usually gives 0,255 or 85

What do you get in b0 if you run this code?

main:
readtemp 7,b0
Pause 500
debug
goto main
 

ernio

New Member
datalogger ds18b20

Thank you for your useful answer.
When I have run your code b0=85. The diference it's that I had used an external power suply (5V) instead of the batteries (3,8V). When I use the batteries b0=85, external power suply b0=127. If I have understood you well it seems that the ds18b20 doesn't work properly.
I have had this suspicion, but to change little stuff is complicate. Near me the only temperature sensor available is ds18S20, little diference, but the outputs don't seem equal. I don't know if it works but I'll give it a try.
Thanks again.


Sounds like a memory issue.
An error with the DS18B20 usually gives 0,255 or 85

What do you get in b0 if you run this code?

main:
readtemp 7,b0
Pause 500
debug
goto main
 

eclectic

Moderator
ernio.

Please try this first.

Remove the DS18B20 from the Datalogger.

Read Manual 2, page 135.

Build the circuit, and try the program.

What happens?

e
 

BeanieBots

Moderator
A few things,
PICAXE does not support the DS18S20, only the DS18B20 will work with readtemp.
The DS18B20 requires a good clean 5v supply.
Min 4.5v, max 5.5v, so a supply of 3.8v is unlikely to return anything meaningful.
 

ernio

New Member
Sorry, there may be a mistake because my second manual (Basic commands) has 118 pages; the third 45. In my second manual there is a circuit in the pag. 80 (readtemp) with a LCD that could fit with your description. Is it right? or is there another manual I don't know? If there is could you told me, please, where it is?
Thanks
ernio.

Please try this first.

Remove the DS18B20 from the Datalogger.

Read Manual 2, page 135.

Build the circuit, and try the program.

What happens?

e
 

BeanieBots

Moderator
The current manual 2 (Basic commands) has 188 pages.
The latest versions of all the manuals can be found from the "PICAXE Manual" link at the top of this forum.
 

ernio

New Member
Thanks. I apreciate the tip that DS18S20 doesn't work. I have tried several times with the external power suply (5V) and the result is always the same (temperature=127). I don't know how to probe the DS18B20 independently of the datalogger, my multimeter is analogic and it always gives me (graund and DQ) 5 V but according to the datasheet, the sensor's output is digital and I don't know how to manage it. Sorry if the answer is quite confused and thanks for your time.

A few things,
PICAXE does not support the DS18S20, only the DS18B20 will work with readtemp.
The DS18B20 requires a good clean 5v supply.
Min 4.5v, max 5.5v, so a supply of 3.8v is unlikely to return anything meaningful.
 

ernio

New Member
Thanks, I found it: Readtemp command. It needs a LCD I don't have, could an debug do the same work?
Thanks for your time
The current manual 2 (Basic commands) has 188 pages.
The latest versions of all the manuals can be found from the "PICAXE Manual" link at the top of this forum.
 

premelec

Senior Member
Yes DEBUG or SERTXD with the variable you have loaded READTEMP into being the read value from the DS chip... of course you must still have the serial connection to the computer connected for the reading to appear on screen :)
 

ernio

New Member
I did it. Project board 18X. Input 0 without resistence, external power suply(5V), 4k7 resistence and the follow code:
main:
readtemp 0,b0
Pause 500
debug
goto main

I got b0=127. Does it mind that the sensor doesn't work? All the mesures seem consistent.
Thanks

Yes DEBUG or SERTXD with the variable you have loaded READTEMP into being the read value from the DS chip... of course you must still have the serial connection to the computer connected for the reading to appear on screen :)
 
Last edited:

BeanieBots

Moderator
I did it. Project board 18X. Input 0 without resistence, external power suply(5V), 4k7 resistence and the follow code:
main:
readtemp 7,b0
Pause 500
debug
goto main

I got b0=127. Does it mind that the sensor doesn't work? All the mesures seem consistent.
Thanks
Your text implies you are using input 0 without a pull-up resistor.
That code must have the DS18B20 on input 7 with a 4k7 pull-up.
 

ernio

New Member
Sorry I copied bad the code:
main:
readtemp 0,b0
Pause 500
debug
goto main

input 0 with the 4k7 pull-up and the DS18B20 in a protoboard. External power suply (5V), the picaxe in a 18 proiect board that have not resistences in the input 0 and 1. In this case
b0=127. Without the 4k7 pull-up b0=0. In my case If i dont't put the 4k7 resistence the bo=0 instead of 127. Acording to the proiect board datasheet the input 0 and 1 are analogic, the others digital.
Thanks for your time

Your text implies you are using input 0 without a pull-up resistor.
That code must have the DS18B20 on input 7 with a 4k7 pull-up.
 
Last edited:

tarzan

Senior Member
readtemp12

Try this on CT5 input7
Code:
#picaxe 18X
#com 1
#Terminal 4800
 
    Symbol TReading = W0
    Symbol Whole = B2
    Symbol Fract = B3
    Symbol SignBit = B4
    Symbol Dig_ = B5
    Symbol TempC_100 = W4
 
Top:
    ReadTemp12 7,TReading
    SignBit = TReading / 256 / 128
    If SignBit = 0 Then Positive
    ' its negative
    TReading = TReading ^ $ffff + 1
Positive:
    TempC_100 =  TReading * 6  ' TC = value * 0.0625
    TReading = TReading * 25 / 100
    TempC_100 = TempC_100 + TReading
    GoSub DisplayTemp
    Wait 1
    GoTo Top
 
DisplayTemp:
   Whole = TempC_100 / 100
   Fract = TempC_100 % 100
   If SignBit = 0 Then DisplayTemp_1
   SerTxD ("-")
DisplayTemp_1:
   SerTxD (#Whole, ".")
  ' be sure the fractional is two digits
   Dig_ = Fract / 10
   SerTxD (#Dig_)
   Dig_ = Fract % 10
   SerTxD (#Dig_, 13, 10)
   Return
Source: http://www.phanderson.com/picaxe/ds18b20_2.html
 

BeanieBots

Moderator
There's little point in trying out slightly more complex software. Need to get the hardware working first.
Not sure if a DS18B20 can be used on IP0.
Try it on input 7 WITH a 4k7 pull-up using the code I posted.
If that does not work, then the sensor is probably faulty.
If it does, then progress to the more complex stuff.
 

ernio

New Member
Thanks for your help. I didn't know those pages.
I have tried the program and it always gives me the balio 0.00.


Try this on CT5 input7
Code:
#picaxe 18X
#com 1
#Terminal 4800
 
    Symbol TReading = W0
    Symbol Whole = B2
    Symbol Fract = B3
    Symbol SignBit = B4
    Symbol Dig_ = B5
    Symbol TempC_100 = W4
 
Top:
    ReadTemp12 7,TReading
    SignBit = TReading / 256 / 128
    If SignBit = 0 Then Positive
    ' its negative
    TReading = TReading ^ $ffff + 1
Positive:
    TempC_100 =  TReading * 6  ' TC = value * 0.0625
    TReading = TReading * 25 / 100
    TempC_100 = TempC_100 + TReading
    GoSub DisplayTemp
    Wait 1
    GoTo Top
 
DisplayTemp:
   Whole = TempC_100 / 100
   Fract = TempC_100 % 100
   If SignBit = 0 Then DisplayTemp_1
   SerTxD ("-")
DisplayTemp_1:
   SerTxD (#Whole, ".")
  ' be sure the fractional is two digits
   Dig_ = Fract / 10
   SerTxD (#Dig_)
   Dig_ = Fract % 10
   SerTxD (#Dig_, 13, 10)
   Return
Source: http://www.phanderson.com/picaxe/ds18b20_2.html
 

ernio

New Member
As you said I tried the input 7; it gives me the balio 85.
Thanks for your time
There's little point in trying out slightly more complex software. Need to get the hardware working first.
Not sure if a DS18B20 can be used on IP0.
Try it on input 7 WITH a 4k7 pull-up using the code I posted.
If that does not work, then the sensor is probably faulty.
If it does, then progress to the more complex stuff.
 

premelec

Senior Member
Are you SURE you have the DS unit connected correctly? Download the data sheet and look at the diagrams and check it carefully - sometimes it's the simple stuff that trips us up... :)
 
Top