Go Down

Topic: Help with DS18B20, not found (Read 4 times) previous topic - next topic

outofsight

Hi,

I have a single DS1820B and the OneWire library from http://www.pjrc.com/teensy/td_libs_OneWire.html

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

Any ideas what else I could be missing?

Thanks in advance.


robtillaart


Quote
Any ideas what else I could be missing?


Posting your code?


have you tried  - http://www.milesburton.com/Dallas_Temperature_Control_Library - works like a charm on the UNO
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

outofsight



Quote
Any ideas what else I could be missing?


Posting your code?



The code is simply the sample included with the OneWire library...

Code: [Select]

#include <OneWire.h>

/* DS18S20 Temperature chip i/o */

OneWire  ds(10);  // on pin 10

void setup(void) {
  Serial.begin(9600);
}
   
void loop(void) {
  byte i;
  byte present = 0;
  byte data[12];
  byte addr[8];
 
  if ( !ds.search(addr)) {
    Serial.print("No more addresses.\n");
    ds.reset_search();
    delay(250);
    return;
  }
  ....



have you tried  - http://www.milesburton.com/Dallas_Temperature_Control_Library - works like a charm on the UNO


I tried this also and loaded the example sketch that ships with that library, also the same result.

robtillaart


Sounds more and more like hardware.

- how long is the cable used?
- have you tried without the resistor?

- did you (double) check the pin 1 and 3
- did you (double) checked the cables?

I assume you have but I can't think of anythink better yet ...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

outofsight



Sounds more and more like hardware.

- how long is the cable used?
- have you tried without the resistor?

- did you (double) check the pin 1 and 3
- did you (double) checked the cables?

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.


Go Up