Powered DS18S20 won't measure temperature (always 85 deg)?

spacewrench

New Member
I have a couple of DS18S20s attached to a microcontroller that I plan to use to control a radiant heat system. Right now, they're on about 3" of wire -- I'm just trying to get my software working right. They're wired in powered mode: pin 1 = gnd, pin 2 = 4.7k pull-up to 5v, pin3 = 5v. I wrote code to read and write the OneWire bus, and I can get the serial numbers and read/write the scratchpad memory and EEPROM. If I add another device to the bus, it shows up too, so I think the code is correct.

Unfortunately, when I issue a "Convert Temperature (0x44)" command, I never get a good result -- the scratchpad always says 85 degrees. (Another possible problem is that the "Read Power Supply (0xB4)" command says at least one device is parasite-powered.)

Are there any known issues with the T0-92 sensors running in powered mode? I tried the same sensors in parasite-powered mode (using a different interface and software, so I don't know exactly what it's doing) and they seem to work OK.

Here's a sample session with my code:
Code:
Demo> ow list
Device  0: 10:06:0a:09:01:08:00:ba
Device  1: 10:17:0d:09:01:08:00:87
2 devices.
Demo> ow read 0
aa 00 00 00 ff ff 0c 10 7f
Temp  85.0°C
Scratch $0000 (High/Low=0°C/0°C)
Demo> ow write 0 257 <<<< write into eeprom
done.
Demo> ow read 0
aa 00 01 01 ff ff 0c 10 85
Temp  85.0°C
Scratch $0101 (High/Low=1°C/1°C)
Demo> ow measure 0
Command sent.
Demo> ow read 0
aa 00 01 01 ff ff 0c 10 85
Temp  85.0°C
Scratch $0101 (High/Low=1°C/1°C)
 
I have a couple of DS18S20s attached to a microcontroller that I plan to use to control a radiant heat system. Right now, they're on about 3" of wire -- I'm just trying to get my software working right. They're wired in powered mode: pin 1 = gnd, pin 2 = 4.7k pull-up to 5v, pin3 = 5v.
I was going to say "that's not right", but that's exactly how I connected one to a PICAXE. No reason it shouldn't work.

Hardware: Check your continuity and voltages at the ds18s20's. Unlikely, but could you have reversed pins 1 and 3?

Software: Since you can talk to the devices, it seems the only problem is the ConvertT. Are you doing a match rom (0x55+romid) prior to sending commands to the device, esp prior to the ConvertT, to make sure its getting to the right device? Are you waiting 750ms (or sampling the bus to check if ConvertT is done) prior to reading the scratchpad?
 
sda said:
Software: Since you can talk to the devices, it seems the only problem is the ConvertT. Are you doing a match rom (0x55+romid) prior to sending commands to the device, esp prior to the ConvertT, to make sure its getting to the right device? Are you waiting 750ms (or sampling the bus to check if ConvertT is done) prior to reading the scratchpad?
I've tried {Match-ROM + Convert} and {Skip-ROM + Convert}...no differences. I haven't had any luck sampling the bus to monitor the progress of the conversion, either. That, coupled with the report that there's a parasite-powered device on the bus, makes me think I've got something basic screwed up. Perhaps something with the 5v/3.3v of the microcontroller? The DQ line is pulled up to 5v, and the uC pin is 5v-tolerant, but it can't drive all the way to 5v. (Although the pull-up gets it up from 3.3v to 5v.)

I have to make a string of sensors to install in the floor right away, since that's holding up my next construction step. Fortunately, I've been able to read the sensors from a PC using a serial-port adapter, so at least I know the sensors and the bus are OK. I can install them and figure out how to talk to them from the microcontroller later. (The weird thing is, the serial-port adapter runs the sensors in parasite-power mode, which seems like it would be harder to get right. However, the adapter has a DS2480B OneWire bus controller in it to handle all the timing, so maybe that's what I'll end up doing with the microcontroller, too. Or I could just use the PC to control the radiant system...)

Thanks for the response!
 
If you've got ONE parasitically powered temperature sensor on the bus, you need to hold up the bus for the recommended time (~750mS) after a ConvertT.

Take that sensor off the bus and try your method again.

Mitch
 
Back
Top