Skip to content

Latest commit

 

History

History
 
 

Temperature

Temperature

This project measures the temperature using a Maxim DS18B20 1-wire sensor, stores the temperature in a Maria DB and displays temperatures on an Apache web page.

I used the project "Raspberry Pi Temperature Sensor: Build a DS18B20 Circuit" and added a database and a web server.

Equipment

  • Raspberry Pi
  • Maxim DS18B20 temperature sensor
  • Resistor 4.7 Kohm (or some value 1.5 - 5.6 Kohm).

Connect the DS18B20 temperature sensor and get the correct sensor identity, see "Raspberry Pi Temperature Sensor: Build a DS18B20 Circuit".

Installation

  • Install 'Temperature':
    cd /home/pi
    git clone https://github.com/lindehaven/Raspberry.git
    cd Raspberry/Temperature
    sudo cp -r www/html/* /var/www/html/.
    
  • Install Apache, Maria DB and PHP, see raspbian_lamp_install.md. Set the username and password that you want.
  • Setup Maria DB, see raspbian_maria_db_setup.md. Set the username and password that you want.
  • Add cron job and change 28-041780f40cff to the correct sensor identity, see raspbian_add_cron_job.md.
  • Edit /var/www/html/index.php and change 28-041780f40cff to the correct sensor identity.

Function

temperature_logger.py reads the temperature from the DS18B20 and stores the value in the Maria DB. Temperatures can be displayed via the Apache web page.

The web page displays the current temperature, lowest temperature, average temperature and highest temperature for the selected period.

The current temperature of the Raspberry Pi CPU and GPU are also displayed.