In the Midwest the temperature alone doesn't fully tell you how it will actually be like outside. Most of the time to get an accurate sense of temperature outside you need to look at the wind chill or heat index depending on the season you are in. The main feature of the weather station is that it will update the temperature and the feels like temperature in real time, giving you the ability to keep track of what the weather conditions are like from anywhere.
ShowcaseWeather StationThe weather station is be based around the Arduino Nano ESP32 board. The two sensors that will be used for the weather station are the DHT11 sensor and the Adafruit anemometer. The DHT11 sensor measures both temperature and humidity. For greater accuracy, you can also use the DHT22 sensor. to pull data from the DHT11 sensor, we will be using the DHT sensor Library by Adafruit. Using this library allows for easy sensor readings as well as flexibility to use other DHT sensors such as the DHT22 temperature and humidity sensor. To measure wind speed using the anemometer, you will need to measure the input voltage from the anemometer. This can be done by measuring the analog signal value, from the analog-digital-converter (ADC), coming in and multiplying it by the VCC voltage and dividing it by the ADC pin resolution. Using temperature, windspeed, and humidity, we are able to calculate a feels like temperature. The main two equations are the windchill and heat index equations which can be found national weather service website.
To store the weather data, we will be using Google's Firebase Realtime Database to store the data. To set up the Realtime Database, you can use some of the many resources and tutorials provided by Google. To send data to the Realtime Database from the ESP32, we will be using the Firebase_ESP_Client library. In the setup you must first connect to the WiFi then configure the Firebase using the API key and the Realtime Database URL. Then to send the data to the database you can use one of the library's set functions, depending on the variable type, to update the data in your database.
Live Weather DisplayThe display portion of the weather station is based around the Particle Photon 2. This microcontroller was chosen due to the easy use of webhooks using the Particle system. To set up your webhook you will need to create a new integration using the particle cloud services and select custom webhook. In the URL section you will put the URL of your Realtime Database plus forward slash followed by your data path dot json. Your data path will define what to pull from the database, which is Sensors in the case of the shown project. The request type should also be set to GET. To process the data from the webhook, we will be using the ArduinoJson library to deserialize the data after every webhook publish. For the display, we will be using a 1602 LCD display in conjunction with the I2C Serial Interface for 1602 LCD to allow for I2C communication with the LCD screen. I2C allows use to save space on the microcontroller because we no longer need parallel communication with LCD display and only need two pins to communicate with the LCD display. To display data to the LCD screen we will be using the LiquidCrystal_I2C_Spark library. When wiring the LCD screen make sure to have two 10k ohm pulldown resistors on the SCL and SDA data lines. This is to ensure that there aren't any interruptions to the Photon 2's start up sequence. Since the LCD screen is not very large, we will need a way to cycle through the data. You can use the auto scroll function from the LCD library, but using a button allows the use to have more control over what data they want to look at. To set up the button module we simply have to connect the button to ground, VCC, and any digital pin. From there we can read the button state using the digital read function and, setting a shot debounce to not accidently set two off multiple button clicks.
Comments