Why 185F

IronJungle

Senior Member
I have had about 20 people DIY build my motorcycle gear position indicator with no issues based solely on the documentation I supply at:
http://ijprojects.blogspot.com/2012/01/suzuki-v-strom-dl1000-gear-position.html

But.... I have one guy that gets a temperature readout of 185F (that's 85C) under all conditions. The sensor is a DS18B20. The PICAXE a 18M2. Since the design has been replicated many times I suspect a wiring error in his rig. Based on the pics, the wiring "looks" fine; the solder a bit sloppy. BTW, the self test and gear position readout on his build function perfectly. Temperature readout in the only issue.

His 4k7 connected across the DS18B20 sensor ohms out at 4k7 with power off and 4k7 with power on. For reference the rig on my motorcycle and my prototype both ohm out at 4k7 with power off and about 2k3 with power on. So that is the only clue that I have on something being different. I have asked him to confirm the connection of each of the three DS18B20 sensor wires to the correct LEGs on the PICAXE. He says the ohm meter confirms a solid connection and no short between any two sensor pins.

I can't simulate any wiring error that will consistently yield a reading of 185F (85C). At first I suspected a bad DS18B20. He replaced it and no change; 185F. Just for grins I sent him a new PICAXE and no change; 185F.

Any ideas? It just seems that it should be something obvious and it's making me crazy. The PICAXE makes reading temperature off the DS18B20 just about idiot proof.

Thanks.
 

Captain Haddock

Senior Member
85 degrees C is the default output for a ds18b20 thats not working properly, I think it's a power issue but can't remember right now due to a good saturday night out:)
The program is probably fine if it's getting 85 but the connections need checking.
 

westaust55

Moderator
85°C is the reading when the DS18B20 has been powered up.

that is, it is the Power On Reset value which therefore suggests that DS18B20 has power but has not received a command to perform a Temperature conversion before the temperature has been read.

That a reading of 85°C is been received suggests that the 1-Wire comms is functioning correctly since 85°C as a binary value is not all 1's or all 0's.

Are you using the READTEMP command or a 1-Wire command to read the temp. READTEMP should be automatically waiting for the required time frame for the Temperature conversion to take place.
Even if it was the wrong type of temp sensor, ie it was a DS1820 or DS18S20 the SKIPROM and TEMPCONVERT commands are exactly the same but the resolution is different.

Maybe time to try another DS18B20 temp sensor.
 

IronJungle

Senior Member
All: Thanks for the reply.

westaust: My command is "readtemp ThermoPin, ThermoValueC"

OK, so now we know that the DC18B20 has power and the PICAXE is reading 'something'. It certainly sounds like a bad DS18B20, but they guy says he tried two of them with the same results.

Are the DS18B20s pretty durable? I have never seen a bad one, but maybe both of them were overheated during soldering, etc. If he really did try it with two DS18B20s it seems unlikely that both were bad unless he made then 'bad'.

BTW, it has been interesting to watch my build be duplicated by experienced DIY'er and first timers. I have seen the PICAXE wired in about every wacky combination imaginable (including swapping power and ground). The little PICAXE just takes the punishment and functions perfectly after things are sorted out.
 

lbenson

Senior Member
An 85 does not indicate a bad DS18B20--it indicates a bad hookup. Something is wrong--power, ground, data, missing/incorrect pullup. Power could be missing and the device could be parasitically powered. Recheck all the connections (voice of experience).
 

inglewoodpete

Senior Member
...and try a different pin on the PICAXE too, then swap the PICAXE.

However, wiring is the most likely issue. With everything in place, try a little program like the following and check that the actual pin on the DS18B20 is toggling too.

Code:
Do
  Toggle <pin>    'Replace <pin> with the actual pin ID
Loop
 

westaust55

Moderator
To be reading back a temp of 85°C, the dataline must be working correctly to receive the binary value %0000 0101 0101 0000.
The 4.7 kOhm pull-up resistor is working otherwise you will not receive any "1" bits.
The PICAXE output pin must be working to send a command to the DS18B20 to read the value.

Thinking further, recheck the power connections to the DS18B20. If not providing power to the power pin (so in effect parasitically powered) and/or if the power supply is weak/limited/high resistance, then the DS18B20 my be resetting when a temp conversion command is sent which would cause the value of 85°C to be read back when the subsequent READSCRATCHPAD command is sent to fetch the temperature data.
 

IronJungle

Senior Member
Very good logic chain. This makes sense to me. I will have him double triple check wiring to the sensor.

I would think the power supply is good as it is a regulated 5VDC from a motorcycle battery.

To be reading back a temp of 85°C, the dataline must be working correctly to receive the binary value %0000 0101 0101 0000.
The 4.7 kOhm pull-up resistor is working otherwise you will not receive any "1" bits.
The PICAXE output pin must be working to send a command to the DS18B20 to read the value.

Thinking further, recheck the power connections to the DS18B20. If not providing power to the power pin (so in effect parasitically powered) and/or if the power supply is weak/limited/high resistance, then the DS18B20 my be resetting when a temp conversion command is sent which would cause the value of 85°C to be read back when the subsequent READSCRATCHPAD command is sent to fetch the temperature data.
 
Top