Skip to content

Commit 2263c37

Browse files
committed
0.1.1 ACD3100
1 parent 2767bd4 commit 2263c37

File tree

6 files changed

+22
-54
lines changed

6 files changed

+22
-54
lines changed

libraries/ACD3100/ACD3100.cpp

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// FILE: ACD3100.cpp
33
// AUTHOR: Rob Tillaart
44
// DATE: 2024-10-29
5-
// VERSION: 0.1.0
6-
// PURPOSE: Arduino library for for I2C ACD3100 CO2 sensor
5+
// VERSION: 0.1.1
6+
// PURPOSE: Arduino library for I2C ACD3100 CO2 sensor
77
// URL: https://github.com/RobTillaart/ACD3100
88
// http://www.aosong.com/products-220.html
99

@@ -181,32 +181,6 @@ uint8_t ACD3100::getRequestTime()
181181
//
182182
// CALIBRATION
183183
//
184-
bool ACD3100::setCalibrationMode(uint8_t mode)
185-
{
186-
if (mode > 1) return false;
187-
uint8_t buf[5] = { 0x53, 0x06, 0x00, 0x00, 0x00 };
188-
buf[3] = mode;
189-
buf[4] = _crc8(&buf[2], 2);
190-
// Serial.println(buf[4], HEX);
191-
_command(buf, 5);
192-
return true;
193-
}
194-
195-
196-
uint8_t ACD3100::readCallibrationMode()
197-
{
198-
uint8_t buf[3] = { 0x53, 0x06, 0x00 };
199-
_command(buf, 2);
200-
_request(buf, 3);
201-
// if (buf[2] != _crc8(&buf[0], 2))
202-
// {
203-
// Serial.print(__FUNCTION__);
204-
// Serial.println(": CRC error");
205-
// }
206-
return buf[1];
207-
}
208-
209-
210184
bool ACD3100::setManualCalibration(uint16_t value)
211185
{
212186
if ((value < 400) || (value > 5000)) return false;
@@ -255,7 +229,7 @@ bool ACD3100::readFactorySet()
255229
// Serial.print(__FUNCTION__);
256230
// Serial.println(": CRC error");
257231
// }
258-
return (buf[1] == 0x01);
232+
return ((buf[0] == 0) && (buf[1] == 0x01));
259233
}
260234

261235

libraries/ACD3100/ACD3100.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// FILE: ACD3100.h
44
// AUTHOR: Rob Tillaart
55
// DATE: 2024-10-29
6-
// VERSION: 0.1.0
7-
// PURPOSE: Arduino library for for I2C ACD3100 CO2 sensor
6+
// VERSION: 0.1.1
7+
// PURPOSE: Arduino library for I2C ACD3100 CO2 sensor
88
// URL: https://github.com/RobTillaart/ACD3100
99
// http://www.aosong.com/products-220.html
1010

@@ -13,7 +13,7 @@
1313
#include "Wire.h"
1414

1515

16-
#define ACD3100_LIB_VERSION (F("0.1.0"))
16+
#define ACD3100_LIB_VERSION (F("0.1.1"))
1717
#define ACD3100_DEFAULT_ADDRESS 0x2A // 0x54 ?
1818

1919
// ERROR CODES
@@ -50,9 +50,6 @@ class ACD3100
5050

5151

5252
// CALIBRATION (! read datasheet)
53-
// 0 = manual 1 = auto
54-
bool setCalibrationMode(uint8_t mode);
55-
uint8_t readCallibrationMode();
5653
bool setManualCalibration(uint16_t value);
5754
uint16_t readManualCalibration();
5855

libraries/ACD3100/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.1.1] - 2024-10-29
10+
- fix #4, remove calibration mode (not supported as in ACD10)
11+
- fix #2, update documentation
12+
- fix **readFactorySet()** test
13+
914
## [0.1.0] - 2024-10-29
1015
- initial version
1116

libraries/ACD3100/README.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ and any other applications that may cause personal injury due to the product's f
8181
```
8282
TOPVIEW ACD3100
8383
+--------------------+
84-
pin 6 | o |
85-
pin 5 | o o | pin 1
86-
| o | pin 2
87-
| o | pin 3
88-
| o | pin 4
84+
pin 5 | o |
85+
| o o | pin 1
86+
| o o | pin 2
87+
| o o | pin 3
88+
| o o | pin 4
8989
| |
9090
+--------------------+
9191
```
@@ -235,9 +235,6 @@ Use 5~10 milliseconds above the minimal value the sensor still works.
235235
Read the datasheet about calibration process (twice).
236236
Incorrect calibration leads to incorrect output.
237237

238-
- **bool setCalibrationMode(uint8_t mode)** 0 = manual mode, 1 = automatic mode.
239-
Returns false if mode out of range ( > 1).
240-
- **uint8_t readCallibrationMode()** return set mode.
241238
- **void setManualCalibration(uint16_t value)** as the range of the device is
242239
from 400 to 5000, the parameter value should be in this range.
243240
- **uint16_t readManualCalibration()** read back the set manual calibration value.
@@ -250,9 +247,9 @@ Note: One should wait 5 milliseconds between the calibration calls (see datashee
250247
- **void factoryReset()** idem.
251248
- **bool readFactorySet()** Read back if factory reset was successful.
252249
- **uint32_t readFirmwareVersion(char \* arr)** copies firmware version in array.
253-
Minimum length is 11.
250+
Minimum length off arr is 11.
254251
- **uint32_t readSensorCode(char \* arr)** copies sensor code in array.
255-
Minimum length is 11.
252+
Minimum length of arr is 11.
256253

257254

258255
#### Debug
@@ -265,19 +262,14 @@ Minimum length is 11.
265262
#### Must
266263

267264
- improve documentation
268-
- get hardware to test
265+
- get hardware to test (See ACD10 #11)
269266

270267
#### Should
271268

272-
- investigate the acquisition time of 80 milliseconds
273-
- can it be made shorter by default?
274-
- improve error handling
269+
- keep in sync with ACD10 where possible.
275270

276271
#### Could
277272

278-
- rethink function names?
279-
- create unit tests if possible
280-
281273
#### Wont
282274

283275

libraries/ACD3100/library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/ACD3100.git"
1717
},
18-
"version": "0.1.0",
18+
"version": "0.1.1",
1919
"license": "MIT",
2020
"frameworks": "*",
2121
"platforms": "*",

libraries/ACD3100/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ACD3100
2-
version=0.1.0
2+
version=0.1.1
33
author=Rob Tillaart <[email protected]>
44
maintainer=Rob Tillaart <[email protected]>
55
sentence=Arduino library for the ACD3100 CO2 sensor.

0 commit comments

Comments
 (0)