Repository navigation
GM-X02B Sensor Library - #1
Merged
Merged
Conversation
One Arduino library covering all nine SparkFun Qwiic MEMS gas sensor boards
(Winsen GM-102B/202B/302B/402B/502B/512B/602B/702B/802B), replacing the
per-part GM-602B library.
- src/sfTk/sfDevGMX02B.{h,cpp}: SparkFun Toolkit driver, nine-row part table
(default address, load resistance, response direction)
- src/SparkFun_GMX02B.h: Arduino I2C bus layer, one class per board variant
- Sensor identity is a required constructor argument, so a missing or wrong
part declaration is a compile error rather than a silently wrong reading
- Reads the onboard ADC101C021 10-bit I2C ADC: raw counts, output voltage,
sensor resistance, direction-normalized clean-air gas response, hardware
threshold alerts and hardware peak tracking
- GM-102B inverted response curve handled in the driver
- Six examples, keywords.txt, Doxygen config and GitHub Actions CI
- library.properties v2.0.0, depends on SparkFun Toolkit >= 1.2.0
sfe-SparkFro
left a comment
There was a problem hiding this comment.
I would like to see all the examples using ppm instead of raw values and voltages. I know these gas sensors are notoriously inaccurate for several reasons and calibration is required to get anywhere close. But users have to deal with a single value regardless, and IMO it would be much more helpful to think in terms of ppm than raw values or voltages.
What would it take to make the uncalibrated ppm calculations be close-ish? Is there a voltage to ppm conversion in the datasheets that we can use for default conversions?
gigapod
reviewed
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Library covers all nine SparkFun Qwiic MEMS gas sensor boards, replaces the
SparkFun_GM-602B_Arduino_Library.