I have pin 1 to gnd, pin 2 to digital pin 10 on my uno and pin 3 to +5v. I also have a 4k7 resistor on my breadboard across pins 2 & 3 which I believe is correct.
I loaded the example shipped with the OneWire lib, checked the bus pin was correct and pushed it to my uno but it does not find my sensor, serial output is simply "No more addresses"
I have tried two different DS18B20 sensors and two different resistors (of the same value). I've stripped my breadboard of everything else and I have 4.96v to the sensor according to my multimeter. I'm 99.99% sure everything is wired correctly as per the pinouts on http://datasheets.maxim-ic.com/en/ds/DS18B20.pdf
I assume you have but I can't think of anythink better yet ...
Yeah I agreee it sounds like hardware but im honestly sure everything is hooked up correctly.
I had soldered wire onto the first sensor, but we're talking 20cm max wich I hope is ok as I plan eventually to run these at ~ 100 meters. I deicided I might have fried the sensor with heat from the soldering iron so took a new one and plugged it directly into the breadboard.
I've got voltage at the sensor so obviously those cables are ok, I've got continuity from pin 2 back to pin 10 on the uno so that rules out any broken wire I guess. I've tried pin 2 back to a different digital pin on the uno too but to no avail.
Im sure I have the pins in the correct order, if I look at the sensor with the flat face towards me and legs pointing downward, leg 1 is on the left and is going to gnd, the right hand leg to +5v. That said they are going to gnd & +5v rails on the breadboard but the voltage is there so shouldnt make any difference right?
I have not tried without the resistor, Im really new to this so I wasnt sure if I would do any damage running without a resistor but I can try that and see what happens.
Not sure if this makes any odds but originally when I ran the "Single" sketch from the Dallas temp lib, I was getting no sensors found and a temp of -127c for address 0000000000000000
Without the resistor, still 0 devices found but the temp is now 0c
Dallas Temperature IC Control Library Demo
Locating devices...Found 0 devices.
Parasite power is: OFF
Unable to find address for Device 0
Device 0 Address: 0000000000000000
Device 0 Resolution: 0
Requesting temperatures...DONE
Temp C: 0.00 Temp F: 32.00
outofsight:
I was getting no sensors found and a temp of -127c for address 0000000000000000
I looked at these sensors a few weeks back. I seem to recall that you had to run some initial software to get the Device Address which is unique for each sensor, and then put that device address into your code that is receiving the temp value from that specific sensor. Each sensor has a unique device address, and this allows you to have multiple sensors on the same line connected to the same pin, and you're able to query the value from a specific sensor on that line by using its unique address.
DaveO:
I looked at these sensors a few weeks back. I seem to recall that you had to run some initial software to get the Device Address which is unique for each sensor, and then put that device address into your code that is receiving the temp value from that specific sensor. Each sensor has a unique device address, and this allows you to have multiple sensors on the same line connected to the same pin, and you're able to query the value from a specific sensor on that line by using its unique address.
Hope that helps.
Thanks but I already know this. Calling the search method from the OneWire library should find all of the addresses on the bus, I am calling this, my problem is that it is not finding anything on the bus though
Unfortunately I don't know what's wrong, but I bought several DS18B20's a few weeks ago.
The onewire sample example apparently is written for the DS18S20, not the B version.
When I run it, all sensors/addresses are found but I get no sensor-readings, error-msgs keep telling me "device is not a DS18S20 family device".
I did get values of -127 C after accidentally having plugged in one LM335 (and a few DS18B20's) on the bus. For some reason 85C and 0C are values I've seen several times on all sensors, but I haven't paid too much attention to know what I did wrong to get that on display.
Using the dallastemperature-Lib I do get the correct readings though.
Thanks Rob for the info,
As told I already got the stuff working. I just run the onewire-sample to see what would happen and gave my info hoping I could make a contribution. Reading back my message I can see you may have interpreted as a question, sorry for not writing it better.
DaveO:
I think the 4,7k resistor is supposed to be between sensor pin 2 and 5v+
Please check my thinking.
Arrgghhh yes, sorry that diagram was done in a rush and is, as you pointed out incorrect. My resistor is actually between pin 2 and +5v however....
As I was in the process of putting a new diagram together I happen to notice that I am indeed being dim, I appear to have ordered 4R7 not 4K7 resistors which one would assume is the reason things are not working.
I do not have any 4K7 resistors (anything common I could rob one of these from?) so cannot confirm until I have one.
Thanks for all of your help guys, sorry to have been a fool
I also didn't have 4k7 available for my last test (too lazy to get one from the attic), but 4x1K in series worked perfectly. 4r7 will indeed cause problems, but as pull up I guess 4k7 isn't really a critical value.
It wouldn't surprise me if anything between 3k3 and 10k works.
You should be able to find resistors in the right range in most electronic equipment.
The schematics given (with resistor connected to data and +5v) is exactly what tells me it's 21.87C/71.37F in my room right now.