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…..
I’ve modified program and tried using different pins and sensors. (Although both sensors are from the same Ebay source)
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.
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.
Mbird:
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.
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
Used the code recommended by Nick...Using a DS18B20 Temperature sensor with an Arduino- ar3ne1tt 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?
Mbird:
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.
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.
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.