using DS2438

hi there i have a DS2438 with HIH-4030 Humidity sensor connected together,
i am using this library GitHub - jbechter/arduino-onewire-DS2438: Arduino OneWire DS2438 device library.

I am looking at this example:
so what i would like to do is not to use the one wire address, can i do this? if so how?

#include <Arduino.h>
#include <OneWire.h>
#include <DS2438.h>

// define the Arduino digital I/O pin to be used for the 1-Wire network here
const uint8_t ONE_WIRE_PIN = 2;

// define the 1-Wire address of the DS2438 battery monitor here (lsb first)
uint8_t DS2438_address[] = { 0x26, 0x45, 0xe6, 0xf7, 0x00, 0x00, 0x00, 0x4e };

OneWire ow(ONE_WIRE_PIN);
DS2438 ds2438(&ow, DS2438_address);

float temperature;
float heatindex;
float dewpoint;
float humidity;

void setup() {
    Serial.begin(9600);
    ds2438.begin();
}

void loop() {
    ds2438.update();
    if (ds2438.isError() || ds2438.getVoltage(DS2438_CHA) == 0.0) {
        Serial.println("Error reading from DS2438 device");
    } else {
        temperature = ds2438.getTemperature();
        heatindex = temperature;
        float rh = (ds2438.getVoltage(DS2438_CHA) / ds2438.getVoltage(DS2438_CHB) - 0.16) / 0.0062;
        humidity = (float)(rh / (1.0546 - 0.00216 * temperature));
        if (humidity < 0.0) {
            humidity = 0.0;
        } else if (humidity > 100.0) {
            humidity = 100.0;
        }
        float tempK = temperature + 273.15;
        dewpoint = tempK / ((-0.0001846 * log(humidity / 100.0) * tempK) + 1.0) - 273.15;
        if (temperature >= 26.7 && humidity >= 40.0) {
            float t = temperature * 9.0 / 5.0 + 32.0; // heat index formula assumes degF
            rh = humidity;
            float heatindexF = -42.38 + 2.049 * t + 10.14 * rh + -0.2248 * t * rh + -0.006838 * t * t
                               + -0.05482 * rh * rh + 0.001228 * t * t * rh + 0.0008528 * t * rh * rh
                               + -0.00000199 * t * t * rh * rh;
            heatindex = (heatindexF - 32.0) * 5.0 / 9.0;
        }
        if (heatindex < temperature)
            heatindex = temperature;
    }
    Serial.print("Temperature = ");
    Serial.print(temperature, 1);
    Serial.print("C (");
    Serial.print(temperature * 9.0 / 5.0 + 32.0, 1);
    Serial.print("F), Heat Index = ");
    Serial.print(heatindex, 1);
    Serial.print("C (");
    Serial.print(heatindex * 9.0 / 5.0 + 32.0, 1);
    Serial.print("F), Dewpoint = ");
    Serial.print(dewpoint, 1);
    Serial.print("C (");
    Serial.print(dewpoint * 9.0 / 5.0 + 32.0, 1);
    Serial.print("F), Relative Humidity = ");
    Serial.print(humidity, 0);
    Serial.println("%.");
    delay(500);
}

thanks Joe

so what i would like to do is not to use the one wire address

Why not?

so when the sensor gets damaged (which it will) i can just plug a new one in

so am i correct in thinking obviously remove this line:

uint8_t DS2438_address[] = { 0x26, 0x45, 0xe6, 0xf7, 0x00, 0x00, 0x00, 0x4e };

then i have got to alert this line:

DS2438 ds2438(&ow, DS2438_address);

this is where i don't no how to alert this corrcetley any ideas? or am i way off lol?

Does the library you have support working without the address? It doesn't appear so from the code you linked. You may have to rewrite that library to use it without the address.

oh ok thats a bit of a balls up, does anyone no of an other libraries i could use as i think me alerting that library is a bit out of my skill?

Do you really plan on hot-swapping sensors?

unfortunately it will happen :/

i hope we can get around this?

Not without someone (I'm looking at you) going through the datasheet for the sensor and figuring out what to change in that library so you can run without the address.

mmm would not no where to even start in alerting that library :(

Joes: mmm would not no where to even start in alerting that library :(

I told you where to start, with the datasheet. You need to look at the datasheet for the sensor and see what you need to send if you don't send the address.

dater sheet: http://datasheets.maximintegrated.com/en/ds/DS2438.pdf

looking at bottom of page 10

contains a unique ROM code that is 64 bits long, The first 8 bits are a 1-Wire family code, The next 48 bits are a unique serial number, The last 8 bits are a CRC of the first 56 bits.

so we need to stop doing the 48 bits serial number.

The functions required to control sections of the DS2438 are not accessible until the ROM function protocol has been satisfied.

The 1-Wire bus master must first provide one of four ROM function commands: 1) Read ROM, 2) Match ROM, 3) Search ROM, or 4) Skip ROM.

so all we need is read ROM.

could we just take out the 48 bit serial number?

The functions required to control sections of the DS2438 are not accessible until the ROM function protocol has been satisfied.

That sentence would seem to imply that you cannot access anything until you’ve satisfied that protocol and part of that protocol appears to be the address.

Does the datasheet say anything about how to access it otherwise? Does the datasheet say you can “just leave out those 48 bytes”

Does the datasheet say anything about how to access it otherwise? Does the datasheet say you can "just leave out those 48 bytes"

can not see anything :/

so i have my answer then :(

would not no where to even start in alerting that library

Then get a soldering iron, and make the connections permanent.

yer put the output of the RH sensor on a analog pin on the arduino, the only problen with that is I was going to use the temp as well.

so have been looking about and come across DHT11 or DHT22 so mite be a bit better