Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Waterproof Temp Sensor with dht humidty/temp sensor

Waterproof Temp Sensor with dht humidty/temp sensor

Scheduled Pinned Locked Moved My Project
8 Posts 4 Posters 4.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cleight
    wrote on last edited by cleight
    #1

    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

    1 Reply Last reply
    0
    • daulagariD Offline
      daulagariD Offline
      daulagari
      Hero Member
      wrote on last edited by
      #2

      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.

      C 1 Reply Last reply
      0
      • E Offline
        E Offline
        ericvdb
        wrote on last edited by
        #3

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

        BulldogLowellB 1 Reply Last reply
        0
        • E ericvdb

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

          BulldogLowellB Offline
          BulldogLowellB Offline
          BulldogLowell
          Contest Winner
          wrote on last edited by BulldogLowell
          #4

          @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;
          }
          
          1 Reply Last reply
          0
          • daulagariD daulagari

            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.

            C Offline
            C Offline
            cleight
            wrote on last edited by cleight
            #5

            @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

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cleight
              wrote on last edited by
              #6

              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?

              1 Reply Last reply
              0
              • C Offline
                C Offline
                cleight
                wrote on last edited by
                #7

                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

                BulldogLowellB 1 Reply Last reply
                0
                • C cleight

                  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

                  BulldogLowellB Offline
                  BulldogLowellB Offline
                  BulldogLowell
                  Contest Winner
                  wrote on last edited by
                  #8

                  @cleight

                  try this...

                  start here:

                  boolean metric = true; 
                  

                  with

                  boolean metric = false;
                  

                  and comment out this line:

                  metric = gw.getConfig().isMetric;
                  
                  1 Reply Last reply
                  2
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  10

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.0k

                  Posts


                  Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • MySensors
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular