tsic-sensor
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

TSIC Digital Sensor library

This library aims at enabling to easily read the temperature of TSIC sensors via the Zacwire protocol with a Raspberry Pi.

⚠️ Currently, this library is only able to read TSIC 206 sensors. As this is the only sensor I have at home, I'm not able to test and verify other sensors. Please feel free to contact me or open a PR for other sensors. From reading their datasheets, it should be a fairly simple process to enable them.

Usage

First, require the package as a dependency

npm install tsic-sensor

Smaple usage:

import { Tsic } from 'tsic-sensor';

// The GPIO pin number to which the sensor (data pin) is connected
const gpioPin = x;
const tsic = new Tsic(gpioPin);

tsic
  .getTemperature()
  .then((temperature) => console.log('Temperature: %d C', temperature))
  .catch(console.error);

pigpio and why privileged?

This library is based on pigpio. Please check out their documentation, if you are getting errors related to this.
See: https://github.com/fivdi/pigpio#readme

Also, pigpio requires scripts to be run with sudo/root privileges to access hardware.
See: https://github.com/fivdi/pigpio#limitations

Readme

Keywords

Package Sidebar

Install

npm i tsic-sensor

Weekly Downloads

1

Version

0.1.2

License

GPL-3.0-or-later

Unpacked Size

45.7 kB

Total Files

7

Last publish

Collaborators

  • thomasu