temperature-pi is a simple Raspberry Pi based temperature logger using a DS18B20 1-Wire digital temperature sensor, & a local sqlite database. It's based on the php-gpio PHP library
Read this very easy-reading tutorial on the Cambridge University CompSci Laboratory Raspberry Pi dedicated pages.
Then install the DS18B20 on your bread board, wired to the #4 gpio pin, following the tutorial indications.
Then add a led & a resistor wired to the #17 gpio pin.
The recommended way to install temperature-pi is through composer.
Just create a composer.json
file for your project:
{
"require": {
"php": ">=5.3.0",
"ronanguilloux/temperature-pi": "master-dev"
}
}
And run these two commands to install it:
$ wget http://getcomposer.org/composer.phar
$ php composer.phar install
Oprionnaly, allow the vendor/ronanguilloux/php-gpio/blinker
file to be run without sudo:
Edit your /etc/sudoers
file:
$ sudo visudo
Then add this two lines in your /etc/sudoers
file :
(replace MyLinuxUser with your login name & change the path to the blinker)
This will allow you and Apache2 to run the blinker without sudo
MyLinuxUser ALL=NOPASSWD: /path/to/blinker
www-data ALL=NOPASSWD: /path/to/blinker
Using the shell, manually add theses kernel modules:
$ sudo modprobe w1-gpio
$ sudo modprobe w1-therm
To load such kernel modules automatically at boot time, edit the /etc/modules
file & add these two lines:
w1-gpio
w1-therm
Run the executable php file to record temperatures
$ thermometer
To trace temperatures chages, add this into your crontab to log the temperature through the day, each 30 minutes
0,30 * * * * /my/path/to/the/temperature-pi/thermometer >> /my/path/to/the/temperature-pi/resources/log
To get the graph, run this app as a webserver
$ php -S "`hostname -I`:8080" -t web/
- Ronan Guilloux [email protected]
- All contributors
- Images in the README.md : pi-io.com, robotics.org.za, Cambridge University
temperature-pi is released under the MIT License. See the bundled LICENSE file for details. You can find a copy of this software here: https://github.com/ronanguilloux/temperature-pi