Skip to content

Simple Weather Station using ESP32, OLED and DHT11 sensor.

Notifications You must be signed in to change notification settings

Beloin/WeatherStation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Weather Station

In this project, we show a simple Weather Application, using ESP32 and OLED. A simple OLed display shows the current temperature and the humidity using the DHT11 sensro and thean attached button works as the user interaction to the application.

  1. Button Click: Change temperature representation
  2. Button Clicks: Show Simple Animation
  3. Seconds Click: Turn monitor off/on

Button

To implement button on_click the GPIO_INTR_POSEDGE was used to interrupt on up edge of the click, as wrote in lib/button/button.c. In the hardware, we have a Push Button with 10K pull down resistor (Using 2 20K parallel), so when the button is pressed, the MCU gets a HIGH voltage. The Main application polls the button to see if the flag was changed in order to debounce it and call the on_click function.

Animation

The animation is implemented using "tick". Every call by the main proccess updates the animation accordingly to the current time. This could be used to update an 2D Physics engine and use sprites to update the display.

Main and Aplication Flow

The main file controls the application flow. We have 2 "Threads": The main thread polls button values, ticks the animation and show DHT11 informations in the OLed Screen; The weather Thread, runs at every 500ms reading from DHT11 hardware and assign the values to a common variable, so the main thread can read it and show in the display.

Circuit Diagram

Harware Circuit

Harware Circuits

Schematic Circuit

Schematic Circuits

1 Click - Change Representation

Representation

The Temperature representations is changing between °C, °F and K.

2 Clicks - Show Animation (Changes application behaviour)

Representation

Every 2 Clicks the ball animations is shown.

3 Seconds Click - Turns the OLed display off (Power saver)

Representation

On 3 Seconds click the screen is turn off to save battery life, turning on again when pressed for three seconds.

Documents about interrupt in ESP32

References

  1. SSD1306 datasheet, can be found here.
  2. ESP-IDF Implementation of SSD1306 by nopnop2002, can be found here.
  3. DHT11 Datasheet can be found here.
  4. DHT11 Driver implementation by UncleRus, can be found here.

About

Simple Weather Station using ESP32, OLED and DHT11 sensor.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published