Skip to content
A WiFi Connected weather station with a mid century modern look
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Update .gitignore Jun 15, 2019
LICENSE.md
README.md Added doc for LastUpdate variable Jun 19, 2019
forecastmojo.ino
steppertest.ino
weathermojo.ino

README.md

WeatherMojo

IoT project to get weather information from the web and display it on a weather station.

It periodically downloads data and sets the position of stepper motors to display weather information on analog gauges. It's built for a Particle Photon running DeviceOS 1.2.0-beta-1.

Build details at https://www.powerfulmojo.com/weather/ Particle function and variables are documented at https://www.powerfulmojo.com/weathermojo/

Files

  • forecastmojo.ino : Firmware to run a weather station showing forecast hi temp
  • weathermojo.ino : Firmware to run a weather station showing observed hi temp
  • steppertest.ino : Firmware to mess with your stepper motors for testing and calibration

The weathermojo and forecastmojo firmwares use different weather APIs and use the high temperature stepper motor differently.
forecastmojo.ino uses weatherbit.io and displays today's forecast high.
weathermojo.ino uses openweathermap.org and displays the highest temperature so far today.

Weather Forecasting Firmware (forecastmojo.ino)

Retrieves weather conditions and forecast from weatherbit.io. Displays current temperature on the "big hand" of the temperature dial. Displays the forecast high temperature on a "needle" on the same dial. Displays the dew point on a separate small dial.

Sets current temperature dewpoint every 15 minutes by default. You can make updates more or less frequently by calling set_polling_interval(milliseconds).

Sets the forecast high temperature once daily at 4:00am Arizona time. Changing the time zone requires recompiling the firmware. The station doesn't do anything about daylight saving time because we don't play that game in Arizona.

Particle Variables

  • TempC The current temperature in Celsius
  • DewPointC The current dew point in Celsius
  • HiTempC The last updated high temperature in Celsius
  • LastUpdate The time of the last temperature and high temperature update

Particle Functions

  • int set_polling_interval(String Command)
    Sets the polling interval to Command ms (minimum 5000). Returns 0 on success. If you give it a non-integer or a number less than 5000, it sets the polling interval to the default value of 900,000 ms.
  • int trim_temp(String Command)
    Moves the temperature needle Command steps, but does not update the TempC variable. Negative numbers go counterclockwise, positive go clockwise. Returns 0 on success.
  • int trim_hitemp(String Command)
    Moves the high temperature needle Command steps, but does not update the HiTempC variable. Negative numbers go counterclockwise, positive go clockwise. Returns 0 on success.
  • int trim_dew(String Command)
    Moves the dew point needle Command steps, but does not update the DewPointC variable. Negative numbers go counterclockwise, positive go clockwise. Returns 0 on success.
  • int set_temp_needle(String Command)
    Sets the current temperature to Command degrees C. The needle position will be updated accordingly. Returns 0 on success. If the dial isn’t calibrated correctly don’t use this to fix it. It will just get over-written with the next weather update. You probably want to use trim_temp to change the station’s idea of where to point when showing the current temperature.
  • int set_hi_needle(String Command)
    Sets the forecast high temperature to Command degrees C. The needle position will be updated accordingly. Returns 0 on success. If the dial isn’t calibrated correctly don’t use this to fix it. It will just get over-written tomorrow. You probably want to use trim_hitemp to change the station’s idea of where to point when showing the hi temperature.
  • int set_dew_needle(String Command)
    Sets the dew point temperature to Command degrees C. The needle position will be updated accordingly. Returns 0 on success. If the dial isn’t calibrated correctly don’t use this to fix it. It will just get over-written with the next weather update. You probably want to use trim_dew to change the station’s idea of where to point when showing the dew point.
  • int set_city_code(String Command)
    Sets the city code to use for weather conditions. A full list is at https://www.weatherbit.io/api/meta. Returns 0 on success. Setting it to an invalid value will cause the WeatherMojo to stop updating temperatures.
  • int set_api_key(String Command)
    Sets the [weatherbit.io] API key to use for getting weather conditions. Sign up for one at https://www.weatherbit.io/account/create. Returns 0 on success. Setting it to an invalid value will cause the WeatherMojo to stop updating temperatures.

Dependencies

WeatherMojo includes these libraries:

You can’t perform that action at this time.