lukshio/ds18b20-multibus

The DS18B20 Sensor Multibus Handling PHP Package

Maintainers

Details

github.com/Lukshio/ds18b20

Source

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 3

pkg:composer/lukshio/ds18b20-multibus

dev-master 2024-08-01 12:46 UTC

This package is auto-updated.

Last update: 2025-12-29 04:03:27 UTC


README

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