Skip to content

sashuu69/home-weather-station

Repository files navigation

Home Weather Station

Introduction

The home Weather Station is a DIY weather Station that collects the following data and uploads the data to firebase:-

  1. Air Quality Index
  2. Compressed Natural Gas (CNG)
  3. Liquid Petroleum Gas (LPG)
  4. Smoke
  5. Rain
  6. Temperature
  7. Humidity
  8. Heat Index



Features

  1. Collects AQI, CNG, LPG, smoke, temperature, humidty, rain presence and heat index. The values from gas sensors are converted to PPM. Thank you for Bharath Kinnera for this Gas sensor PPM conversion video.
  2. Stores the data in a log file and Firebase.
  3. Dispays the data in a LCD display.
  4. A telegram bot for fetching values.

Folder Structure

  1. arduino_nano_code: Contains the embedded C code for flashing to the arduino nano board.
  2. arduino_uno_code: Contains the embedded C code for flashing to the arduino uno board.
  3. docs: Contains images of the product.
  4. heroku_code/telegram-bot: Telegram bot python code for Heroku server.
    1. telebot
      1. init.py: Library initialisation.
    2. app.py: Main program for telegram bot.
    3. Procfile: Procfile is for Heruku.
    4. requirements.txt: Library names required for running telegram bot program.
  5. pi_code: Contains the code to be run on the Raspberry Pi Zero W.
    1. dataRetriver.py: Python program that gets values from sensor and stores the data in log file and firebase.
    2. lcdDisplay.py: Python program to display data on LCD screen.
    3. requirements.txt: Required libraries for the python programs in this folder.
    4. RPi_I2C_driver.py: LCD display driver.
    5. sampleENV: A sample env that lists all the env variables used by the programs.

Components Used

  1. Arduino Nano - Tomson Electronics
  2. Arduino UNO and programming cable - Tomson Electronics
  3. MQ-2 gas sensor - Tomson Electronics
  4. MQ-4 - Amazon
  5. MQ-5 - Tomson Electronics
  6. MQ-135 - Tomson Electronics
  7. Rain sensor - Tomson Electronics
  8. DHT22 - Tomson Electronics
  9. Raspberry Pi Zero W - Tomson Electronics
  10. LCD module - Tomson Electronics
  11. LCD I2C module - Tomson Electronics
  12. SD card class 10 16 GB - Amazon
  13. 220V to 12V DC Adapter - Amazon
  14. Buck converter - Tomson Electronics
  15. Male headers - Tomson Electronics
  16. Female headers - Tomson Electronics
  17. Dotted PCB - Robo Elements
  18. Ribbon cable - Amazon
  19. USB extension cable - Amazon
  20. Powered USB hub - Amazon
  21. Pole, Umbrella, wires, tapes and zip ties

Discount code for Tomson Electronics : ZENOOFF2020

Pre-Installation Steps

  1. Connect the sensors as per circuit diagram.

  2. Flash the nano and uno code respectively.

  3. Clone the project in Raspberry Pi Zero W.

  4. Rename sampleENV as .env.

  5. Create Realtime database in firebase.

  6. add the necessary edits to .env file

  7. Run the python programs inside pi_code folder.

  8. create a python inside heroku_code/telegram-bot with name credentials.py with following contents:-

    bot_token = "Bot Token"
    bot_user_name = "Bot Username"
    URL = "Heroku app URL"
    firebase_token = "Firebase token"
    firebase_authDomain = "Firebase authDomain"
    firebase_databaseURL = "Firebase database URL"
    firebase_storageBucket = "Firebase Storage Bucket"

Images






Sensor Info

Sensor Name Features
MQ-2 Smoke
MQ-4 CNG
MQ-5 LPG
MQ-135 AQI
Rain sensor Rain
DHT22 Temperature, Humidity and Heat Index

Database

Old Protoype


Contributions

  1. Sashwat K (@sashuu6) sashwat0001@gmail.com