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

Mini Weather Station

Scheduled Pinned Locked Moved My Project
42 Posts 18 Posters 21.0k Views 17 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.
  • BulldogLowellB BulldogLowell
    else if (temperature != lastTemp)
    

    @jtm312

    So I've been working with temperature sensors a while and I worry about comparing floats, and their notorious precision triggering a true here and superfluously affecting the rate of the radio updates. The DHT22 is accurate to about 1 Celsius degree, so it may be unnecessary to transmit a change if there is a change to temperature at any precision of less than 1.

    maybe try something like:

    if (temperature > lastTemp + 0.5 || temperature < lastTemp - 0.5)
    {
      doSomething();
      lastTemp = temperature;
    }
    

    Would reduce transmissions and save battery?

    same argument with your hygrometer and barometric pressure, but different level of precision. Not for the weather calculations, just for the decision to transmit updates, IMO.

    all easy to test with your serial monitor.

    J Offline
    J Offline
    jtm312
    wrote on last edited by
    #9

    @BulldogLowell Thanks, that looks like it is worth a try, or just round to 0.5 degree. I am also going to cut down the sample interval. After the 1min samples to average for the pressure, the rest of the time 5min is probably good enough.

    BulldogLowellB 1 Reply Last reply
    0
    • J jtm312

      @BulldogLowell Thanks, that looks like it is worth a try, or just round to 0.5 degree. I am also going to cut down the sample interval. After the 1min samples to average for the pressure, the rest of the time 5min is probably good enough.

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

      @jtm312

      maybe, but you may still have the same precision problem if you are using floats.

      maybe just round and cast it to an int... DHT22 isn't precise to half a degree F or C...

      int roundedTemperature = (int) floor(temperature + 0.5);
      if (roundedTemperature != lastTemperature)
      {
        doSomething();
        lastTemperature = roundedTemperature;
      }
      

      more on floats and their precision...

      https://www.youtube.com/watch?v=PZRI1IfStY0

      1 Reply Last reply
      0
      • raditvR raditv

        I would like to print that one for my pet ;)

        H Offline
        H Offline
        hyla
        wrote on last edited by
        #11

        @raditv Gotta ask: what sort of pet lives in that??
        :)
        C.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          Dylano
          wrote on last edited by
          #12

          @ jtm312

          Dear..
          Great project!
          I print your station, very good quality!!!

          How is the battery?
          Do you have options to reduce the power?
          Is this sketch the best option?
          Do you have a list that i need to buy so i can build this nice station?

          Thanks!!!

          Domoticz, with a lot of working hardware, include mysensors :-)
          OpenPLI, RuneAudio, Solarmeter, etc......

          Not a great builder of software and hardware, more a user...
          Only i try to do my best :-(

          J 1 Reply Last reply
          0
          • D Dylano

            @ jtm312

            Dear..
            Great project!
            I print your station, very good quality!!!

            How is the battery?
            Do you have options to reduce the power?
            Is this sketch the best option?
            Do you have a list that i need to buy so i can build this nice station?

            Thanks!!!

            J Offline
            J Offline
            jtm312
            wrote on last edited by
            #13

            @Dylano Thanks.

            I get 3-4 months from a battery by just removing the 2 LEDs from the arduino. Could probably do better running it from 2 AAA batteries and removing the voltage regulator as well. To save more power, you could also increase the interval between sending updates to the controller.

            To build it you need:

            • Arduino Pro Mini
            • Humidity Sensor – DHT22 Aliexpress
            • list itemPressure Sensor – BMP180 Aliexpress
            • Prototype board & Battery Connector

            Connections:

            • Radio connected as http://www.mysensors.org/build/connect_radio
            • 3.3V to sensors from arduino
            • Battery Sense - A0 - connected as http://www.mysensors.org/build/battery R1=1M * R2=100k
            • BMP085 - SCL - A5
            • BMP085 - SCA - A4
            • DHT22 - D3
            1 Reply Last reply
            0
            • bjacobseB Offline
              bjacobseB Offline
              bjacobse
              wrote on last edited by
              #14

              Think about to replace your DHT22 with a less current hungry sensor
              HTU21D cold be a good choice (But only running 3,3V)

              J 1 Reply Last reply
              0
              • bjacobseB bjacobse

                Think about to replace your DHT22 with a less current hungry sensor
                HTU21D cold be a good choice (But only running 3,3V)

                J Offline
                J Offline
                jtm312
                wrote on last edited by
                #15

                @bjacobse Thanks, they look interesting. I will grab some and have a play.

                1 Reply Last reply
                1
                • M Offline
                  M Offline
                  MikeF
                  wrote on last edited by MikeF
                  #16

                  ... and here's mine - in white:
                  alt text
                  alt text
                  (now managed to upload pics in portrait!)

                  I'm using a BME280 instead of a BMP180 and DHT22.

                  1 Reply Last reply
                  1
                  • F Offline
                    F Offline
                    flopp
                    wrote on last edited by
                    #17

                    Really cool.

                    Is it possible to get the 3D file for this?

                    korttomaK J 2 Replies Last reply
                    0
                    • F flopp

                      Really cool.

                      Is it possible to get the 3D file for this?

                      korttomaK Offline
                      korttomaK Offline
                      korttoma
                      Hero Member
                      wrote on last edited by
                      #18

                      @flopp There is a link in the first post

                      • Tomas
                      F 1 Reply Last reply
                      0
                      • korttomaK korttoma

                        @flopp There is a link in the first post

                        F Offline
                        F Offline
                        flopp
                        wrote on last edited by
                        #19

                        @korttoma said:

                        @flopp There is a link in the first post

                        Thank you, I must have missed it 🙀

                        1 Reply Last reply
                        0
                        • F flopp

                          Really cool.

                          Is it possible to get the 3D file for this?

                          J Offline
                          J Offline
                          jtm312
                          wrote on last edited by
                          #20

                          @flopp I have added the FreeCAD file to the Thingiverse post so that people can make any changes they want.

                          http://www.thingiverse.com/thing:704715

                          1 Reply Last reply
                          2
                          • M Offline
                            M Offline
                            MikeF
                            wrote on last edited by
                            #21

                            I've now uploaded an external view - see my earlier post.

                            1 Reply Last reply
                            0
                            • bjacobseB Offline
                              bjacobseB Offline
                              bjacobse
                              wrote on last edited by
                              #22

                              If you at some point redesign the nice looking weather station, I recommend:
                              1)To place the battery in the top, to avoid battery corrosion
                              2) Make a little hole in bottom for water condensation trip out hole

                              cadetC 1 Reply Last reply
                              0
                              • bjacobseB bjacobse

                                If you at some point redesign the nice looking weather station, I recommend:
                                1)To place the battery in the top, to avoid battery corrosion
                                2) Make a little hole in bottom for water condensation trip out hole

                                cadetC Offline
                                cadetC Offline
                                cadet
                                wrote on last edited by
                                #23

                                @bjacobse
                                Hi
                                anybody compile code for this station for 2.0 Mysensors ?
                                Share the code please.
                                Pro mini used 5volt ver ?
                                I can't power 3 volt ver from 9 volt ? Correct ?
                                Thank you
                                Andrey

                                1 Reply Last reply
                                0
                                • gohanG Offline
                                  gohanG Offline
                                  gohan
                                  Mod
                                  wrote on last edited by
                                  #24

                                  You can use any voltage as far as you use the right voltage regulator

                                  1 Reply Last reply
                                  0
                                  • J Offline
                                    J Offline
                                    jtm312
                                    wrote on last edited by
                                    #25

                                    The pro minis have an onboard voltage regulator (raw input). The specs say that they are good for up to 12v for either the 5v or 3.3v version. I used a 3.3v version as it made the rest of the interface easier.

                                    cadetC 1 Reply Last reply
                                    0
                                    • J jtm312

                                      The pro minis have an onboard voltage regulator (raw input). The specs say that they are good for up to 12v for either the 5v or 3.3v version. I used a 3.3v version as it made the rest of the interface easier.

                                      cadetC Offline
                                      cadetC Offline
                                      cadet
                                      wrote on last edited by
                                      #26

                                      @jtm312
                                      Just try to connect Pro Mini 3volt to 9 volt GND and RAW - voltage regulator very hot - I think 60-80 C

                                      1 Reply Last reply
                                      0
                                      • dbemowskD Offline
                                        dbemowskD Offline
                                        dbemowsk
                                        wrote on last edited by
                                        #27

                                        I am curious what kind of battery life you are getting with the 9 volt battery? I tried a sensor with a 9 volt battery and the useful battery duration was less than ideal.

                                        Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
                                        Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

                                        Nca78N J 2 Replies Last reply
                                        0
                                        • dbemowskD dbemowsk

                                          I am curious what kind of battery life you are getting with the 9 volt battery? I tried a sensor with a 9 volt battery and the useful battery duration was less than ideal.

                                          Nca78N Offline
                                          Nca78N Offline
                                          Nca78
                                          Hardware Contributor
                                          wrote on last edited by
                                          #28

                                          @dbemowsk said in Mini Weather Station:

                                          I am curious what kind of battery life you are getting with the 9 volt battery? I tried a sensor with a 9 volt battery and the useful battery duration was less than ideal.

                                          Typical capacity is around 550mAh for alcaline version. All extra voltage is wasted in the linear regulator so you end up with less than half the capacity of 2 AAA or about 20% of the capacity of 2 AA. Not a good choice imho, better switch to i2c sensors like si7021 or BME280 like MikeF did to have much lower power consumption and much lower voltage requirements and use 2 AAA. And the lower the voltage is, the lower the current consumption is for Arduino, radio and sensor so in the end instead of having 4 months of battery life you can get 2 or 3 years with 2 AAA.

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


                                          16

                                          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