Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agners/micropython-sgp40
MicroPython I2C driver for SGP40 VOC sensor module
https://github.com/agners/micropython-sgp40
Last synced: 16 days ago
JSON representation
MicroPython I2C driver for SGP40 VOC sensor module
- Host: GitHub
- URL: https://github.com/agners/micropython-sgp40
- Owner: agners
- License: mit
- Created: 2020-11-01T19:20:37.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-01T19:22:09.000Z (about 4 years ago)
- Last Synced: 2024-09-06T06:39:54.079Z (2 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micropython - micropython-sgp40 - MicroPython I2C driver for SGP40 VOC sensor module. (Libraries / Sensors)
README
# Sensirion SGP40 VOC Sensor I2C driver for MicroPython
Sensirion SGP40 is a digital VOC (volatile organic compound) sensor. This
is a I2C driver written in Python 3 for MicroPython.## Getting Started
### Prerequisites
* Sensirion SGP40 Sensor Module
* MicroPython board with I2C interface### Wiring
Wire the I2C bus to the I2C bus on your MicroPython board. This is an example
using the Pyboard D:| Pyboard | SGP40 |
| ------------- |---------------|
| X15 (3V3) | VDD |
| X14 (GND) | GND |
| X9 | SCL |
| X10 | SDA |### Usage
This example reads the measurements in a continous loop:
```
import time
from machine import I2C, Pin
from sgp40 import SGP40i2cbus = I2C(1)
sgp40 = SGP40(i2c, 0x59)while True:
sgp40.measure_raw()
time.sleep(1)
```This returns raw data from the sensor. The data is meant to be processed by
the Sensirion specific VOC Algorithm, which returns air quality reflected by
an index.## Built With
* [MicroPython](http://micropython.org/)
* [SGP40 Sensor Module](https://www.sensirion.com/en/environmental-sensors/gas-sensors/sgp40/)## License
This project is licensed under the MIT License - see the
[LICENSE](LICENSE) file for details