@@ -13,7 +13,7 @@ Arduino library for COZIR range CO2 sensors.
1313
1414## Description
1515
16- The Cozir library is ** experimental** as not all functionality is tested.
16+ The COZIR library is ** experimental** as not all functionality is tested.
1717The polling mode as used in the examples is tested in the past by DirtGambit.
1818** CO2meter.com** sponsored a ** COZIR GC0034** to start hands on testing (2022-02).
1919This sensor does not support all commands, but as the pattern of the commands
@@ -25,7 +25,7 @@ does work too.
2525
2626The library (since 0.3.4) a separate class to parse the STREAMING data.
2727See COZIRParser below.
28- The Cozir class is focussed on polling and sending commands.
28+ The COZIR class is focussed on polling and sending commands.
2929
3030
3131#### Notes
@@ -41,7 +41,7 @@ It needs to be set to **CZR_POLLING** mode.
4141- Not all COZIR devices support all calls of this library.
4242
4343
44- ## Interface
44+ ## Interface Cozir
4545
4646Read the datasheet (again).
4747
@@ -109,6 +109,7 @@ use with care, read datasheet before use.
109109| 32 | default, good average |
110110| 255 | very slow, max smoothed |
111111
112+
112113- ** void setDigiFilter(uint8_t value)** The larger the value the more smoothed the signal is.
113114Larger values also means that the output does not follow fast changes.
114115So depending on your needs you need to find an optimal value for the project.
@@ -119,7 +120,7 @@ the actual CO2 value.
119120
120121### Streaming MODE
121122
122- Warning: hardware serial is needed to improve the capture of all output correctly.
123+ Warning: hardware serial is needed / recommended to improve the capture of all output correctly.
123124
124125- ** void setOutputFields(uint16_t fields)** Sets the fields in the output stream as a 16 bit mask. See table below.
125126- ** void clearOutputFields()** clears all the fields.
@@ -154,7 +155,8 @@ Note: NOT all sensors support all fields, check the datasheet of the sensor used
154155| CZR_HTC | 0X1082 | 4226 | shortcut |
155156| CZR_ALL | 0X3FFE | 16383 | debug |
156157
157- Default value is 6 = CZR_FILTCO2 + CZR_RAWCO2
158+
159+ Default value is CZR_DEFAULT == 6 == CZR_FILTCO2 + CZR_RAWCO2
158160
159161
160162### EEPROM
@@ -217,10 +219,34 @@ Also the user must reset the operating mode either to **CZR_POLLING** or **CZR_S
217219See examples.
218220
219221
222+ ## Future
223+
224+ - improve documentation
225+ - COZIR Parser a separate readme?
226+ - add examples
227+ - example COZIR with I2C display?
228+ - COZIR I2C class for newer generation
229+ ~ same functional interface
230+ - multiWire / pin a la PCF8574 lib
231+
232+
233+ #### won't for now
234+
235+ - add a ** setEEPROMFactoryDefault()** ?
236+ - unknown if all sensors have same values
237+ - build a Arduino COZIR simulator for testing.
238+ - add other sensors underneath?
239+
240+
241+
242+ ----
243+
244+
220245## COZIRParser
221246
222247Class to parse the output of a COZIR sensor in stream mode.
223248
249+
224250## Description
225251
226252(added in 0.3.4, experimental)
@@ -235,34 +261,51 @@ The updated value can be accessed with one of the functions, see cozir.h file.
235261
236262An example ** Cozir_stream_parse.ino** is added to show how to use this class.
237263
238- Note: to send commands e.g. outputField selection, to the sensor the COZIR
239- class is used (which is mostly focussed on polling access).
264+ ** NOTE:** to send commands e.g. outputField selection, to the sensor the COZIR
265+ class can be used (which is mostly focussed on polling access).
266+ Alternatively the user sends the low level commands just as a string over serial.
267+ This latter method will save memory especially in a final version of a project.
268+
269+ ** NOTE:** The COZIRparser skips the output of the Y, \* and @ command.
270+ These are configuration fields and therefore not part of the ** stream mode** fields.
271+ Furthermore not all fields these lines produce are understood.
272+ So parsing these lines is left to the user for now.
273+
274+ ** NOTE:** The COZIRparser class does not check for missing characters,
275+ the range of the fields recognized, or other errors. So the values
276+ returned should be handled with care.
277+
278+
279+ ## Interface COZIRParser
280+
281+ Read the datasheet (again).
282+
283+
284+ ### Constructor and initialisation
285+
286+ - ** C0ZIRParser()** constructor
287+ - ** void init()** resets all internal variables to 0 except PPM (set to 1)
288+ - ** void resetParser()** should / could be called if stream from sensor is
289+ interrupted for long period, e.g. if there are missing characters.
290+ This should prevent the parser to overshoot a value due to concatenating the
291+ value of different (interrupted) measurements or FIELDs.
292+ - ** uint8_t nextChar(char c)** all characters coming from the sensor should
293+ be send to the parser by means of ** nextChar()** .
294+ Default it will return 0 and the FIELD character is a field has been updated.
295+ Read Datasheet for the characters used.
240296
297+ The remainder of the interface are getters for the different fields.
241298
242299
243300## Future
244301
245302- improve documentation
246303 - COZIR Parser a separate readme?
247- - matrix functions vs sensor ?
248- - test
249- - test streaming mode
250- - test table / matrix ?
304+ - support splitting output of Y and \* command.
305+ - separate parser COZIRParserY()
306+ - separate parser COZIRParserStar()
307+ - separate parser COZIRParser@()
251308- add examples
252- - example COZIR with I2C display?
253- - example with GREEN YELLOW RED LED?
254309 - examples for COZIRParser.
255- - COZIR I2C class for newer generation
256- ~ same functional interface
257- - multiWire / pin a la PCF8574 lib
258310
259311
260- #### won't for now
261-
262- - add a ** setEEPROMFactoryDefault()** ?
263- - unknown if all sensors have same values
264- - build a Arduino COZIR simulator for testing.
265- - add other sensors underneath?
266-
267-
268-
0 commit comments