PHP Classes
elePHPant
Icontem

PHP Raspberry PI DS18B20: Read values from RaspberryPI DS18B20 sensors

Recommend this page to a friend!
  Info   View files Example   View files View files (10)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-02-13 (3 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 136 This week: 1All time: 8,845 This week: 366Up
Version License PHP version Categories
ds18b20 1.0MIT/X Consortium ...7.1Hardware, PHP 7
Description Author

This package can read values from RaspberryPI DS18B20 sensors.

It can read a Raspberry PI Linux system file that returns the list of a available sessions in a DS18B20 device.

The class can also read the values of each available sensor.

Innovation Award
PHP Programming Innovation award winner
February 2019
Winner
RaspberryPI is a concept of small hardware boards that work as small computers connected to sensors that can collect data from the environment.

This package can read values from RaspberryPI DS18B20 sensors allowing to develop interesting applications that can act upon the values read from those sensors.

Manuel Lemos
Name: András Zoltán-Gyárfás <contact>
Classes: 4 packages by
Country: Romania Romania
Age: 39
All time rank: 185643 in Romania Romania
Week rank: 297 Up5 in Romania Romania Up
Innovation award
Innovation award
Nominee: 1x

Winner: 1x

Details

A Simple DS18B20 Sensor Handling PHP Package

This package can be used to read the popular DS18B20 Sensor data from multiple sensors on a Raspberry PI.

Tested on Raspibian OS.

Note: Previously the Raspibian needs to be configured to handle the sensor.

Example usage (See _tests_ folder)

Read the raw data:

use azolee\DS18B20;

$respone =  DS18B20::loadSensors();

var_dump($respone);

Read the raw data and process it:

use azolee\DS18B20;
use azolee\DataFormat\{CelsiusDataProcessor, FahrenheitDataProcessor};


//in Celsius
$celsiusDataProcessor = new CelsiusDataProcessor();
$celsiusDataProcessor->setPrecision(3);

$respone =  DS18B20::loadSensors($celsiusDataProcessor);

var_dump($respone);


// in Fahrenheit
$fahrenheitDataProcessor = new FahrenheitDataProcessor();
$fahrenheitDataProcessor->setPrecision(0);

DS18B20::setProcessor($fahrenheitDataProcessor);

$respone =  DS18B20::loadSensors();

var_dump($respone);

License: MIT

Author: ANDRAS Zoltan Gyarfas

  Files folder image Files  
File Role Description
Files folder imagesrc (1 directory)
Files folder imagetests (3 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageazolee (1 file, 2 directories)

  Files folder image Files  /  src  /  azolee  
File Role Description
Files folder imageContracts (1 file)
Files folder imageDataFormat (2 files)
  Plain text file DS18B20.php Class Class source

  Files folder image Files  /  src  /  azolee  /  Contracts  
File Role Description
  Plain text file SenzorDataProcessor.php Class Class source

  Files folder image Files  /  src  /  azolee  /  DataFormat  
File Role Description
  Plain text file CelsiusDataProcessor.php Class Class source
  Plain text file FahrenheitDataProcessor.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Accessible without login Plain text file test.php Aux. Auxiliary script
  Accessible without login Plain text file testCelsius.php Example Example script
  Accessible without login Plain text file testFahrenheit.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:136
This week:1
All time:8,845
This week:366Up