Commit graph

50 commits

Author SHA1 Message Date
4m1g0
d2dbf58947
Move global variables to class atributes to make it possible to define 2 sensors running independantly (#20) 2021-01-22 18:49:45 +01:00
Christoph Schultz
8a063e7c27
Add support for setting the range and autocalibration. Closes #1.
* added possibility to set Range, to enable/disable Autocalibrate and to calibrate maually ( see Datasheet v 1.2 : https://www.winsen-sensor.com/d/files/MH-Z14A.pdf

* Update MHZ.cpp

* Update MHZ.cpp

* Update MHZ.h

added calibrate Span, for complete functionality but commented out , due to professional use (req. constant atmosphere with 2k, 5k or 10k ppm CO2.).
corrected the bugs in MHZ.cpp also.

* Update MHZ.cpp

Added comments for  Sensors with specific firmware.

Co-authored-by: Christoph Schultz <christoph@schultz1-christoph.de>
2021-01-14 22:28:47 +01:00
Tobias Schürg
d67723a05d
Merge pull request #17 from bodensee/master
added upper L for Arduino Uno to preheating time
2020-11-28 00:10:04 +01:00
Daniel Hirscher
d79581a1e1
added upper L for Arduino Uno to preheating time
The literals for the preheating time are interpreted as int.
On Arduino Uno an int is 2 bytes in size, ranging from -32,768 to 32,767. Therefore, the calculated number of 3*60*1000=180000 does not fit in.
Added upper L to force the literal to long.
2020-11-26 16:25:17 +01:00
Tobias Schürg
b14f103251
Merge pull request #14 from Portagoras/patch-1
Correction
2020-07-05 05:44:59 +02:00
Portagoras
093774f701
Correction
The datasheet clearly says that the CO2 level is 2000x(th-2ms)/(th+tl+4ms), so I think here it should say 2000 too. At least that resulted in way better results for me.
2020-07-01 22:57:48 +02:00
Tobias Schürg
af5c565990
Make times unsigned long to avoid overlow
on 16 bit architectures. Closes #10
2019-09-08 11:21:55 +02:00
Tobias Schürg
4b438db79e
Update library.properties 2019-06-08 18:15:09 +02:00
Tobias Schürg
7f33a73ed7
Merge pull request #9 from ahorn42/master
Added some fixes and improvments
2019-06-08 18:12:51 +02:00
Andreas Horn
253f8ae7d1 implements various small fixes and improvements
* the preheating time is now a constant variable too
* it is no possible to initialize the senor without PWM xor without (Soft-)Serial
*
2019-06-08 13:37:21 +02:00
Andreas Horn
ffeddad217 changes include path for example 2019-06-08 12:46:57 +02:00
Andreas Horn
8d677f5dce fixes wrong responsetimes for the sensors, it is seconds, not milliseconds according to the datasheet. 2019-06-08 11:11:46 +02:00
Andreas Horn
62b75d191b adds the entire .vscode folder to gitignore 2019-06-08 11:10:41 +02:00
Andreas Horn
0fa60d5c66 fixed typo 2019-06-08 10:59:57 +02:00
Tobias Schürg
6314890812
Update library.properties 2019-03-02 15:05:18 +01:00
Tobias Schürg
db2472ab54
Merge pull request #8 from vladkozlov69/master
Added support of generic streams instead of hardcoded software serial.
2019-03-02 15:04:16 +01:00
Vladimir Kozlov
03d8500042 Added support of generic streams instead of software serial. 2018-12-31 10:04:11 +02:00
Tobias Schürg
4c7de25bb6
Bumped version to 1.0.3 2018-09-24 23:15:13 +02:00
Tobias Schürg
50fa6f29f3
Bumped version to 1.0.2 2018-09-24 23:14:25 +02:00
Tobias Schürg
a2cf7bac55
Merge pull request #7 from mariusebastian/patch-1
Debug info and temperature update
2018-09-24 23:12:39 +02:00
mariusebastian
f96cf2abc6
Debug info and temperature update
Prevent "...Status maybe not OK.." from always being printed when debug is on.
Changed the is !isReady check to isPreHeating when getting the latest temperature. The isReady check prevents the function from returing the pre stored temperature within MHZxxx_RESPONSE_TIME after the UART data has been requested. This is an unnecessary restriction.
2018-09-24 12:12:02 +02:00
Tobias Schürg
4d8878bde4
Merge pull request #4 from flatsiedatsie/patch-1
Save some memory
2018-09-10 22:16:24 +02:00
flatsiedatsie
7e401b4625
Save some memory
Instead of just creating an issue that the library uses a lot of memory,  I wanted to save you some work instead.

I have not tested this code, but i have double checked it.
2018-09-10 20:41:05 +02:00
Tobias Schürg
7ede0dfc0a
Updated description. 2018-09-07 00:03:33 +02:00
Tobias Schürg
dcc4063f61 Removed duplicated example. 2018-09-05 00:00:31 +02:00
Tobias Schürg
12481147ca
Merge pull request #3 from per1234/example-folder
Move example sketch to appropriately named folder
2018-09-04 23:58:12 +02:00
Tobias Schürg
ff4ff3f8b6 Merge branch 'master' of https://github.com/tobiasschuerg/MH-Z19B 2018-09-04 23:45:59 +02:00
Tobias Schürg
1195942932 Uncomments parts of example. 2018-09-04 23:45:41 +02:00
Tobias Schürg
6d827d6e82
Update README.md 2018-09-04 23:45:04 +02:00
Tobias Schürg
e4be4f03ec Creates library.properties and moved example to example directory. 2018-09-04 22:52:45 +02:00
Tobias Schürg
dd64e185cc
Update README.md 2018-09-04 22:44:22 +02:00
Tobias Schürg
b25c94459e
Update README.md 2018-09-04 22:43:56 +02:00
Tobias Schürg
4cd25306e7 Merge branch 'master' of https://github.com/tobiasschuerg/MH-Z19B 2018-09-04 22:33:03 +02:00
Tobias Schürg
252266c130 Extracted response times. 2018-09-04 22:33:00 +02:00
per1234
8140e3d131
Move example sketch to appropriately named folder
The Arduino IDE requires the sketch folder name to match the filename of the primary sketch file. This change causes the example sketch to be accessible via the Arduino IDE's File > Examples > LIBRARYNAME menu after the library is installed.

Reference:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#library-examples
2018-07-21 00:01:56 -07:00
Tobias Schürg
b5bb881bc1
Merge pull request #2 from per1234/keywords-separator
Use correct field separator in keywords.txt
2018-07-18 13:48:57 +02:00
per1234
ca2eb6e7ba
Use correct field separator in keywords.txt
The Arduino IDE requires the use of a single true tab separator between the keyword name and identifier. When spaces are used rather than a true tab the keyword is not highlighted.

Reference:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keywords
2018-07-17 07:29:47 -07:00
Tobias Schürg
83ba964a90 Implemented isPreHeating and isReady. 2018-07-07 16:05:40 +02:00
Tobias Schürg
99729af090 Added isPreheating and isReady to MHZ.h and reformatted. 2018-07-07 12:59:32 +02:00
Tobias Schürg
7158f63459 Introduced status codes as return values. 2018-07-04 23:20:12 +02:00
Tobias Schürg
a66da23b89 Changed status handling as it seems as if the mhz19B returns 0 instead of 0x40 like the mhz19. 2018-06-24 14:38:42 +02:00
Tobias Schürg
29ea8e92bc Added a debug mode and improved log messages. 2018-06-24 12:22:50 +02:00
Tobias Schürg
ddef5ff84f Extracted MHZ logic into its own class. 2018-06-23 14:32:55 +02:00
Tobias Schürg
4daa920efd Also defined CO2_IN and more logging. 2018-06-23 12:35:27 +02:00
Tobias Schürg
cd9a51f5a4 Renaming lcd file. 2018-04-22 21:19:35 +02:00
Tobias Schürg
1c6c808c03 Added a modified version which shows the CO2 measurements on a LCD. 2018-04-22 21:18:39 +02:00
Tobias Schürg
144b2ed588 Added formula to readme. 2018-04-22 12:11:58 +02:00
Tobias Schürg
847b20fe40 Added links to README. 2018-04-22 11:51:44 +02:00
Tobias Schürg
fe8a863c95 Renamed ino to match directory. 2018-04-22 11:40:32 +02:00
Tobias Schürg
405515f61c Initial commit 2018-04-22 11:36:51 +02:00