Skip to content

iio: chemical: Add driver and bindings for acd10

Akhilesh Patil linux-devicetree linux-iio lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2dt-bindings: iio: chemical: Add aosong acd10Documentation/devicetree/bindings/iio/chemical/aosong,acd10.yaml+34 -00 replies
2/2iio: chemical: acd10: Add driver for ACD10 CO2 sensorMAINTAINERS drivers/iio/chemical/Kconfig drivers/iio/chemical/Makefile +1 more+383 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] iio: chemical: Add driver and bindings for acd10

This patch series adds support for Aosong ASAIR acd10 CO2 (Carbon dioxide) sensor driver in IIO subsystem.

Patch 1: Adds bindings for this hardware
Patch 2: Adds driver code for acd10 under drivers/iio/chemical

Quick overview of acd10:
- This is CO2 sensor based on NDIR technology.
- Can measure CO2 concentration up to 5000ppm
- Supports serial interface over UART with 1200 baud rate.

Datasheet: https://www.es.co.th/Schemetic/PDF/ACD10.PDF

Protocol:
acd10 defines 4 types of UART frames - read co2, get software version, get instrument number and set single point calibration.
Frame format: fixed header, length of data, command code, Actual data, checksum. Response from the sensor follows same format.
Total length of each tx and rx frame for 4 commands is fixed and defined in the datasheet. Driver uses this information to write and read from sensor for each command over serdev interface.

Testing:
Driver is tested on Texas Instruments am62x sk board with sensor connected on UART5 on 40pin IO expander. Additional 3.3 to 5v bidirectional logic translator is used to interface with 3.3v IOs of am62x. Values are read using iio sysfs interface. Also I have blown into the sensor to observe sensor output increase due to CO2 in my exhale. Waveforms for read co2, get sw rev and get ins num commands are validated on logic analyzer.

Slight deviation from datasheet:
For command get software version, datasheet mentions frame length of 16 bytes including D11 reserved, however it is observed that sensor sends 15 bytes with length field 0xb (11 bytes of data), but actual data is 10 bytes. Hence, this is handled in the driver.

Driver supports reading co2, getting sw version and instrument number. Single point calibration and preheat implementation is left for future contributions.

Akhilesh Patil (2):
dt-bindings: iio: chemical: Add aosong acd10
iio: chemical: acd10: Add driver for ACD10 CO2 sensor

 .../bindings/iio/chemical/aosong,acd10.yaml   |  34 ++
 MAINTAINERS                                   |   7 +
 drivers/iio/chemical/Kconfig                  |  10 +
 drivers/iio/chemical/Makefile                 |   1 +
 drivers/iio/chemical/acd10.c                  | 365 ++++++++++++++++++
 5 files changed, 417 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/aosong,acd10.yaml
 create mode 100644 drivers/iio/chemical/acd10.c
Signature · 1 line
2.47.3