Skip to content

Simple Weather Station using Raspberri PI Zero 2W, LCD Display and DHT11 sensor.

License

Notifications You must be signed in to change notification settings

Beloin/LCD_Rasp_Weather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Station with Raspberry PI Zero 2W

In this project was implemented a simple Temperature and Humidity station using Raspberry PI Zero 2W, an LCD and DHT11.

In order to run both in Linux system and Raspberry PI, it was created conditional compilation explicit in Code Structure and implemented in PeripheralFactory. So while using Linux is used the ConsoleDisplay implementation, and in RPI0 is used LCDDisplay. Also, to have the Weather data is implemented RandomWeatherGeneratorTask and in RPI0 DHT11Sensor.

The program uses mean 7%CPU in the RaspOS - Raspberry PI Zero 2W. Could use less if implemented time interruptions to some delays.

CPU Usage

Dependencies

  • pigpio (Usually comes pre-installed on pi boards)
  • pthreads: sudo apt-get install libpthread-stubs0-dev
    • Make DHT11 Workers.
  • spdlog: pacman -S spdlog or in apt based system sudo apt install libspdlog-dev
    • Simple and Fast Logging Library

Schematics

Kicad Schematcis

Circuit

Real Life Circuit

Code Structure

Display

There's an interface that dictates the way all the data will be set on display: the TextBasedDisplay

TextBasedDisplay UML

WeatherStatusTask

There's an interface that dictates the way the weather is acquired. The data will be scoped in a single struct named WeatherInfo. The WeatherTask will be running in its own thread, acquiring the data and writing it to the WeatherInfo struct. Race conditions are not treated since the program will be running in a controlled system.

Weather UML

References

About

Simple Weather Station using Raspberri PI Zero 2W, LCD Display and DHT11 sensor.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published