Circuit diagram and code for my weather monitoring system [Raspberry Pi]
12 August 2015By Bhavyanshu Parasher
Overview
I recently upgraded my weather monitoring system. To those who don’t know, it basically records temperature, humidity, atmospheric pressure etc using various sensors. The sensors are integrated with GPIOs of my Raspberry Pi. Many people have asked me to share the circuit diagram & code for it so here it is. I designed it using Fritzing for linux. The code is still rough but it will give you a basic idea about how it all works. Please figure out the dependencies yourself. I have mentioned important ones though.
Requirements
Raspberry Pi
2 x 10K Ohm Resistors
Jumper wires
DS18B20 Temperature Sensor Probe
DHT11 Temperature & Humidity Sensor
BMP180 Barometer for Atmospheric Pressure & altitude
Circuit Diagram
Code Snippets
probetemp.py - Code to get temperature using DS18B20 temperature probe
plotter.py - Next we need to plot graphs using the data stored in each .dat file. Also, we will be tweeting the update. Make sure you put your twitter API keys. Also this is heavily dependent on matplotlib and tweepy. So make sure you pip install them.
execmain.sh - Finally, the bash script which is run via cron. Change directories or file names as per your requirement.
These are all the core files. Please change the file paths. I did not get time to make it path independent. Since it has to be made to run via cron job so I thought specifying paths would be better. If I make any changes I will update them here as well. Till then, you will have to add proper paths in scripts.
Result
Gurgaon City: 32.06℃ | Humidity 60.0% - (IST) 12/08/2015 20:00:55 | Atmospheric pressure: 732.52 mmHg at 310.64 m pic.twitter.com/Vudw68Fn5t
This is the tweet generated by the weather system. I will add more components to it. I will keep updating this with more information. Leave a comment if you wanna ask anything about it.
Note: I am a computer science engineer with interest in electronics so please excuse my technical errors in designing circuit diagrams :)