Turn Raspberry Pi into temperature and humidity logging station with DHT11 sensor
Turn Raspberry Pi into temperature and humidity logging station with DHT11 sensor
#Electrical diagram
sudo apt-get install php5-sqlite3
git clone https://github.com/DzikuVx/raspberry_temperature_log.git
cd raspberry_temperature_log
sh build_sensor.sh
python get_data.py
crontab -e
), it will get save data do database every 20 minutes: */20 * * * * sudo python /home/pi/raspberry_temperature_log/get_data.py
wget http://www.open.com.au/mikem/bcm2835/bcm2835-1.8.tar.gz
tar -zxvf bcm2835-1.8.tar.gz
cd bcm2835-1.8
./configure
make
sudo make install
server {
listen 0.0.0.0:80;
server_name temperature.spychalski.info;
access_log off;
root /home/pi/raspberry_temperature_log/website;
index index.php;
# default try order
location / {
try_files $uri $uri/ /index.php?$args;
}
# enable php
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
sensor_driver.c readout is based on https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/tree/master/Adafruit_DHT_Driver by Adafruit