Access to individual TO92 sensors

Hi all,

I have 5 of these TO92 temperature sensors. I was wondering how I can access those individually or store there values individually to send off to a database. I guess it must have something to do with the ROM value because that is unique to every sensor if I read the docs correctly.

I got the following out of the DS18X20_Temperature example (only two connected):

ROM = 28 FF 42 1D A1 16 4 FD
  Chip = DS18B20
  Data = 1 60 1 4B 46 7F FF C 10 14  CRC=14
  Temperature = 22.00 Celsius, 71.60 Fahrenheit
ROM = 28 FF B 30 A1 16 3 89
  Chip = DS18B20
  Data = 1 5B 1 4B 46 7F FF C 10 7  CRC=7
  Temperature = 21.69 Celsius, 71.04 Fahrenheit
No more addresses.

Can anyone help me in the right direction please? Thanks!

I googled this sensor and found an informative article that includes how to access 10 or more of these sensors on just 1 arduino input.

https://www.tweaking4all.com/hardware/arduino/arduino-ds18b20-temperature-sensor/

Z

I have found this site too. And seen from my serial monitor output, I have the different ROM values of my sensors. But how do I go about polling an individual sensor? Or if that is not possible, store every sensors' output in different variables so I can keep track?

I tried something like:

switch (addr) {
    case '0x28 0xFF 0x42 0x1D 0xA1 0x16 0x4 0xFD':
      Serial.print("First sensor: ");
      Serial.println(celsius);
      break;
    etc

But that gives an error... So does comparison using the 'if' statement.

arjan_hes: I have found this site too. And seen from my serial monitor output, I have the different ROM values of my sensors. But how do I go about polling an individual sensor? Or if that is not possible, store every sensors' output in different variables so I can keep track?

I tried something like:

switch (addr) {
    case '0x28 0xFF 0x42 0x1D 0xA1 0x16 0x4 0xFD':
      Serial.print("First sensor: ");
      Serial.println(celsius);
      break;
    etc

But that gives an error... So does comparison using the 'if' statement.

It seems that your read them all each request and the serial number is what allows you to use the data for that sensor.

Ok. Maybe my question wasn't clear enough.

I know the address of my sensor(s). How do I program a request for the temperature of 1 sensor only and store this in a variable.

So send a request for info from sensor with ID 28 FF 42 1D A1 16 4 FD, it replies with a 16 byte data string and from that subtract the temperature value.

All the example sketch is doing, is looping through all sensors. So it gets the ID first and sends that off for the temp request. I get stuck on the part where I can say from ID x I want the temp and store it. Now, from ID y I want the temp and store it.

Thanks for thinking with me though!