Broken DS18B20

Joeroddis

Member
Hello everyone, laying in the bottom of my box of 'useful bits' i found a little sealed package with DS18B20 written on it, i found out that this was the digital temp sensor.

I decided to have a mess about but i can't get it to work, i think i may have fried it. I have it connected the right way for sure and i've got a 4k7 resistor between Vc and adc2 (picaxe 18a) .

Basically i have coded it basically to say turn output 6 on for so long when the temp gets above a certain point. The ouput is connected to a monostable, which has an LED on it's output. Problem is, that this output is always on. I tried changing the program so that op6 would only come on if b2 > 220, but it is still always on, this is impossible being as the thermometer is cool to the touch.

Even more strange is that when i connect my multimeter beteen ground and vcc pin i get 5.08 volts, when i connect my multimeter between ground and the ouput pin i get 5.05v. i suppose this would explain why the monostable hasn't turned off yet, but why is the chip always outputting 5.05v. Surely if i had broken the chip, it wouldn't show anything across the terminals.

Any ideas?
 

ylp88

Senior Member
The DS18B20 is a digital temperature sensor, not analog, and therefore is not read using the PICAXE's ADC functions. The voltage you are measuring is probably due to the 4.7k pull-up resistor on the pin, which as you state correctly, is required. You've connected the device's output to an ADC pin but do note that you should be using the READTEMP/READTEMP12 command to use this device.

ylp88
 
Last edited:

Joeroddis

Member
Yes it is now working, but looks like i'm gonna have to rethink my design :| the 750ms delay is too long. anyway thanks for the help ylp88
 

hippy

Ex-Staff (retired)
One option is to put an 08M between the DS18B20 and your master PICAXE. The 08M can issue a READTEMP and be ready to send a result to the master when told to using SEROUT/SERIN, having sent its data the 08M issues another READTEMP and waits to be askedagain.

That won't get round only being able to get a data update every 750mS but it does mean there's only a very short delay between asking for it and getting it, and the master isn't held up waiting for READTEMP itself.
 

Joeroddis

Member
Hey, thanks for the reply, i actually don't have any 08m but i have got about 8 18a and 18x and one 28x. never found need for one until now.
I have built the circuit on the same board but just used an 18a to do the readtemp
 
Top