Software


Fully functional software is can be found on https://github.com/hellange/arduino under the directory “weatherstation2”. It will no longer be changed/maintained. Further development of the prototype will continue under the “weatherstation3” directory, but that version might not be fully functional at all times. It also might require extra hardware. I’ll try to describe significant progress in the blog when/if they occur…

I’ve used the standard arduino IDE version 1.5.4/1.5.5 while developing weatherstation2.
The only things you must do in addition are:

  • copy a number of libraries into the arduino library directory. Refer to the list of #include in the weatherstation2.ino file.
  • Calibrate the touch sensors and replace the content in the UTouchCD.h file accordingly.  The calibration procedure is described in UTouch page created by Henning Karlsen

Feel free to copy the prototype software and modify it for your own (non-commercial) use.

3rd party software

An nice thing about the prototype LCD hardware combo is that it works more or less out of the box using a display library by Henning Karlsen.

If you want to connect more I2C devices, a useful application for detecting I2C addresses can be found here.

The BMP085 driver I use is currently from Adafruit (ref #include in prototype software). Ther are other drivers out there, i.e. http://code.google.com/p/bmp085driver/, but I havn’t tested it. I’m also a bit unsure about the calibration. Did I do that ?

The other software is Time library from playground.arduino and Timezone from HChristensen. Refer to #include statements in the prototype source code in git.

Cut’n past algorithms

Moon phase calculations are borrowed from this www.nano-reef.com forum entry. I haven’t really verified if this algorithm is correct, though…

IMG_8507
Moon phases for some days ahead

 

 

15 thoughts on “Software

    1. Thanks for the answer; I have 2 more questions:
      1) Touch can be dispensed, as here: UTouch myTouch (6,5,4,3,2); because my display does not have the Touch. My display is the TFT01_22S 240×320 without the Touch function.
      2) What do I do with the moon_phases folder?
      Thank you very much

      Like

    2. Sorry, one more question:
      My Display is not with Touch Screen, so should I simply comment the lines in the sketch with this function?
      Or does it have to be with Display with Touch Screen?
      Thank you

      Like

  1. The code is written for a 240×400 display, so it will not work as expected on your display. If I remember correctly, the moon_phases folder was just added for reference. I believe I copied everything needed into the moon_phases_raw.h directory. Also, if I remember correctly, the touch functionality was actually used to jump between various modes so you will lose some functionality without it. Can probably remove the code if you don’t need it. Note that I haven’t touched this code for 4-5 years. Actually, I’m unable to find the hardware for it. Hmm… maybe I should try to find it and see if it still works… Conclusion is that you probably have to take parts of the code and rewrite for your own display. Mainly because of the resolution.

    Like

      1. Note that the stuff I’ve done with 5″ displays are not directly compatible with what I did in the weatherstation2 project. I originally planned to take parts from weatherstation2 and bring it over to the 5″ world. I never got that far before other projects took priority. Feel free to follow that path ! Alternative path is to get rid of the LCD breakout board and put a 3.2″ display directly on the Arduino mega. Could be that this display will work: https://www.aliexpress.com/item/3-2-3-2-inch-240X400-TFT-LCD-Touch-Screen-Expansion-Shield-LED-Display-Module-5V/32892795591.html.

        Like

    1. Thank you!
      I would love to use ‘weatherstation2’ or ‘weatherstation3’ but they are showing many errors. I’m using arduino-1.5.5-r2, as you mention on the site.

      – The ‘UTouch’ library on the site has been replaced by ‘URTouch’.
      – Adafruit_BMP085 that you make available on the site is not as in the sketch.

      Some of the errors:

      weatherstation2:29: error: ‘Adafruit_BMP085_Unified’ does not name a type
      weatherstation2.ino: In function ‘void setup()’:
      weatherstation2:34: error: ‘Wire’ was not declared in this scope
      weatherstation2:46: error: ‘RTC’ was not declared in this scope
      weatherstation2:46: error: ‘setSyncProvider’ was not declared in this scope
      weatherstation2:48: error: ‘timeStatus’ was not declared in this scope
      weatherstation2:48: error: ‘timeSet’ was not declared in this scope

      And the errors are related to line 29: Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified (10085); because it is highlighted in yellow.

      If you can help me, thank you very much,

      Daniel Fernandes

      Like

  2. Very nice weather station and a million thanks for sharing. But i am facing minor compiling errors with the sketch.

    Like

  3. Greetings
    I have two problems:
    1) Every 4 or 5 seconds, the seconds count skips two numbers (ex: 1, 2, 3, 4, 6, 7, 8, 9, 11, … etc), that is, the seconds are counting irregularly, but that does not mean that the time on the RTC clock (DS3231) is incorrect because the time on the TFT display is always the same as on my PC. Although, in the sketch it calls the library DS1307RTC.h, I am using the RTC module DS3231, which I see no problem, in fact, it is more accurate.
    2) The temperature normally shows 22ºC; for example, today, August 20, 2020, in my region it is showing 12ºC and the display shows 19ºC, that is, 7 degrees more.

    Like

Leave a comment