Pages: [1]   Go Down
Author Topic: DS18B20 NOT RESPONDING  (Read 1312 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using a single DS18B20 with a 3 wire connection (5v/Gnd/Signal to pin 2 & 4.7K pull-up) to Arduino UNO. Downloaded Onewire library and sample program(s).

Programs run fine, but no response from DS18B20. Serial monitor looks like.
-1000.00
-1000.00
Etc…..

1. I’ve modified program and tried using different pins and sensors. (Although both sensors are from the same Ebay source)
2. I’ve downloaded and run a program to find the Onewire address, but the program indicates no sensors found.

Is it possible the sensor(s) is dead? I am 100% sure my connections are correct and were checked with a voltmeter. Any ideas would be appreciated.
Logged

Dubuque, Iowa, USA
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2507
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try connecting the DS18B20's 5V and GND both to GND and just use the pullup on the signal pin to 5V for power.

Don't ask me why they sometimes don't work if you connect the 5V to 5V -- I don't know.
Logged

Offline Offline
Edison Member
*
Karma: 48
Posts: 1627
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Need to see your code. Is it set up to connect to ds18b20 using 5V or parasite power?
You could also try a lower pullup resistor - 3.3k or even 1.5k.

Pete
Logged

Where are the Nick Gammons of yesteryear?

Offline Offline
Newbie
*
Karma: 1
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the input, I'll try different connections and pull-ups. I've tried the 5v and 3.3v source from the Uno with the same result. I've powered the Uno with 5v.
Logged

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12156
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Firstly double-check your pin-out - in fact always double-check all circuit wiring before powering up (saves
a lot of money).

Try connecting the DS18B20's 5V and GND both to GND and just use the pullup on the signal pin to 5V for power.

Don't ask me why they sometimes don't work if you connect the 5V to 5V -- I don't know.

I've used dozens of DS18B20's never the slightest issue (but mostly with very short cable).

If the sensor is on a long cable then you should (after testing without the cable):

1) used screened cable, ground connected to screen  (really important)
2) do not run the cable alongside power wiring (motors, mains, etc).
3) have a 0.1uF decoupling capacitor between +5V and ground _at the sensor_
4) Have the pull-up resistor _at the Arduino end_

Don't use parasite power if you can help it, less reliable, perhaps reduce the pull-up resistor to 2k2 for very long cables...
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 1
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No luck with parasitic setup, or standard 5v setup with 3.3K pull-up. Maybe the images tell something.


* sensorwiring.JPG (552.03 KB, 2157x1554 - viewed 58 times.)

* screen.jpg (59.33 KB, 753x628 - viewed 37 times.)
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2268
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Programs run fine, but no response from DS18B20.

You say that, but the best evidence that it's true is a response from the DS18B20.

A proper listing of the code will be more useful than the pictures. I don't see the logic in the getTemp section shown. It seems that you are printing out a value but you you don't know where it is coming from, and I don't know why you need to do that sort of stuff anyway.

Here is some code that works.

http://sheepdogguides.com/arduino/ar3ne1tt.htm

If you intend to only use one or two sensors, there is nothing wrong with this approach, particularly as you  are doing it on breadboard. If you intend to use more, it would pay to move to using the one-wire system that the DS18B20 is designed for.  In that event I would recommend software and tutorials from Hacktronics
Logged

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12156
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No luck with parasitic setup, or standard 5v setup with 3.3K pull-up. Maybe the images tell something.

Can't see how the sensor itself is wired.  How long is the cable?  Its not screened so wouldn't expect
it to work well if long.

Have you tried just wiring it up without the cable?

Is there a decoupling capacitor on the sensor (in 3-wire mode)?
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 1
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Used the code recommended by Nick...http://sheepdogguides.com/arduino/ar3ne1tt.htm without success. Great simple code!
Serial port just reads 0.00 temp.
Sensor is either of two that I tested. Its a waterproof version with a 1m cable. Purchased on Ebay. It seems unlikely to me, but I suppose it could be a DOA sensor?
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2268
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It seems unlikely to me, but I suppose it could be a DOA sensor?

I have ten and they all work fine. I have wired one the wrong way round and it survived. You know when this happens, as the lights go out and they get seriously hot.

Are you sure the code agrees with the wiring? I recall the signal goes to A0 in the code.

The only code I know of for testing is the Hacktronics address finder. It doesn't measure temperature, it just looks for a singe sensor and reports the address.   
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did change the input pin to 2. My next options are to try
1. A0 pin (as in the code)
2. Capacitor
Logged

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2268
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The devices work OK on digital or analogue pins, just so long as the code knows where it is.  You should not need a capacitor unless you live in a truly filthy electronic environment, but if the cable is yours, you might try taking it off and putting the sensor direct on to the breadboard.
Logged

Hamburg, Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

MBird,
In a previous thread I posted my DS1820 library. Maybe it will help.
http://forum.arduino.cc/index.php?topic=173589.msg1292707#msg1292707
It should help you to see how to talk to the device.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Totoro, I'll give it a try, but I am fairly certain the sensors, not the code or connections, are at fault. The sensors are Ebay waterproof versions with 1m cable. I suspect if I strip the cable jacket to the sensor end, I'll find the sensor is potted. Just doesn't make for broken wire troubleshooting.

Way too much time spent on $3 sensors from exotic origins (ie Hong Kong).

I am however amazed at the amount of support one can get on this forum and am truly appreciative.

Logged

Pages: [1]   Go Up
Jump to: