Encapsulated DS18B20 temperature sensor + emonTx V3

Hi,

I am evaluating to buy emonTx V3 (Fully Assembled).

Out of 4 CTs to measure eletrical power I'd like to measure internal and external temperature.

Questions:

1) how long is the cable of DS18B20 ? My intention is to install it outside and connect it to emonTx inside home

2) can I connect 2 temperature sensors directly to emonTx V3 board ?

Thanks !

Emiliano.

Robert Wall's picture

Re: Encapsulated DS18B20 temperature sensor + emonTx V3

The cable length is specified here: http://shop.openenergymonitor.com/encapsulated-ds18b20-temperature-sensor/

Technical

Diameter: 6mm body (approx 6.5mm body + heat-shrink)
Power supply range: 3.0V to 5.5V
Accuracy over the range of -10°C to +85°C: ±0.5°C.
Storage temperature range:-55°C to +125°C (-67°F to +257°F)
Cable: 1m 3-core

A check I did only yesterday shows that I think there is sufficient spare power available to connect 2 temperature sensors - each terminal is big enough for two wires - but you must change the sketch because although the default sketch will recognise and read more than one sensor, it will only print and send the temperature of the first one.

EmilianoM's picture

Re: Encapsulated DS18B20 temperature sensor + emonTx V3

Thanks again Robert !

Any suggestion for sketch change to manage 2 temperature sensors ?

Robert Wall's picture

Re: Encapsulated DS18B20 temperature sensor + emonTx V3

You need to edit the sketch you have. First in the PayloadTX struct, where you have temp you must make that temp1 & add temp2; then where you have all this

     float temp=(sensors.getTempC(allAddress[0]));
     digitalWrite(DS18B20_PWR, LOW);
     if ((temp<125.0) && (temp>-40.0)) emontx.temp=(temp*10);            //if reading is within range for the sensor
                                                                                                              // convert float to int ready to send via RF
     if (debug==1) {Serial.print("temperature: "); Serial.println(emontx.temp*0.1); delay(20);}

you must convert temp to temp1 and add another temp2 similarly:

     float temp1=(sensors.getTempC(allAddress[0]));
     float temp2=(sensors.getTempC(allAddress[1]));
     digitalWrite(DS18B20_PWR, LOW);
     if ((temp1<125.0) && (temp1>-40.0)) emontx.temp1=(temp*10);      //if reading is within range for the sensor
                                                                                                              // convert float to int ready to send via RF

     if ((temp2<125.0) && (temp2>-40.0)) emontx.temp2=(temp*10);
     if (debug==1)
     {
        Serial.print("temperature 1: "); Serial.print(emontx.temp1*0.1); 
        Serial.print("temperature 2: "); Serial.println(emontx.temp2*0.1);
        delay(20);
     }

I haven't tried it, I think it will work. Instead of using "sensors.getTempC(allAddress[0])", you might want to use the actual sensor addresses encoded in the sensor at manufacture with "sensors.getTempC(address_T1)". You'll need to look at the emonTx V2 sketches for that, and merge how it is done there into this sketch. You'll also need to get and modify the "temperature_search" sketch to read the serial numbers of the sensors to put into "address _T1" etc.

EmilianoM's picture

Re: Encapsulated DS18B20 temperature sensor + emonTx V3

Thanks Robert.

Do you think in V3 release code is similar? 

Robert Wall's picture

Re: Encapsulated DS18B20 temperature sensor + emonTx V3

That IS the default sketch that comes with the V3 that I've edited for you!

EmilianoM's picture

Re: Encapsulated DS18B20 temperature sensor + emonTx V3

Whops, sorry. Really thanks again.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.