# aht20-sensor

> A Node.js I2C module for the Adafruit AHT20 Humidity/Temperature Sensor.

Latest version **1.0.2** (published 2023-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install aht20-sensor
pnpm add aht20-sensor
yarn add aht20-sensor
bun add aht20-sensor
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-10-08 |
| First published | 2021-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 27.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Thomas Guthruf |
| Maintainers | thomome |
| Keywords | AHT20, Humidity, Temperature, Sensor, Adafruit, Raspberry, Pi |

## Links

- npm: https://www.npmjs.com/package/aht20-sensor
- Repository: https://github.com/thomome/aht20-sensor
- Homepage: https://github.com/thomome/aht20-sensor#readme
- Issues: https://github.com/thomome/aht20-sensor/issues
- npm.io page: https://npm.io/package/aht20-sensor

## Dependencies (3)

- [i2c-bus](https://npm.io/package/i2c-bus.md) ^5.2.3
- [@types/node](https://npm.io/package/@types/node.md) ^20.8.3
- [@types/i2c-bus](https://npm.io/package/@types/i2c-bus.md) ^5.1.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-10-08
- 1.0.1 — 2023-10-07
- 1.0.0 — 2023-10-07
- 0.1.1 — 2021-10-12
- 0.1.0 — 2021-10-12

## README

# aht20-sensor

A Node.js I2C module for the Adafruit AHT20 Humidity/Temperature Sensor.

## Installation
```
npm install aht20-sensor
```

## Example
```js
const { default: AHT20 } = require('aht20-sensor');

AHT20.open().then(async (sensor) => {
    try {
        const temp = await sensor.temperature();
        const hum = await sensor.humidity();
        console.log(temp, hum);
    }
    catch(err) {
        console.error("Failed to get temperature or humidity data.");
    }
}).catch((err) => {
    console.error("Failed to open bus.");
});
```

## Wiring
Wiring can be found here: https://cdn-learn.adafruit.com/downloads/pdf/adafruit-aht20.pdf

---
_Source: https://npm.io/package/aht20-sensor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
