temperature-pi: a simple Raspberry Pi based temperature logger using a DS18B20 1-Wire digital temperature sensor, & a local sqlite database

Overview

temperature-pi

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

DS18B20+Resistor

Installation (hardware)

DS18B20 sensor connection

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.

Circuit snapshot

Installation (software)

The recommended way to install temperature-pi is through composer.

Just create a composer.json file for your project:

=5.3.0", "ronanguilloux/temperature-pi": "master-dev" } }">
{
     "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

Set up the sensor

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 a cronjob & log temperatures

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

Get a graph

To get the graph, run this app as a webserver

$ php -S "`hostname -I`:8080" -t web/

DS18B20+Resistor

Credits

License

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

You might also like...
A Simple Logging Class For PHP

KLogger: Simple Logging for PHP A project written by Kenny Katzgrau and Dan Horrigan. About KLogger is an easy-to-use PSR-3 compliant logging class fo

PHP logging library that is highly extendable and simple to use.

Analog - Minimal PHP logging library Copyright: (c) 2012-Present Johnny Broadway License: MIT A minimal PHP logging package based on the idea of using

A simple and beautiful laravel log reader
A simple and beautiful laravel log reader

Laravel Log Reader A simple and beautiful laravel log reader Documentation Get full documentation of Laravel Log Reader Other Packages Laravel H - A h

AcLog is a simple, zero-dependency PHP package to log activity to files

AcLog is a simple, zero-dependency PHP package to log activity to files. This is not meant for logging errors, this is can be used for logging c

FruityWiFi is a wireless network auditing tool. The application can be installed in any Debian based system (Jessie) adding the extra packages. Tested in Debian, Kali Linux, Kali Linux ARM (Raspberry Pi), Raspbian (Raspberry Pi), Pwnpi (Raspberry Pi), Bugtraq, NetHunter. Plant Watering Sensor Project for Zigbee Network (based on the Source Code of the DIYRUZ Flower Project  - https://github.com/diyruz/flower).
Plant Watering Sensor Project for Zigbee Network (based on the Source Code of the DIYRUZ Flower Project - https://github.com/diyruz/flower).

Plant-Watering-Sensor-Zigbee Plant Watering Sensor Project for Zigbee Network (based on the Source Code of the DIYRUZ Flower Project

Laravel logger is an activity event logger for your Laravel or Lumen application
Laravel logger is an activity event logger for your Laravel or Lumen application

Laravel logger is an activity event logger for your Laravel or Lumen application. It comes out the box with ready to use with dashboard to view your activity. Laravel logger can be added as a middleware or called through a trait. Easily have an Activity Log. This package is easily configurable and customizable. Supports Laravel 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6, and 7+

Slim-Logger - A stand-alone logger class for use with the Slim Framework

Slim-Logger - A stand-alone logger class for use with the Slim Framework

DDEV-Local: a local PHP development environment system
DDEV-Local: a local PHP development environment system

ddev ddev is an open source tool that makes it simple to get local PHP development environments up and running in minutes. It's powerful and flexible

Bolt is a simple CMS written in PHP. It is based on Silex and Symfony components, uses Twig and either SQLite, MySQL or PostgreSQL.

⚠️ Note - Not the latest version This is the repository for Bolt 3. Please know that Bolt 5 has been released. If you are starting a new project, plea

Database migrations for PHP ala ActiveRecord Migrations with support for MySQL, Postgres, SQLite

Introduction Ruckusing is a framework written in PHP5 for generating and managing a set of "database migrations". Database migrations are declarative

Minimalistic bookmark manager for your own server written in PHP. Bookmarks are stored in a sqlite database.

b - Bookmark manager b is a minimalistic bookmark manager for your own server. Written in PHP. Bookmarks are stored in a sqlite database. Features: fi

A simple database logger for all outgoing emails sent by Laravel website.

Laravel Email Database Log A simple database logger for all outgoing emails sent by Laravel website.

URL - link shortener based on sqlite
URL - link shortener based on sqlite

link-url-shortener url - link shortener based on sqlite.

FlatsApp using Laravel 8 with SQLite

The FlatsApp This Application Stacks using Laravel 8 with MySQL. Installation To get up and running of this Application please make sure you already h

Raspberry Pi Self Hosted Server Based on Docker / Portainer.io
Raspberry Pi Self Hosted Server Based on Docker / Portainer.io

Pi-Hosted Portainer Template V2 This repository is a collection of tutorials for hosting a variety of server applications using Docker and Portainer.

Browser Administration for Linux-Based Audio/Video-Player like ODROID or Raspberry Pi
Browser Administration for Linux-Based Audio/Video-Player like ODROID or Raspberry Pi

Browser Administration for Linux-Based Audio/Video-Player like ODROID or Raspberry Pi.

A now playing screen for the Raspberry Pi using the Last.fm API.
A now playing screen for the Raspberry Pi using the Last.fm API.

raspberry-pi-now-playing A now playing screen for the Raspberry Pi using the Last.fm API. This project is detailed, with photos of how I used it with

A simple and extensible fixture loader for PHP 7.3+, supporting SQLite and MySQL

Flowder Flowder is a (really) simple fixture loader for PHP 7.3+, supporting SQLite and MySQL. Using Flowder in PHP 7.2 or below? Try version 1 instea

Owner
Ronan Guilloux
Having fun with Open-Source since 1998.
Ronan Guilloux
Slim-Logger - A stand-alone logger class for use with the Slim Framework

Slim-Logger - A stand-alone logger class for use with the Slim Framework

Josh Lockhart 41 Mar 12, 2022
A simple database logger for all outgoing emails sent by Laravel website.

Laravel Email Database Log A simple database logger for all outgoing emails sent by Laravel website.

Shvets Group 136 Jan 4, 2023
Allows you to process logs using any PSR-3 compatible logger such as Monolog

Yii 2 PSR Log Target Allows you to process logs using any PSR-3 compatible logger such as Monolog

Alexander Makarov 67 Dec 14, 2022
Simple PHP Logger. Composer package

Basic PHP Logger ?? Simple logger. Composer package.

null 1 Jan 28, 2022
123Solar is a set of PHP/JS files that make a web logger to monitor your photovoltaic inverter(s)

123Solar is a set of PHP/JS files that make a web logger to monitor your photovoltaic inverter(s). It just need a web server and PHP, no databases are even needed. The philosophy is: To keep it simple, fast, with a low foot print to run on cheap and low powered devices.

null 30 Jan 6, 2023
Test Doubles for the PSR-3 Logger Interface

PSR Log Test Doubles Test Doubles for the PSR-3 Logger Interface Motivation In PHP world, most people create Test Doubles via PHPUnits mocking framewo

Jeroen De Dauw 2 Oct 7, 2022
📑 Laravel HTTP Logger

Logging incoming HTTP requests

The Dragon Code 28 Nov 29, 2022
ChromePhp - a PHP library for the Chrome Logger Google Chrome extension

ChromePhp - a PHP library for the Chrome Logger Google Chrome extension

Craig Campbell 1.4k Dec 30, 2022
Robust, composite logger with filtering, formatting, and PSR-3 support

laminas-log ???? Русским гражданам Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в

Laminas Project 27 Nov 24, 2022
CakePHP3: plugin that facilitates versioned database entities

Version A CakePHP 4.x plugin that facilitates versioned database entities Installation Add the following lines to your application's composer.json: "r

Jose Diaz-Gonzalez 52 Sep 3, 2022