Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gaveshalabs/ags10_sensor
Micropython library for the AGS10 Volatile Organic Compounds sensor
https://github.com/gaveshalabs/ags10_sensor
Last synced: 1 day ago
JSON representation
Micropython library for the AGS10 Volatile Organic Compounds sensor
- Host: GitHub
- URL: https://github.com/gaveshalabs/ags10_sensor
- Owner: gaveshalabs
- License: mit
- Created: 2023-10-30T18:27:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-30T19:56:58.000Z (about 1 year ago)
- Last Synced: 2023-10-30T20:40:25.905Z (about 1 year ago)
- Language: Python
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AGS10 sensor
Micropython library for the AGS10 TVOC sensor## I2C
### Pin layout
| Pin | Name | Description |
|:-----:|:--------|:-------------|
| 1 | SCL | Serial clock |
| 2 | SDA | Serial data |
| 3 | GND | Ground |
| 4 | VCC | Power supply |> ## Warning!
>
> - The sensor uses I2C at low speed. It should be LESS than 15kHz.
>
> - The datasheet advices against frequent measurements. Specially whne TVOC measurements cannot be performed frequently. Doing so will deteriorate the sensor quickly.
>
> - There should be at least 1.5s delay between two successive measurements## Example
```py
from ags10 import AGS10
from machine import I2C
from time import sleep_ms# Init
sensor = AGS10(I2C(0, freq=10000))# Enable to perform CRC check for measurements
sensor.check_crc = True# Measure TVOC in parts per billion
tvoc = sensor.total_volatile_organic_compounds_ppb# wait before the next command to the sensor
sleep_ms(2000)# Measure resistance in kohms
resistance = sensor.resistance_kohm# Re-calibrate zero point.
# Set the resistance in kohms in virtual memory.
# Needs at least 15 min exposure in fresh air before calibration.
sensor.zero_point_calibrate(resistance)
sleep_ms(30)# Reset zero point to factory defaults
sensor.zero_point_factory_reset()
sleep_ms(30)# Update I2C address
sensor.update_address(126)
```## Support
You can always improve the quality of the libraries by providing issues and Pull Requests.