Waterproof Temp Sensor with dht humidty/temp sensor



  • Hello,

    I am new to mysensors and am trying to work on a waterproof temperature sensor now with an additional DHTII for outdoor temp/humidity for around my Hot tub. I got the DHTII example working and am now trying to add in the code for the Dallas Temperature waterproof sensor and getting lots of errors. hoping someone can look at my code and point out my mistakes so I can learn.

    sketch_HotTubTemp.ino


  • Hero Member

    Hi @cleight

    To help you further it would be good if you can post the errors you are getting and add a link to the Dallas temperature sensor you are trying to use.



  • How are yu powering the Dallas temperature sensor an ddid you add the pull-up resistor of 4k7 ?


  • Contest Winner

    @ericvdb

    how many dallas sensors on the 1 Wire bus?

    it looks like you are presenting device number 0 (and possibly 1) twice...

    void setup()  
    { 
      // Startup OneWire
      sensors.begin();
      
      gw.begin();
      dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
    
      // Send the Sketch Version Information to the Gateway
      gw.sendSketchInfo("Humidity", "1.0");
      gw.sendSketchInfo("Temperature Sensor", "1.0");
      
      // Fetch the number of attached temperature sensors
      numSensors = sensors.getDeviceCount();
      
      // Present all sensors to controller
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
        gw.present(i, S_TEMP); // <<<<<<<<<<<<< First Here, device O and 1 will be create
      }
    
      // Register all sensors to gw (they will be created as child devices)
      gw.present(CHILD_ID_HUM, S_HUM);  //<<<<<<<<<<< Then you create device 0 again...
      gw.present(CHILD_ID_TEMP, S_TEMP); //<<<<<<<<<<< Then you create device 1 again...
      
      metric = gw.getConfig().isMetric;
    }


  • @daulagari said:

    Hi @cleight

    To help you further it would be good if you can post the errors you are getting and add a link to the Dallas temperature sensor you are trying to use.

    I am using this temperature sensor, I should also note that when I compiled it compiled fine. waterproof temp sensor Found it on the Mysensors Store Page.

    @ericvdb said:

    How are yu powering the Dallas temperature sensor an ddid you add the pull-up resistor of 4k7 ?

    I am powering the Dallas Temp Sensor from the Nano with 5.5V and have a 4k7 resistor between the VCC and Signal wire.

    @BulldogLowell said:

    @ericvdb

    how many dallas sensors on the 1 Wire bus?

    it looks like you are presenting device number 0 (and possibly 1) twice...

    void setup()  
    { 
      // Startup OneWire
      sensors.begin();
      
      gw.begin();
      dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
    
      // Send the Sketch Version Information to the Gateway
      gw.sendSketchInfo("Humidity", "1.0");
      gw.sendSketchInfo("Temperature Sensor", "1.0");
      
      // Fetch the number of attached temperature sensors
      numSensors = sensors.getDeviceCount();
      
      // Present all sensors to controller
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
        gw.present(i, S_TEMP); // <<<<<<<<<<<<< First Here, device O and 1 will be create
      }
    
      // Register all sensors to gw (they will be created as child devices)
      gw.present(CHILD_ID_HUM, S_HUM);  //<<<<<<<<<<< Then you create device 0 again...
      gw.present(CHILD_ID_TEMP, S_TEMP); //<<<<<<<<<<< Then you create device 1 again...
      
      metric = gw.getConfig().isMetric;
    }
    

    I have one sensor on the One Wire bus, the other temp/humidity sensor you see listed is a DHTII Humidity/Temp Sensor which I believe does not use the OneWire bus.

    The code compiled fine and appears to be working, I am not sure it is 100% correct though.

    Latest copy of the sketch: sketch_HotTubTemp2.ino



  • I finally got my iBoard Gateway working and Vera can see the temperature sensor node. However the 2 temperature probes are showing up but the humidity sensor is not. Can someone please look at my sketch to see what I missed?



  • Ok so I finally got it working and showing all 3 devices in the Vera Controller. I am not sure if the code is the cleanest, but it is working. The only outstanding issue I am having at this point is my temperatures are showing up in Celsius and I would like them to show in Fahrenheit? I did some research on the forums and have tried changed the Vera controller from Imperial to Metric and vise-versa with no luck.

    Here is the latest sketch for reference: sketch_HotTubTemp2.ino


  • Contest Winner

    @cleight

    try this...

    start here:

    boolean metric = true; 
    

    with

    boolean metric = false;
    

    and comment out this line:

    metric = gw.getConfig().isMetric;

Log in to reply
 

Suggested Topics

  • 8
  • 1
  • 1
  • 1
  • 2
  • 3

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts