13
13
14
14
Arduino library for the ACD3100 CO2 sensor (I2C).
15
15
16
- ** The documentation needs to be updated**
17
- ** This is a copy of the ADC10 readme.md**
18
-
19
- The ACD3100 is very similar to the ACD10 but details differ.
20
-
21
- ** Work in progress Work in progress Work in progress Work in progress**
22
-
23
16
24
17
## Description
25
18
26
19
** Experimental**
27
20
21
+ The documentation is an adjusted copy of the ACD10 readme.md, as the
22
+ ACD3100 is very similar to the ACD10 but some details differ.
23
+
24
+ ** Work in progress Work in progress Work in progress Work in progress**
25
+
28
26
This library is to use the Aosong ACD3100 CO2 sensor.
29
27
Besides CO2 concentration this sensor also provides a temperature reading.
30
28
31
29
The CO2 concentration supported by the sensor has a range from 400 ~ 5000 ppm ±(50ppm + 5% reading).
32
30
This makes the sensor applicable for outdoor and indoor measurements in
33
31
a normal building setting.
34
32
The sensor is not suitable for CO2 heavy "industrial" environments.
33
+ See also datasheet warning below.
35
34
36
35
** Warning** The temperature range the sensor can measure is ** UNKNOWN**
37
36
as there is no documentation how to convert the raw data to meaningful one.
37
+ As far as information could tell this temperature is for Aosong internal use.
38
+ If you can decode the temperature bits please let me know.
38
39
39
40
The sensor can be read over I2C and over Serial.
40
41
This library only support the I2C interface (see hardware notes below).
42
+ The Serial mode is ** NOT** supported by this library.
43
+
44
+ Feedback as always is welcome.
41
45
46
+ ### Datasheet warning
42
47
43
- #### Pre-heat period
48
+ _ Do not apply this product to safety protection devices or emergency stop equipment,
49
+ and any other applications that may cause personal injury due to the product's failure._
50
+
51
+
52
+ ### Pre-heat period
44
53
45
54
When the sensor starts up it has a pre-heat period of 120 seconds.
46
55
The library provides functions to check the time since the constructor is called.
@@ -49,62 +58,66 @@ During the preheat period one can make measurements but one should use those
49
58
carefully as these are less accurate than after the preheat period.
50
59
51
60
52
- #### Calibration
61
+ ### Calibration
53
62
54
63
Also important is the calibration of the sensor, although done in the factory,
55
64
a CO2 sensor needs regular calibration. See datasheet for details.
56
65
57
66
58
- #### Power
67
+ ### Power
59
68
60
69
The sensor must be powered with 5V and uses about 225 mW.
61
70
This implies the sensor uses 50 mA (@5V ) and needs a separate power supply.
62
71
One must connect GND from the power supply to the GND of the MCU.
63
72
64
73
65
- #### Datasheet warning
66
-
67
- Do not apply this product to safety protection devices or emergency stop equipment,
68
- and any other applications that may cause personal injury due to the product's failure.
69
-
74
+ ### Operating conditions
70
75
71
- #### Operating conditions
76
+ | parameter | value | notes |
77
+ | :--------------------| :-------------:| :--------|
78
+ | temperature | 0°C~ +50°C | keep away from freezing cold or direct sunlight.
79
+ | humidity | 0% ~ 95% RH | keep in non-condensing conditions.
80
+ | Refresh frequency | 2 seconds |
72
81
73
- - temperature: 0°C~ +50°C ==> keep away from freezing cold or direct sunlight.
74
- - humidity: 0% ~ 95% RH ==> non-condensing conditions.
75
- - Data refresh frequency: 2 seconds
76
82
77
-
78
- #### Hardware
83
+ ### Hardware
79
84
80
85
81
86
```
82
87
TOPVIEW ACD3100
83
88
+--------------------+
84
- pin 5 | o |
85
- | o o | pin 1
86
- | o o | pin 2
87
- | o o | pin 3
88
- | o o | pin 4
89
+ pin 5 | o S |
90
+ pin 6 | o C R o | pin 1
91
+ pin 7 | o D T o | pin 2
92
+ pin 8 | o V G o | pin 3
93
+ pin 9 | o G 5 o | pin 4
89
94
| |
90
95
+--------------------+
91
96
```
92
97
93
- | pin | name | description | Notes |
94
- | :-----:| :--------:| :------------------| :-------:|
95
- | 1 | SDA/RX | I2C data | 3-5V
96
- | 2 | SCL/TX | I2C clock | 3-5V
97
- | 3 | GND | Ground |
98
- | 4 | VCC | Power +5V | separate power supply needed.
99
- | 5 | SET | select com mode | HIGH (or n.c.) => I2C, LOW => Serial
100
- | 6 | - | not connected |
98
+ ** Note the code chars are on the bottom side of the sensor!**
99
+
100
+
101
+ | pin | code | name | description | Notes |
102
+ | :-----:| :------:| :--------:| :------------------| :-------:|
103
+ | 1 | R | SDA/RX | I2C data | 3-5V
104
+ | 2 | T | SCL/TX | I2C clock | 3-5V
105
+ | 3 | G | GND | Ground |
106
+ | 4 | 5 | VCC | Power +5V | separate power supply needed.
107
+ | 5 | S | SET | select com mode | HIGH (or n.c.) => I2C, LOW => Serial
108
+ | | | | |
109
+ | 6 | C | | | unknown (clock?)
110
+ | 7 | D | | | unknown (data?)
111
+ | 8 | V | | | unknown (ground?)
112
+ | 9 | G | | | unknown (voltage?)
113
+
101
114
102
115
If pin 5 is not connected or connected to HIGH, ** I2C** is selected (default).
103
116
If pin 5 is connected to GND (LOW), Serial / UART mode is selected.
104
117
This latter serial mode is ** NOT** supported by this library.
105
118
106
119
107
- #### Related
120
+ ### Related
108
121
109
122
- https://emariete.com/en/sensor-co2-mh-z19b/
110
123
- https://emariete.com/en/sensor-co2-low-consumption-mh-z1311a-winsen/
@@ -118,7 +131,7 @@ This latter serial mode is **NOT** supported by this library.
118
131
- https://github.com/RobTillaart/Cozir
119
132
120
133
121
- #### Tested
134
+ ### Tested
122
135
123
136
TODO: Test on Arduino UNO and ESP32
124
137
@@ -141,7 +154,7 @@ Every time the power is shut off the pre-heat would run again internally.
141
154
It is unclear what effect this has on the lifetime and quality of the sensor.
142
155
143
156
144
- #### I2C multiplexing
157
+ ### I2C multiplexing
145
158
146
159
Sometimes you need to control more devices than possible with the default
147
160
address range the device provides.
@@ -161,7 +174,7 @@ too if they are behind the multiplexer.
161
174
See example ** TCA9548_demo_ACD3100.ino**
162
175
163
176
164
- #### I2C Performance
177
+ ### I2C Performance
165
178
166
179
Only test ** readSensor()** as that is the main function.
167
180
@@ -176,7 +189,7 @@ Only test **readSensor()** as that is the main function.
176
189
| 600 KHz | |
177
190
178
191
179
- TODO: run performance sketch.
192
+ TODO: run performance sketch on hardware .
180
193
181
194
182
195
## Interface
@@ -185,15 +198,15 @@ TODO: run performance sketch.
185
198
#include " ACD3100.h"
186
199
```
187
200
188
- #### Constructor
201
+ ### Constructor
189
202
190
203
- ** ACD3100(TwoWire \* wire = &Wire)** optional select I2C bus.
191
204
- ** bool begin()** checks if device is visible on the I2C bus.
192
205
- ** bool isConnected()** Checks if device address can be found on I2C bus.
193
206
- ** uint8_t getAddress()** Returns the fixed address 0x2A (42).
194
207
195
208
196
- #### PreHeat
209
+ ### PreHeat
197
210
198
211
PreHeat functions assume the sensor is (and stays) connected to power.
199
212
@@ -202,7 +215,7 @@ PreHeat functions assume the sensor is (and stays) connected to power.
202
215
left before preHeat is complete.
203
216
204
217
205
- #### Request and Read
218
+ ### Request and Read
206
219
207
220
The interface of the sensor is made asynchronous as there is a delay needed
208
221
of around 80 milliseconds between a request for new data and the availability
@@ -230,7 +243,7 @@ Use 5~10 milliseconds above the minimal value the sensor still works.
230
243
- ** uint8_t getRequestTime()** returns the current request time in milliseconds.
231
244
232
245
233
- #### Calibration
246
+ ### Calibration
234
247
235
248
Read the datasheet about calibration process (twice).
236
249
Incorrect calibration leads to incorrect output.
@@ -242,7 +255,7 @@ from 400 to 5000, the parameter value should be in this range.
242
255
Note: One should wait 5 milliseconds between the calibration calls (see datasheet).
243
256
244
257
245
- #### Miscellaneous
258
+ ### Miscellaneous
246
259
247
260
- ** void factoryReset()** idem.
248
261
- ** bool readFactorySet()** Read back if factory reset was successful.
@@ -252,7 +265,7 @@ Minimum length off arr is 11.
252
265
Minimum length of arr is 11.
253
266
254
267
255
- #### Debug
268
+ ### Debug
256
269
257
270
- ** uint8_t getLastError()** returns last error of low level communication.
258
271
0 commit comments