Skip to content

Hydrogen Sensor

The Hydrogen sensor class provides access to a hydrogen sensor.

Creates a new Hydrogen object instance.

Hydrogen(options)

options

An object of properties used to construct the class.

sensor - The hardware connection definition.

interval (optional) - The sampling interval in milliseconds.

Returns a sample object containing the current hydrogen concentration data.

sample()

An object with the following property:

H - A number that represents the sampled hydrogen in parts per million (ppm).

const sensor = new device.sensor.Hydrogen({
sensor: {
io: device.io.I2C,
address: 0x22
}
});
const sample = sensor.sample();
console.log(`Hydrogen level: ${sample.H} ppm`);

Hydrogen