Giter Site home page Giter Site logo

ags10_sensor's Introduction

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

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.

ags10_sensor's People

Contributors

lihini avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

ags10_sensor's Issues

Re: AGS10 i2c how to read

Hi, I was hoping that you could explain how the i2c addresses are read from the AGS10 please.

I'm looking at the datasheet - how do I read the VOC data?

Do I just read 5 bytes from 0x00 and the voc is bytes 2, 3, and 4 in ppb?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.