Help with DS18S20

I just got 4 DS18S20 thermometers from Jamecohttp://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?search_type=jamecoall&catalogId=10001&freeText=302551&langId=-1&productId=302551&storeId=10001&ddkey=http:StoreCatalogDrillDownView but when I tryed the example program that comes with the onewire libraryhttp://playground.arduino.cc/Learning/OneWire it just kept on saying "No more addresses". All help is appreciated. Thanks in advance,

Just hook up one to get started.

I did but it gave me the error message listed in my first post

Try this: http://www.pjrc.com/teensy/td_libs_OneWire.html

How do you have it hooked up? Are you using a 4.7k ohm resistor? The more info you give the more people can help. ;)

I’m using 2 resistors for about 4.4kohms which is connected to vdd on one side and to 5v on the other side. the middle pin is connected to pin D10 and the rightmost pin is connected to gnd. here is my program

#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;
  }
  
  Serial.print("R=");
  for( i = 0; i < 8; i++) {
    Serial.print(addr[i], HEX);
    Serial.print(" ");
  }

  if ( OneWire::crc8( addr, 7) != addr[7]) {
      Serial.print("CRC is not valid!\n");
      return;
  }
  
  if ( addr[0] != 0x10) {
      Serial.print("Device is not a DS18S20 family device.\n");
      return;
  }

  // The DallasTemperature library can do all this work for you!

  ds.reset();
  ds.select(addr);
  ds.write(0x44,1);         // start conversion, with parasite power on at the end
  
  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.
  
  present = ds.reset();
  ds.select(addr);    
  ds.write(0xBE);         // Read Scratchpad

  Serial.print("P=");
  Serial.print(present,HEX);
  Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
    Serial.print(data[i], HEX);
    Serial.print(" ");
  }
  Serial.print(" CRC=");
  Serial.print( OneWire::crc8( data, 8), HEX);
  Serial.println();
}

The 4.7k ohm resistor needs to go from 5v supply to the middle pin (DQ) then connect the middle pin (DQ) of the DS18S20 to pin 10 of the Arduino. And ground to ground.

I wired it up as you said but it is still giving me the error I had in the first place.

Can you show a pic of your setup? You need 4.7k ohm can you get that resistance?

the schematic is attached and I’ll try to get the extra 40 or so ohms I need.

Hi the Vdd pin is not connected. Try to you connected it +5V or if you use PARASITE-POWERconnect it to GND.

Ground is pin 1. Your pic shows you have ground as pin 3.

Ive now moved all the pins to their correct positions and I can read its address and whatever else it spits out. could i have help with decoding what it gives me over the serial port? here is the code

#include <OneWire.h>

// DS18S20 Temperature chip i/o
OneWire ds(10);  // on pin 10

void setup(void) {
  // initialize inputs/outputs
  // start serial port
  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();
      return;
  }

  Serial.print("R=");
  for( i = 0; i < 8; i++) {
    Serial.print(addr[i], HEX);
    Serial.print(" ");
  }

  if ( OneWire::crc8( addr, 7) != addr[7]) {
      Serial.print("CRC is not valid!\n");
      return;
  }

  if ( addr[0] == 0x10) {
      Serial.print("Device is a DS18S20 family device.\n");
  }
  else if ( addr[0] == 0x28) {
      Serial.print("Device is a DS18B20 family device.\n");
  }
  else {
      Serial.print("Device family is not recognized: 0x");
      Serial.println(addr[0],HEX);
      return;
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44,1);         // start conversion, with parasite power on at the end

  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.

  present = ds.reset();
  ds.select(addr);    
  ds.write(0xBE);         // Read Scratchpad

  Serial.print("P=");
  Serial.print(present,HEX);
  Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
    Serial.print(data[i], HEX);
    Serial.print(" ");
  }
  Serial.print(" CRC=");
  Serial.print( OneWire::crc8( data, 8), HEX);
  Serial.println();
}

this is what it gives me over serial:
P=1 30 0 4B 46 FF FF A 10 47 CRC=47
No more addresses.
R=10 95 5F D 2 8 0 FF Device is a DS18S20 family device.
the values seem to change so I am wondering if somewhere in there the temperature is imbedded in it.

Great, glad to hear you have it working. Try using this library: http://milesburton.com/Dallas_Temperature_Control_Library Give the "Tester" example a try. It will give you a lot of understandable info. and the temp in F and C. You will need to connect the signal pin to pin 2 instead of pin 10. If you need help ask. ;)

when I ran the tester code it sent this over and over out of the serial port: Requesting temperatures...DONE Temperature for device: 0 Temp C: 85.00 Temp F: 185.00 I know for sure that it is not over 100 degrees F here. So what is my problem now?

Did you get your resistance up to 4.7K ohm?
Can you cool the DS18S20 down?
Maybe place an icecube in a plastic bag and hold it on the sensor for a couple of seconds.
Does the temp change?

the resistance is 4.71 kohms and I will try the ice cube in a bag. Thanks for all the help

I tryed out the ice cube and it didn’t work…

The 85c sounds familiar - it's what I get from my DS18B20s during the first few readings. I guess it's while they're initialising. If yours keeps doing that, perhaps it isn't getting enough power. How are you powering them?

luketheduke: Temp C: 85.00 Temp F: 185.00 I know for sure that it is not over 100 degrees F here. So what is my problem now?

85C is the power-on reset reading and you see it because the sensor has not had the time to do its job properly. There is probably nothing wrong with your gear, but no amount of ice is going to fix the problem.

I had nothing but grief with the Miles Burton stuff. Try the libraries and tutorials from here:-

http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html