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. Solar Powered Mini-Weather Station

Solar Powered Mini-Weather Station

Scheduled Pinned Locked Moved My Project
111 Posts 39 Posters 119.4k Views 27 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.
  • G Offline
    G Offline
    gbfromhb
    wrote on last edited by
    #39

    I don't seem to be able to get the DHT22 working. I have stripped this project down to the following prototype, and am still not able to get the DHT22 to work. I'm using the DHT example (not MySensors) script and continue to get timeout errors for both Temp and Humidity. I have tried a 4.0k ohm, 10k omh and no resistor.

    DHT22 Solar_bb.png

    I am just wanting to know if I might be missing something, and to also verify that other people have got the DHT22 working with a Arduino Pro Mini 8mhs - 3.3 volt using its regulated vcc pin. I have ordered new DHT22 modules from a different source just to see what happens.

    Thanks in advance for any input.

    1 Reply Last reply
    0
    • sundberg84S Offline
      sundberg84S Offline
      sundberg84
      Hardware Contributor
      wrote on last edited by sundberg84
      #40

      One thing comes to mind is that DHT has 3.3v as minimum power.
      If you have a "weak" pro mini board delivere power below that maybe is a problem. Can you measure the power?

      I have a 3.3v pro mini running a DHT22 fine, so it should work - but I also know there is a big difference in different hardware even if its called pro mini.

      Controller: Proxmox VM - Home Assistant
      MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
      MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
      RFLink GW - Arduino Mega + RFLink Shield, 433mhz

      1 Reply Last reply
      0
      • 5546dug5 Offline
        5546dug5 Offline
        5546dug
        wrote on last edited by
        #41

        @gbfromhb I did not use the resistor and no Vcc connection through it to D4.
        My output is straight to pro mini.
        Vcc and gnd make up the other two connections.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          gbfromhb
          wrote on last edited by gbfromhb
          #42

          @5546dug thanks for the input. I had also tried it with 4k ohm, 10k ohm and no resistor and connection to VCC to pin 2 of the DHT.

          @sundberg84 thanks for your input as well. I tried two different Pro Minis also, but from the same supplier. I think I'm going to go after a new Pro Mini from a different supplier.

          YveauxY 1 Reply Last reply
          0
          • G gbfromhb

            @5546dug thanks for the input. I had also tried it with 4k ohm, 10k ohm and no resistor and connection to VCC to pin 2 of the DHT.

            @sundberg84 thanks for your input as well. I tried two different Pro Minis also, but from the same supplier. I think I'm going to go after a new Pro Mini from a different supplier.

            YveauxY Offline
            YveauxY Offline
            Yveaux
            Mod
            wrote on last edited by Yveaux
            #43

            @gbfromhb I seemed to have similar problems as you using the DHT22 (Straight from China, marked AM2302). Reported 2% hudity and 0 degrees, with data line directly connected to pin3 (no pullup) on 8MHz Pro Mini.
            Switched from the MySensors DHT library to this one: https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTlib
            Now works like a charm with the dht22_test.ino sketch:

            dht22_test.ino
            LIBRARY VERSION: 0.1.20
            
            Type,	status,	Humidity (%),	Temperature (C)	Time (us)
            DHT22, 	OK,	45.4,	25.9,	5216
            DHT22, 	OK,	45.7,	26.0,	5240
            DHT22, 	OK,	45.6,	26.0,	5136
            DHT22, 	OK,	45.4,	26.0,	5128
            DHT22, 	OK,	45.3,	26.1,	5176
            DHT22, 	OK,	45.1,	26.1,	5176
            ... etc ...
            
            

            You could give this library a try; it might work with yours!

            http://yveaux.blogspot.nl

            1 Reply Last reply
            0
            • G Offline
              G Offline
              gbfromhb
              wrote on last edited by gbfromhb
              #44

              @Yveaux thank you for the information. I was going to post my solution tomarrow morning. I found first the library you had suggested, and found a second one that I settled on. Yesterday my top thought on this was it was a timing issue, and the slower 8Mhz pro mini. I had ruled out voltage as the issue. The library you directed me in their last revision addressed timing issues with slower clock speeds. It did work great. I did find a different one that seems to have a few more functions that I need and it seems to work great also.

              https://github.com/adafruit/DHT-sensor-library

              I seemed to get more accurate temperature when I put a 10k ohm resistor between pin 1 and 2 on the DHT22.

              YveauxY 1 Reply Last reply
              0
              • G gbfromhb

                @Yveaux thank you for the information. I was going to post my solution tomarrow morning. I found first the library you had suggested, and found a second one that I settled on. Yesterday my top thought on this was it was a timing issue, and the slower 8Mhz pro mini. I had ruled out voltage as the issue. The library you directed me in their last revision addressed timing issues with slower clock speeds. It did work great. I did find a different one that seems to have a few more functions that I need and it seems to work great also.

                https://github.com/adafruit/DHT-sensor-library

                I seemed to get more accurate temperature when I put a 10k ohm resistor between pin 1 and 2 on the DHT22.

                YveauxY Offline
                YveauxY Offline
                Yveaux
                Mod
                wrote on last edited by
                #45

                @gbfromhb Good to hear you've sorted things out!
                I'll give the Adafruit lib a try someday.

                http://yveaux.blogspot.nl

                1 Reply Last reply
                0
                • hekH Offline
                  hekH Offline
                  hek
                  Admin
                  wrote on last edited by
                  #46

                  If/when you guys have evaluated the best DHT library, maybe we should update the one distributed in the MySensors bundle?

                  YveauxY 1 Reply Last reply
                  0
                  • hekH hek

                    If/when you guys have evaluated the best DHT library, maybe we should update the one distributed in the MySensors bundle?

                    YveauxY Offline
                    YveauxY Offline
                    Yveaux
                    Mod
                    wrote on last edited by
                    #47

                    @hek tricky, as we seem to be the only ones having issues with the library included with MySensors. I only have one DHT22 so I cannot test with other sensors...

                    http://yveaux.blogspot.nl

                    ? 1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      gbfromhb
                      wrote on last edited by gbfromhb
                      #48

                      @hek I think this is a good idea to update the DHT library that is being distributed. I have tried the DHT11 & DHT22 on both of these these libraries and they seem to work. It is pretty interesting the revision logs for both of these have addressed lower clock speed issues that were resolved in different versions, and the current library that is being distributed has not been touched for over over 2 years. The library that @Yveaux is using has been updated in that last 6 months, and the one I'm currently using has been updated in the last month. Both of these libraries have been around for 3 or 4 years. There is also one more library that I was looking at that I have not tried and that is: https://github.com/piettetech/piettetech_dht.

                      I choose the one I did, because it had some functions that enabled me to work with Fahrenheit easier.

                      I don't think we are the only ones that have had issues with the DHT library that have been resolved by changing library. Take a look at the bottom of this post:
                      http://forum.mysensors.org/topic/1894/pro-mini-is-giving-a-frequent-time-out-on-dth11-read-out/8

                      1 Reply Last reply
                      0
                      • hekH Offline
                        hekH Offline
                        hek
                        Admin
                        wrote on last edited by
                        #49

                        Yep, would be great if someone had time to evaluate the different options and get back to me with a suitable choice.

                        1 Reply Last reply
                        0
                        • B Offline
                          B Offline
                          Bazeman
                          wrote on last edited by
                          #50

                          Please add an wiring diagram. Especially for the solar panel, battery and connection to the Nano.

                          D 1 Reply Last reply
                          0
                          • 5546dug5 5546dug

                            @Salmoides great thread and project

                            Was trying to follow the wiring on the back side of the board to wire my project and was wondering how you wrap the wires around the posts sticking through the board for soldering.
                            Also is there a wiring diagram?

                            B Offline
                            B Offline
                            Bazeman
                            wrote on last edited by
                            #51

                            @5546dug Have you a wiring diagram?

                            1 Reply Last reply
                            0
                            • YveauxY Yveaux

                              @hek tricky, as we seem to be the only ones having issues with the library included with MySensors. I only have one DHT22 so I cannot test with other sensors...

                              ? Offline
                              ? Offline
                              A Former User
                              wrote on last edited by
                              #52

                              I've build something like this that logs temperature to an SD card, so no radio or gateway involved. Been getting NaNs from my DHT22 every few readings since I switched from a 5v Pro Mini to a 3.3v one. This never happened on the 5v one, so I guess I'll try switching library as well!

                              1 Reply Last reply
                              0
                              • G Offline
                                G Offline
                                gbfromhb
                                wrote on last edited by gbfromhb
                                #53

                                @hek I like the following library https://github.com/adafruit/DHT-sensor-library (ladyada).

                                This seems to be working fine with the Arduino Pro Mini 8mhz.
                                Here is a MySensors example using this library:

                                /**
                                 * The MySensors Arduino library handles the wireless radio link and protocol
                                 * between your home built sensors/actuators and HA controller of choice.
                                 * The sensors forms a self healing radio network with optional repeaters. Each
                                 * repeater and gateway builds a routing tables in EEPROM which keeps track of the
                                 * network topology allowing messages to be routed to nodes.
                                 *
                                 * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
                                 * Copyright (C) 2013-2015 Sensnology AB
                                 * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
                                 *
                                 * Documentation: http://www.mysensors.org
                                 * Support Forum: http://forum.mysensors.org
                                 *
                                 * This program is free software; you can redistribute it and/or
                                 * modify it under the terms of the GNU General Public License
                                 * version 2 as published by the Free Software Foundation.
                                 *
                                 *******************************
                                 *
                                 * REVISION HISTORY
                                 * Version 1.0 - Henrik EKblad
                                 * Version 1.1 - Glenn Byron - September 6, 2015 - Converted to new DHT library written by ladyada 
                                 * 
                                 * DESCRIPTION
                                 * This sketch provides an example how to implement a humidity/temperature
                                 * sensor using DHT11, DHT21, DHT-22 
                                 * http://www.mysensors.org/build/humidity
                                 */
                                 
                                #include <SPI.h>
                                #include <MySensor.h> 
                                #include <DHT.h>  
                                
                                #define CHILD_ID_HUM 0
                                #define CHILD_ID_TEMP 1
                                #define HUMIDITY_SENSOR_DIGITAL_PIN 2
                                #define DHTTYPE DHT22
                                // DHTTYPE choices: DHT11, DHT21, DHT22
                                
                                unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
                                
                                MySensor gw;
                                DHT dht(HUMIDITY_SENSOR_DIGITAL_PIN, DHTTYPE);
                                float lastTemp;
                                float lastHum;
                                boolean metric = false; 
                                MyMessage msgHum(CHILD_ID_HUM, V_HUM);
                                MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
                                
                                void setup()  
                                { 
                                  Serial.begin(115200);
                                  Serial.flush();
                                  Serial.println("MySensors: DHT example");
                                  
                                  gw.begin();
                                  dht.begin();
                                
                                  // Send the Sketch Version Information to the Gateway
                                  gw.sendSketchInfo("Humidity", "1.0");
                                
                                  // Register all sensors to gw (they will be created as child devices)
                                  gw.present(CHILD_ID_HUM, S_HUM);
                                  gw.present(CHILD_ID_TEMP, S_TEMP);
                                  
                                  metric = gw.getConfig().isMetric;
                                
                                  delay(2000);
                                }
                                
                                void loop()      
                                {  
                                  float temperature = dht.readTemperature(!metric);
                                  if (isnan(temperature)) {
                                      Serial.println("Failed reading temperature from DHT");
                                  } else if (temperature != lastTemp) {
                                    lastTemp = temperature;
                                    gw.send(msgTemp.set(temperature, 1));
                                    Serial.print("Temperature: ");
                                    Serial.println(temperature);
                                  }
                                  
                                  float humidity = dht.readHumidity();
                                  if (isnan(humidity)) {
                                      Serial.println("Failed reading humidity from DHT");
                                  } else if (humidity != lastHum) {
                                      lastHum = humidity;
                                      gw.send(msgHum.set(humidity, 1));
                                      Serial.print("Humidity: ");
                                      Serial.println(humidity);
                                  }
                                
                                  gw.sleep(SLEEP_TIME); //sleep a bit
                                }
                                
                                1 Reply Last reply
                                0
                                • B Bazeman

                                  Please add an wiring diagram. Especially for the solar panel, battery and connection to the Nano.

                                  D Offline
                                  D Offline
                                  drock1985
                                  wrote on last edited by drock1985
                                  #54

                                  @Bazeman

                                  If i'm not mistaken, the solor panel is directly connected to the power input of the solar charger. @Salmoides wired a mini/microUSB to the power cables to make it easy connect/disconnect. It's this one, from what I can see in the pictures. http://www.aliexpress.com/item/5PCS-Micro-USB-5V-1A-18650-Lithium-Battery-Charger-Board-With-Protection-Module/1852341893.html

                                  From there, it's pretty straight forward. The battery is connected to the B+ and B- leads. The OUT+ and OUT- would be connected to the VIN/RAW and GND on your Nano, respectively.

                                  My Projects
                                  2 Door Chime Sensor
                                  Washing Machine Monitor

                                  1 Reply Last reply
                                  0
                                  • bisschopsrB Offline
                                    bisschopsrB Offline
                                    bisschopsr
                                    wrote on last edited by
                                    #55

                                    The lamp is not shipped to NL and many other countries :unamused: . Did anyone find it in Europe?

                                    Domoticz, P1 meter interface, MySensors and more to come!

                                    YveauxY 1 Reply Last reply
                                    0
                                    • R Offline
                                      R Offline
                                      RiVoW
                                      wrote on last edited by
                                      #56

                                      In The Netherlands they used to have it at Action .
                                      But haven't been there lately

                                      1 Reply Last reply
                                      0
                                      • korttomaK Offline
                                        korttomaK Offline
                                        korttoma
                                        Hero Member
                                        wrote on last edited by korttoma
                                        #57

                                        This One looks similar -> http://www.banggood.com/Solar-LED-Motion-Sensor-Waterproof-Wall-Light-For-Home-Garden-Outdoor-p-921885.html

                                        Maybe banggood ships to NL?

                                        • Tomas
                                        1 Reply Last reply
                                        0
                                        • R Offline
                                          R Offline
                                          RiVoW
                                          wrote on last edited by
                                          #58

                                          There seems to be a similar one for sale right now at groupdeal.nl
                                          but just for another 9 hours or so...

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          13

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 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