Solar Powered Mini-Weather Station

  • @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.

  • @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.

  • Mod

    @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:
    Now works like a charm with the dht22_test.ino sketch:

    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!

  • @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.

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

  • Mod

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

  • Admin

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

  • Mod

    @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...

  • @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:

    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:

  • Admin

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

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

  • @5546dug Have you a wiring diagram?

  • 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!

  • @hek I like the following 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 <>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list:
     * Documentation:
     * Support Forum:
     * 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.
     * Version 1.0 - Henrik EKblad
     * Version 1.1 - Glenn Byron - September 6, 2015 - Converted to new DHT library written by ladyada 
     * This sketch provides an example how to implement a humidity/temperature
     * sensor using DHT11, DHT21, DHT-22 
    #include <SPI.h>
    #include <MySensor.h> 
    #include <DHT.h>  
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1
    #define DHTTYPE DHT22
    // DHTTYPE choices: DHT11, DHT21, DHT22
    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    MySensor gw;
    float lastTemp;
    float lastHum;
    boolean metric = false; 
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    void setup()  
      Serial.println("MySensors: DHT example");
      // 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;
    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: ");
      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: ");
      gw.sleep(SLEEP_TIME); //sleep a bit

  • @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.

    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.

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

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

  • Hero Member

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

  • Plugin Developer

    I really liked this project (@Salmoides ThankYou for sharing it)
    Expecially the solar powered box.

    I've successully prototyped one, but would like to report something to pepople trying to also make this.

    The solar panel included in the box, is outputting 6V, while the Charger board is sized to acced only 5V as input.
    The consequence, is (at least on my prototype) that when there is enought sun, the charger board don't charge the battery (the blue led lights on, and the red seems to vibrate slighty : I guess this is a "protection mode" when VCCin is to high). If i remove the solar panel, and put a usb cable in the charger input, then the RED led lights on, and the barrety is being charged.

    I guess that slighly modifying the charger board, would allow it to accept 6V as input, but this is too far from my electronic skills (Anyone?)

    As a workaround, I've ordered a StepDown module to reduce the 6V provided by the solar panel to 5V for the charger input. I guess It will do the job. I will report back as soon as I get the StepUp module from china.

    HTH those interested in this excellent project.

    BTW @Salmoides , How did you solved it? Does your Solar panel outputs 5V, instead of 6V? Does your charger works with 6V input (might be slighly diffrent board or mine has an issue)? Did you modified the charger or added extra component to reduce the input voltage ?

    Cheeers to evereyone !

  • Mod

    @soif said:

    StepDown module to reduce the 6V provided by the solar panel to 5V for the charger input.

    Put one or two silicon diodes in series with the solar panel. Each diode will lower the voltage by approx 0.7volts

Log in to reply

Suggested Topics





Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.