Compare commits

...

149 Commits

Author SHA1 Message Date
Miguel Angel Califa Urquiza
c927504bf5 Update readme and contributing files 2023-10-04 16:21:25 -05:00
Miguel Angel Califa Urquiza
337d962862
Merge pull request #64 from adrcunha/master
Allow setting the ADC pin of a MQUnifiedsensor object.
2023-05-16 11:21:45 -05:00
Adriano Cunha
f7f2c1f3f4 Allow setting the ADC pin of a MQUnifiedsensor object.
The ADC pin can only be set when using the full/long constructor, causing the short constructor (name/type only) useless because the pin is unset.

Also default the ADC pin to 1 for consistency sake.
2023-04-11 14:30:49 -07:00
Miguel Angel Califa Urquiza
1c131eed65
Merge pull request #61 from adrcunha/master
Cleanup general definitions in MQUnifiedSensor.h
2023-04-11 07:13:18 -05:00
Adriano Cunha
b6bff185f3 Cleanup general definitions in MQUnifiedSensor.h
ADC_RESOLUTION is unused, and retries and retry_interval are only used by getVoltage().
Thus, remove ADC_RESOLUTION and move retries and retry_interval to MQUnifiedsensor.cpp.
Furthermore, these three definitions have generic names so it's easy to have them
conflict with a user's sketch that imports MQUnifiedSensor.h.
2023-04-03 08:53:13 -07:00
Miguel Angel Califa Urquiza
a7e89570fd
Merge pull request #53 from SMH17/patch-1
Update README.md
2023-03-15 16:35:38 -05:00
Miguel Angel Califa Urquiza
35180270ac
Merge pull request #56 from PsySc0rpi0n/patch-2
Update MQUnifiedsensor.cpp
2023-03-15 16:35:26 -05:00
Miguel Angel Califa Urquiza
52bccfbff1
Merge pull request #57 from PsySc0rpi0n/patch-3
Update MQUnifiedsensor.h
2023-03-15 16:35:12 -05:00
PsySc0rpi0n
3368613dd7
Update MQUnifiedsensor.h 2022-09-07 22:24:54 +01:00
PsySc0rpi0n
9f41530cda
Update MQUnifiedsensor.cpp
Change the `_type` array size from 6 to 7 so that it can display sensor name's with 6 characters or more.
2022-09-07 22:23:27 +01:00
Silvio Marano
e862774fe0
Update README.md
These sensors are all made by HANWEI Electronics, Sparkfun etc. are just resellers.
2022-08-03 01:53:49 +02:00
miguel5612
27465dfb99 Launched 3.0 Official! 2022-03-21 14:36:26 -05:00
miguel5612
e3f5e2ec0c Added unit tests! to validate library calculations 2022-03-21 14:32:37 -05:00
miguel5612
6a035cc5d0 Fix in regression of MQ136 2022-03-21 14:19:48 -05:00
miguel5612
80025e8398 Little changes 2022-03-21 08:18:41 -05:00
miguel5612
d3241a1e2f Added MQ136 Example 2022-03-21 08:17:54 -05:00
miguel5612
4b71c626b0 Fixed comment mentioned #29 2022-03-20 12:59:19 -05:00
miguel5612
07b6948f76 Updated and fixed typo examples 2022-03-20 12:53:36 -05:00
Miguel Angel Califa Urquiza
990e6878ef
Merge pull request #51 from fredolaredo/patch-1
some typo recommendations
2022-03-20 12:44:45 -05:00
miguel5612
6322e9c03d Following comment in #31 we added example 2022-03-20 12:27:54 -05:00
miguel5612
964204706f Added correction factor for Rs/R0 (Ratio) 2022-03-20 09:48:02 -05:00
miguel5612
1f8310a6e7 Changed type of RL internally to fix bug #37 2022-03-20 09:44:30 -05:00
miguel5612
700d367d93 Fix Rs calculation for MQ303A 2022-03-20 09:32:31 -05:00
miguel5612
4be0a40997 Remove delay 2022-03-20 08:50:06 -05:00
miguel5612
6aa78fd575 Bug 44 added heating flags 2022-03-20 08:48:12 -05:00
miguel5612
c934152cd7 Added MQ135-ADS1115 example and feature 2022-03-20 08:28:45 -05:00
fredolaredo
525a09644b
some typo recommendations
Hi Miguel, thanks you for the Library, here you will find some typo recommendations. not an expert in english myself .
2022-03-19 15:25:57 +01:00
Miguel Angel Califa Urquiza
16affe479f
Merge pull request #49 from vincenzomanzoni/patch-1
_VOLT_RESOLUTION data type should be float
2022-02-06 17:17:59 -05:00
Miguel Angel Califa Urquiza
4a3d46f47e
Merge pull request #46 from Prabhuelectro/patch-1
Update smokeDetector.ino
2022-02-06 17:17:48 -05:00
Vincenzo Manzoni
bf6d90db69
_VOLT_RESOLUTION data type changed to float
_VOLT_RESOLUTION can be either 5 or 3.3 V. However, 3.3 V cannot be stored properly in a byte data type and it requires a float data type.
2021-11-03 00:31:39 +01:00
Prabhu
1818c3cf1a
Update smokeDetector.ino
Semi colon before the curly bracket.
2021-05-10 13:27:40 +05:30
Miguel Angel Califa Urquiza
874be50106
Merge pull request #33 from Yoimer/fix-esp32-measuring-issue-when-connected-to-wifi
added esp32-wroom-32d board, fixed the measuring issue when connected…
2020-08-31 19:29:35 -05:00
Yoimer Román
71c0d82314 added esp32-wroom-32d board, fixed the measuring issue when connected to wifi. added esp8266 and esp32 and library.properties to avoid avr warning on arduino ide when compiling 2020-08-23 21:19:35 -04:00
Miguel Angel Califa Urquiza
11bef492e5
Update README.md 2020-07-09 22:01:09 -05:00
Miguel Angel Califa Urquiza
728450025a
Update README.md 2020-07-09 21:56:49 -05:00
Miguel Angel Califa Urquiza
a059971123
Update README.md 2020-07-09 21:55:09 -05:00
Miguel Angel Califa Urquiza
e9425f7047
Update README.md 2020-07-09 21:54:03 -05:00
miguel5612
beab80c403 Added offset of 400 ppm of CO2 on example MQ135 2020-05-31 10:58:00 -05:00
miguel5612
688827ffb4 Fixed MQ-131 Issue 2020-04-20 19:40:27 -05:00
miguel5612
b9a5e62899 Updated examples (Issue 26) 2020-04-20 19:23:45 -05:00
Miguel Angel Califa Urquiza
a906388c5c
Update README.md 2020-04-20 19:06:00 -05:00
Miguel Angel Califa Urquiza
948afddf0d
Update README.md 2020-04-20 19:05:08 -05:00
Miguel Angel Califa Urquiza
090de8f9e0
Update README.md 2020-04-11 10:48:04 -05:00
Miguel Angel Califa Urquiza
5053b10498
Create pull_request_template.md 2020-04-04 10:57:41 -05:00
Miguel Angel Califa Urquiza
8a87cce57e
Update README.md 2020-04-04 10:38:43 -05:00
Miguel Angel Califa Urquiza
972c79578e
Update README.md 2020-04-04 10:36:12 -05:00
Miguel Angel Califa Urquiza
4246716355
Update README.md 2020-04-04 10:35:52 -05:00
Miguel Angel Califa Urquiza
1fe32c4b6e
Update README.md 2020-04-04 10:21:19 -05:00
miguel5612
39b4449899 Added parenthesis to make clear the operation 2020-04-04 10:16:15 -05:00
miguel5612
edd573ba0f Updated example and created release 2020-04-04 10:12:30 -05:00
miguel5612
6ecc769676 Updated example 2020-04-04 09:52:56 -05:00
miguel5612
e07c4b7f71 Added example for ESP-32 2020-04-04 09:52:34 -05:00
miguel5612
952a456a35 Fixed board name 2020-04-04 09:51:16 -05:00
miguel5612
ff0cb0562a Fixed ADC_Bit_Resolution for _ADC_Bit_Resolution 2020-04-04 09:50:14 -05:00
Miguel Angel Califa Urquiza
f8d1bcbc76
Update README.md 2020-04-04 09:38:27 -05:00
Miguel Angel Califa Urquiza
7c3cd5793c
Update README.md 2020-04-04 09:23:47 -05:00
Miguel Angel Califa Urquiza
38f93037ce
Update README.md 2020-04-02 11:02:50 -05:00
Miguel Angel Califa Urquiza
b9ba249140
Update README.md 2020-04-02 11:01:56 -05:00
Miguel Angel Califa Urquiza
a7554fa8dd
Update README.md 2020-04-02 11:01:02 -05:00
Miguel Angel Califa Urquiza
f93b5128ce
Update README.md 2020-04-02 09:56:03 -05:00
Miguel Angel Califa Urquiza
1a14e12450
Removed excel - Not needed now 2020-04-02 09:52:30 -05:00
Miguel Angel Califa Urquiza
9bfea58092
Update README.md 2020-04-02 09:51:43 -05:00
Miguel Angel Califa Urquiza
555e49d31e
Update README.md 2020-04-02 09:35:18 -05:00
miguel5612
d0b00b4025 Updated props 2020-03-30 20:04:02 -05:00
miguel5612
f83e0fb0d7 Fixed bit comparation to strin 2020-03-30 19:54:22 -05:00
miguel5612
65a1246e51 Fixed ESP8266 volt resolution 3.3 2020-03-30 19:51:23 -05:00
miguel5612
28ce4c80f7 Removed setR0 before calibratioN 2020-03-30 19:46:49 -05:00
miguel5612
9497574e11 Fixed issue on calibratioN 2020-03-30 19:17:25 -05:00
miguel5612
9cbc753758 Updated MQ-board examples 2020-03-30 18:58:07 -05:00
miguel5612
c7b67d7fa5 Updated examples 2020-03-30 18:40:55 -05:00
miguel5612
6b3c764b71 Trying options for version 1.10 2020-03-30 12:39:13 -05:00
miguel5612
ef5a8d5993 UPdated version 2020-03-30 12:35:43 -05:00
miguel5612
aab8c90bc4 Updated props 2020-03-30 11:59:32 -05:00
miguel5612
d321458f71 Fixed smoke calculation 2020-03-30 10:41:57 -05:00
miguel5612
63f8eed37b Added digital input 2020-03-29 22:16:52 -05:00
miguel5612
d7e244d646 Added digital input 2020-03-29 22:14:07 -05:00
miguel5612
d6b66f2bdd Added important note 2020-03-29 22:08:16 -05:00
miguel5612
1840c75c0a Added external A2_D Support 2020-03-29 22:03:45 -05:00
miguel5612
8f3ede62f4 Added wiring example 2020-03-29 21:45:42 -05:00
miguel5612
d7b1ed1314 Added MQ-135 all gases 2020-03-29 20:48:45 -05:00
miguel5612
8a4127c879 Changed some gases 2020-03-29 19:34:06 -05:00
miguel5612
80af739dfd Fixed calibration calculation issue 2020-03-29 15:51:54 -05:00
miguel5612
fce223342f Added lineal vs exponential example 2020-03-28 13:23:19 -05:00
miguel5612
70fbaa9115 Added Linear ecuation on test algorithm 2020-03-28 12:58:25 -05:00
miguel5612
ab77a7a4d7 Updated MQ-4 example and tested 2020-03-28 12:33:09 -05:00
miguel5612
411607dd5a Updated equation 2020-03-28 12:31:23 -05:00
miguel5612
0e8c0b3f5f Added equation 2020-03-28 12:28:36 -05:00
miguel5612
ce87a05178 Added sources 2020-03-28 12:25:48 -05:00
miguel5612
8bdb1fc193 Updated linear regresion method 2020-03-28 12:23:38 -05:00
miguel5612
5b75d1f491 Added MQ-9 All 2020-03-28 12:18:07 -05:00
miguel5612
5659e4c086 Moved comment 2020-03-28 08:43:30 -05:00
miguel5612
c583fea17c Added MQ4 all gases 2020-03-28 08:42:25 -05:00
miguel5612
0d4374a73d Removed unused vars 2020-03-27 22:57:14 -05:00
miguel5612
5ce115435a Comments fixation 2020-03-27 22:55:51 -05:00
miguel5612
3d1bb90e38 Changed variable types 2020-03-27 22:54:05 -05:00
miguel5612
9a1974033e Updated basic examples 2020-03-27 22:03:29 -05:00
miguel5612
d0f49fa4f0 Fixed print issue 2020-03-27 21:57:28 -05:00
miguel5612
1712dc56c9 Fixed algorithm calculation 2020-03-27 21:02:15 -05:00
miguel5612
c54b79e7f7 Migrated documentation to another repo 2020-03-27 08:22:44 -05:00
miguel5612
510e8dac53 Updated regression model selection 2020-03-26 22:18:07 -05:00
miguel5612
c67ceab56a Updated add comment 2020-03-26 20:13:58 -05:00
miguel5612
a4ea39b2f4 Added test equation 2020-03-26 20:13:27 -05:00
miguel5612
b992078540 Added pendent to validate example 2020-03-26 15:01:30 -05:00
miguel5612
28ed0da67b Added algorithm tester example - Work in progress 2020-03-26 14:54:25 -05:00
miguel5612
65e8664c69 Added options to custom 2020-03-26 14:46:14 -05:00
miguel5612
2cfb8324ed Updated smoke detector example 2020-03-26 14:45:28 -05:00
miguel5612
b6da8a2181 Updated examples 2020-03-26 14:42:46 -05:00
miguel5612
333610088f Added MQBoard 2020-03-26 14:31:17 -05:00
miguel5612
0b6bfd3863 Updated alcohol on PPM 2020-03-26 14:17:28 -05:00
miguel5612
b0f47547a5 Fixed name 2020-03-26 13:23:55 -05:00
miguel5612
2dcf3e6f55 Updated readme 2020-03-26 13:23:05 -05:00
miguel5612
cf15fb6d2a Updated MQ131 to MQ309 2020-03-26 13:20:05 -05:00
miguel5612
733988c5d3 Updated MQ1312 2020-03-26 13:11:30 -05:00
miguel5612
f8a57bbdff Added MQ-8 and MQ-9 2020-03-26 13:09:10 -05:00
miguel5612
fad888dca4 Updated MQ-7 2020-03-26 13:04:04 -05:00
miguel5612
e9e1169cc7 Fixed MQ-6 2020-03-26 12:51:02 -05:00
miguel5612
50342b0bc6 Updated MQ-5 2020-03-26 12:41:20 -05:00
miguel5612
1311d9446d Updated examples to MQ-4 2020-03-26 12:37:12 -05:00
miguel5612
3b578869ad Added gas and A, B values 2020-03-26 12:30:16 -05:00
miguel5612
b4be0e4175 Updated MQ-2 Example 2020-03-26 12:27:02 -05:00
miguel5612
ad69c46d87 Added space | stetic details 2020-03-26 12:19:36 -05:00
miguel5612
7e497b0833 Fixed comments 2020-03-26 11:59:34 -05:00
miguel5612
973e2dbb84 Fixed error 2020-03-26 11:54:55 -05:00
miguel5612
3ae663163b Fixed example 2020-03-26 11:54:18 -05:00
miguel5612
1177d5827d Updated MQ-3 example 2020-03-26 11:40:06 -05:00
miguel5612
532a83e186 Fixed example 2020-03-26 11:39:50 -05:00
miguel5612
d79a303ce9 Added ohm sign on debug serial 2020-03-26 11:24:39 -05:00
miguel5612
1b351f9495 Fixed overflow 2020-03-26 11:17:46 -05:00
miguel5612
abac48da38 Fixed voltage calculation 2020-03-26 11:08:53 -05:00
miguel5612
12695e75a6 Added debug on MQ-3 2020-03-26 10:56:52 -05:00
miguel5612
aa11343a97 Fixed mq-3 example 2020-03-26 10:23:51 -05:00
miguel5612
a03ceab3dc Updated method name 2020-03-26 10:12:04 -05:00
miguel5612
7cec5bbb77 Removed old prints 2020-03-26 10:09:36 -05:00
miguel5612
b6b36edb9d Removed unused code and added serial debug 2020-03-26 09:56:29 -05:00
miguel5612
fae50dc388 Removed macros 2020-03-26 09:03:40 -05:00
miguel5612
2708a4c22b Translated tbl 2020-03-25 22:22:48 -05:00
miguel5612
fe3925631f Translated headers 2020-03-25 22:21:22 -05:00
miguel5612
859b6ad37f Added docs folder to save temporal work in progress 2020-03-25 21:57:41 -05:00
Miguel Angel Califa Urquiza
d686f17299
Update README.md 2019-12-09 07:22:12 -05:00
Miguel Angel Califa Urquiza
627c17b228
Added user manual 2019-12-09 07:21:52 -05:00
miguel califa
3261318577 Fixed merge conflict 2019-09-28 11:21:23 -05:00
miguel califa
e5578c199f Updated version in library.prop 2019-09-28 11:20:37 -05:00
miguel califa
ff002f9993 Updated examples, added new method explanation 2019-09-28 11:18:28 -05:00
Miguel Angel Califa Urquiza
b85e7520d4
Merge pull request #14 from miguel5612/develop
Value of _RLValue - Added getRL and setRL method
2019-09-28 11:07:40 -05:00
miguel califa
0f912a3c4a Value of _RLValue - Added getRL and setRL method 2019-09-28 11:05:55 -05:00
miguel5612
b2616295a3 Respect upper and down limits from datasheet indicating 0 PPM or 9999 PPM 2019-09-08 12:49:02 -05:00
Ghiordy
886bfd9981
Merge pull request #9 from aetilius/master
Correct data type for voltage resolution
2019-09-07 17:08:15 -05:00
aetilius
cfe8ccc6ad
Correct data type for voltage resolution 2019-09-07 13:20:13 -07:00
Miguel Angel Califa Urquiza
a9aba676e2
Update README.md 2019-09-02 20:00:44 -05:00
205 changed files with 3593 additions and 115248 deletions

51
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,51 @@
# Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
## Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] I have updated the version in `library.properties` to reflect my changes (advance by 0.01 for minor changes, or a whole number for new features)
- [ ] I have submitted the pull request
# How Has This Been Tested?
Please describe the examples that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
- [ ] MQ-3
- [ ] MQ-4
- [ ] MQ-5
- [ ] MQ-6
- [ ] MQ-7
- [ ] MQ-8
- [ ] MQ-9
- [ ] MQ-131
- [ ] MQ-135
- [ ] MQ-303
- [ ] MQ-309
- [ ] ESP8266
- [ ] ESP-32
**Test Configuration**:
* Board:
* Software (Version of your arduino):
* Result (Good - Medium - Bad):
* Your Comments:
# Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

View File

@ -20,3 +20,7 @@ Pull request will be check by three main authors who are linked in
[REAMDE.md](https://github.com/miguel5612/MQSensorsLib/README.md) and they determine to merge to
master branch. Later than assessment and debbuging procedures was completed, the contribution
will be released.
## Versioning
When making a pull request, please remember to update the `library.properties` file to reflect the changes you've made. If your change is minor, consider advancing the version by 0.01. If you're adding a new feature, you may want to advance the version by a whole number.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +0,0 @@
{
"cells": [],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 2
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 46 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 56 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 56 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 68 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 51 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 53 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 48 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 71 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 80 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 43 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 49 KiB

212
README.md
View File

@ -1,40 +1,143 @@
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3384299.svg)](https://doi.org/10.5281/zenodo.3384299)
![Build Status](https://travis-ci.org/dwyl/esta.svg?branch=master)
<!-- PROJECT SHIELDS -->
<!--
*** I'm using markdown "reference style" links for readability.
*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
*** See the bottom of this document for the declaration of the reference variables
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
-->
[![DOI](https://zenodo.org/badge/170540207.svg)](https://zenodo.org/badge/latestdoi/170540207)
![Build Status][build-url]
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
# MQSensorsLib
This is a unified library to use sensors MQ: 2, 3, 4, 5, 6, 7, 8, 9, 131, 135, 303A and 309A.
We present a unified library for MQ sensors, this library allows to read MQ signals easily from Arduino, Genuino, ESP8266, ESP-32 boards whose references are MQ2, MQ3, MQ4, MQ5, MQ6, MQ7, MQ8, MQ9, MQ131, MQ135, MQ303A, MQ309A.
<!-- TABLE OF CONTENTS -->
## Table of Contents
* [Getting Started](#Getting-Started)
* [Wiring](#Wiring)
* [Sensor](#Sensor)
* [Arduino](#Arduino)
* [ESP8266 or ESP-32](#ESP8266-ESP32)
* [User Manual](#Manuals)
* [Sensor manufacturers](#Sensor-manufacturers)
* [Contributing](#Contributing)
* [Authors](#Authors)
* [Be a sponsor 💖](#Sponsor)
## Getting Started
```
MQUnifiedsensor MQ4(pin, 4); //Example if sensor is MQ4, type = 4
//Include the library
#include <MQUnifiedsensor.h>
/************************Hardware Related Macros************************************/
#define Board ("Arduino UNO")
#define Pin (A4) //Analog input 4 of your arduino
/***********************Software Related Macros************************************/
#define Type ("MQ-4") //MQ4
#define Voltage_Resolution (5)
#define ADC_Bit_Resolution (10) // For arduino UNO/MEGA/NANO
#define RatioMQ4CleanAir (4.4) //RS / R0 = 60 ppm
/*****************************Globals***********************************************/
//Declare Sensor
MQUnifiedsensor MQ4(Board, Voltage_Resolution, ADC_Bit_Resolution, Pin, Type);
// Setup
MQ4.setRegressionMethod("Exponential"); //_PPM = a*ratio^b
MQ4.setA(1012.7); MQ4.setB(-2.786); // Configure the equation to to calculate CH4 concentration
MQ4.setR0(3.86018237); // Value getted on calibration
// Loop
MQ4.init();
MQ4.update();
float ppmCH4 = MQ4.readSensor();
```
## Wiring
### Sensor
#### Important points:
##### Points you should identify
* VCC -> 5V Power supply (+) wire
* GND -> GND Ground (-) wire
* AO -> Analog Output of the sensor
##### Data of board that you should have
* RL Value in KOhms
##### Graph
![Wiring_MQSensor](https://raw.githubusercontent.com/miguel5612/MQSensorsLib_Docs/master/static/img/Points_explanation.jpeg)
#### RS/R0 value (From datasheet of your sensor)
* RS/R0 (Clean air - English) -> (Aire puro - Spanish)
* **Note**: RS/R0 is equal to Ratio variable on the program
![Graph from datasheet](https://raw.githubusercontent.com/miguel5612/MQSensorsLib_Docs/master/static/img/Graph_Explanation.jpeg)
### Arduino
![Arduino_Wiring_MQSensor](https://raw.githubusercontent.com/miguel5612/MQSensorsLib_Docs/master/static/img/MQ_Arduino.PNG)
#### MQ-7 / MQ-309A
** Note ** [issue](https://github.com/miguel5612/MQSensorsLib/issues/26): MQ-7 and MQ-309 needs two different voltages for heater, they can be supplied by PWM and DC Signal controlled by your controller, another option is to use two different power sources, you should use the best option for you, next i will show the PWM option and on the examples this will be the way .
![MQ-7_MQ-309](https://raw.githubusercontent.com/miguel5612/MQSensorsLib_Docs/master/static/img/MQ-309_MQ-7.PNG)
### ESP8266-ESP32
![ESP8266_Wiring_MQSensor](https://raw.githubusercontent.com/miguel5612/MQSensorsLib_Docs/master/static/img/MQ_ESP8266.PNG)
### ESP32 WROOM 32D
The ESP32 WROOM 32D does not need an external power supply. A0 goes to PIN36, Vcc to 3v3 and GND to any GND port on the board. Check the **ESP2/ESP32_WROOM_32** folder to fixing the measuring issue when connecting to wifi.
### Manuals
#### User Manual (v1.0) 12.2019
[Manual](https://drive.google.com/open?id=1BAFInlvqKR7h81zETtjz4_RC2EssvFWX)
#### User Manual (v2.0) 04.2020
[Manual](https://github.com/miguel5612/MQSensorsLib_Docs/blob/master/Docs/MQSensorLib_2.0.pdf)
### Serial debug (optional)
If your sensor is an **MQ2** (Same for others sensors):
* To enable on setup wrote
```
MQ2.serialDebug(true);
```
* And on Loop Wrote
```
MQ2.serialDebug();
```
* Result:
![Serial debug output](https://github.com/miguel5612/MQSensorsLib_Docs/blob/master/static/img/Serial_Mon_Explanation.jpeg?raw=true)
**Note**:
* ![#c5f015](https://placehold.it/15/c5f015/000000?text=+) `Yellow -> Calibration status.`
* ![#008000](https://placehold.it/15/008000/000000?text=+) `Green -> Hardware and software characteristics.`
* ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) `Red -> Headers of the library calculations.`
* Only valid for **1** gas sensor readings.
**Usage**
* Quick troubleshooting, since it shows everything the library does and the results of the calculations in each function.
### Prerequisites
You'll need Arduino desktop app 1.8.9 or later.
### Sensor manufacture:
### Sensor manufacturers:
| Sensor | Manufacture | URL Datasheet |
|----------|----------|----------|
| MQ-2 | Pololulu| [datasheet](https://www.pololu.com/file/0J309/MQ2.pdf) |
| MQ-3 | Sparkfun | [datasheet](https://www.sparkfun.com/datasheets/Sensors/MQ-3.pdf) |
| MQ-4 | Sparkfun | [datasheet](https://www.sparkfun.com/datasheets/Sensors/Biometric/MQ-4.pdf) |
| MQ-5 | parallax | [datasheet](https://www.parallax.com/sites/default/files/downloads/605-00009-MQ-5-Datasheet.pdf) |
| MQ-6 | Sparkfun | [datasheet](https://www.sparkfun.com/datasheets/Sensors/Biometric/MQ-6.pdf) |
| MQ-7 | Sparkfun | [datasheet](https://www.sparkfun.com/datasheets/Sensors/Biometric/MQ-7.pdf) |
| MQ-8 | Sparkfun | [datasheet](https://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Biometric/MQ-8.pdf) |
| MQ-9 | Haoyuelectronics | [datasheet](http://www.haoyuelectronics.com/Attachment/MQ-9/MQ9.pdf) |
| MQ-131 | Sensorsportal | [datasheet](http://www.sensorsportal.com/DOWNLOADS/MQ131.pdf) |
| MQ-2 | HANWEI Electronics| [datasheet](https://www.pololu.com/file/0J309/MQ2.pdf) |
| MQ-3 | HANWEI Electronics | [datasheet](https://www.sparkfun.com/datasheets/Sensors/MQ-3.pdf) |
| MQ-4 | HANWEI Electronics | [datasheet](https://www.sparkfun.com/datasheets/Sensors/Biometric/MQ-4.pdf) |
| MQ-5 | HANWEI Electronics | [datasheet](https://www.parallax.com/sites/default/files/downloads/605-00009-MQ-5-Datasheet.pdf) |
| MQ-6 | HANWEI Electronics | [datasheet](https://www.sparkfun.com/datasheets/Sensors/Biometric/MQ-6.pdf) |
| MQ-7 | HANWEI Electronics | [datasheet](https://www.sparkfun.com/datasheets/Sensors/Biometric/MQ-7.pdf) |
| MQ-8 | HANWEI Electronics | [datasheet](https://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Biometric/MQ-8.pdf) |
| MQ-9 | HANWEI Electronics | [datasheet](http://www.haoyuelectronics.com/Attachment/MQ-9/MQ9.pdf) |
| MQ-131 | HANWEI Electronics | [datasheet](http://www.sensorsportal.com/DOWNLOADS/MQ131.pdf) |
| MQ-135 | HANWEI Electronics | [datasheet](https://www.electronicoscaldas.com/datasheet/MQ-135_Hanwei.pdf) |
| MQ-136 | HANWEI Electronics | [datasheet](https://github.com/miguel5612/MQSensorsLib_Docs/blob/master/Datasheets/MQ136%20-%20Hanwei.pdf) |
| MQ-303A | HANWEI Electronics | [datasheet](http://www.kosmodrom.com.ua/pdf/MQ303A.pdf) |
| MQ-309A | HANWEI Electronics | [datasheet](http://www.sensorica.ru/pdf/MQ-309A.pdf) |
### Info of datasheets
Review WPDigitalizer [folder](https://github.com/miguel5612/MQSensorsLib/tree/master/WPDigitalizer) [website](https://automeris.io/WebPlotDigitizer/)
Review WPDigitalizer [folder](https://github.com/miguel5612/MQSensorsLib_Docs/tree/master/WPDigitalizer) [website](https://automeris.io/WebPlotDigitizer/)
### Installing
@ -67,12 +170,16 @@ Examples/MQ-board.ino
## Built With
* [Data sheets](https://github.com/miguel5612/MQSensorsLib/tree/master/Datasheets) - Curves and behavior for each sensor, using logarithmic graphs.
* [Main purpose](https://github.com/miguel5612/MQSensorsLib/blob/master/static/img/bg.jpg) - Every sensor has high sensibility for a specific gas or material.
* [Data sheets](https://github.com/miguel5612/MQSensorsLib_Docs/tree/master/Datasheets) - Curves and behavior for each sensor, using logarithmic graphs.
* [Main purpose](https://github.com/miguel5612/MQSensorsLib_Docs/blob/master/static/img/bg.jpg) - Every sensor has high sensibility for a specific gas or material.
## Contributing
Please read [CONTRIBUTING.md](https://github.com/miguel5612/MQSensorsLib/blob/NO_Functional/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
Please read [CONTRIBUTING.md](https://github.com/miguel5612/MQSensorsLib/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Reviewers
* **PhD. Jacipt A Ramón V.** - [*GitHub*]() - [CV](https://scienti.minciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0000512702)
## Authors
@ -82,8 +189,8 @@ Please read [CONTRIBUTING.md](https://github.com/miguel5612/MQSensorsLib/blob/NO
## Collaborators
* **Andres A. Martinez.**
* **Juan A. Rodríguez.** - [*Github*](https://github.com/Obiot24)
* **Andres A. Martinez.** - [*Github*](https://github.com/andresmacsi) - [CV](https://www.linkedin.com/in/andr%C3%A9s-acevedo-mart%C3%ADnez-73ab35185/?originalSubdomain=co)
* **Juan A. Rodríguez.** - [*Github*](https://github.com/Obiot24) - [CV]()
* **Mario A. Rodríguez O.** - [*GitHub*](https://github.com/MarioAndresR) - [CV](https://scienti.colciencias.gov.co/cvlac/visualizador/generarCurriculoCv.do?cod_rh=0000111304)
See also the list of [contributors](https://github.com/miguel5612/MQSensorsLib/contributors) who participated in this project.
@ -94,14 +201,67 @@ This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md
## Cite as
* Plain text: Miguel Angel Califa Urquiza. (2019, September 3). Ghiordy/MQSensorsLib: Arduino Preview V1.0.3 (Version 1.0.3). Zenodo. http://doi.org/10.5281/zenodo.3384299
* Plain text: Califa Urquiza, Miguel Angel, Contreras Contreras, Ghiordy, & Carrillo Amado, Yerson Ramiro. (2019, September 3). miguel5612/MQSensorsLib: Arduino Preview V1.03 (Version 1.0.3). Zenodo. http://doi.org/10.5281/zenodo.3384301
* CSL: {
"publisher": "Zenodo",
"DOI": "10.5281/zenodo.3384301",
"title": "miguel5612/MQSensorsLib: Arduino Preview V1.03",
"issued": {
"date-parts": [
[
2019,
9,
3
]
]
},
"abstract": "<p>Publishing on Zenodo platform as software in order to extend its applications for other works allowing to recognize MQSensorLib&#39;s Authors this work into scientific community using Digital Object Identifier System (DOI).</p>",
"author": [
{
"family": "Califa Urquiza, Miguel Angel"
},
{
"family": "Contreras Contreras, Ghiordy"
},
{
"family": "Carrillo Amado, Yerson Ramiro"
}
],
"version": "1.0.3",
"type": "article",
"id": "3384301"
}
* BibTeX:
@misc{miguel_angel_califa_urquiza_2019_3384299,
author = {Miguel Angel Califa Urquiza},
title = {Ghiordy/MQSensorsLib: Arduino Preview V1.0.3},
@misc{califa_urquiza_miguel_angel_2019_3384301,
author = {Califa Urquiza, Miguel Angel and
Contreras Contreras, Ghiordy and
Carrillo Amado, Yerson Ramiro},
title = {miguel5612/MQSensorsLib: Arduino Preview V1.03},
month = sep,
year = 2019,
doi = {10.5281/zenodo.3384299},
url = {https://doi.org/10.5281/zenodo.3384299}
doi = {10.5281/zenodo.3384301},
url = {https://doi.org/10.5281/zenodo.3384301}
}
## Sponsor
* [Paypal](https://www.paypal.com/paypalme/miguel5612)
<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
[contributors-shield]: https://img.shields.io/github/contributors/miguel5612/MQSensorsLib.svg?style=flat-square
[contributors-url]: https://github.com/miguel5612/MQSensorsLib/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/miguel5612/MQSensorsLib.svg?style=flat-square
[forks-url]: https://github.com/miguel5612/MQSensorsLib/network/members
[stars-shield]: https://img.shields.io/github/stars/miguel5612/MQSensorsLib.svg?style=flat-square
[stars-url]: https://github.com/miguel5612/MQSensorsLib/stargazers
[issues-shield]: https://img.shields.io/github/issues/miguel5612/MQSensorsLib.svg?style=flat-square
[issues-url]: https://github.com/miguel5612/MQSensorsLib/issues
[license-shield]: https://img.shields.io/github/license/miguel5612/MQSensorsLib.svg?style=flat-square
[license-url]: https://github.com/miguel5612/MQSensorsLib/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
[build-url]: https://travis-ci.org/dwyl/esta.svg?branch=master
[linkedin-url]: https://www.linkedin.com/in/miguel5612
[product-screenshot]: images/screenshot.png

View File

@ -1,5 +0,0 @@
4.957713628975931; 5.970352865838375
9.82303087255475; 3.890451449942809
19.66936860744601; 2.365919697485761
49.50200098710442; 0.9908319448927686
99.17887133636847; 0.49659232145033677
1 4.957713628975931 5.970352865838375
2 9.82303087255475 3.890451449942809
3 19.66936860744601 2.365919697485761
4 49.50200098710442 0.9908319448927686
5 99.17887133636847 0.49659232145033677

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

View File

@ -1,5 +0,0 @@
5.004690736196025; 8.090958991783829
9.81247228520288; 5.571857489319305
19.63847609606165; 3.9994474976109777
49.85956704514034; 2.8313919957993816
98.7613064604988; 2.032357010936224
1 5.004690736196025 8.090958991783829
2 9.81247228520288 5.571857489319305
3 19.63847609606165 3.9994474976109777
4 49.85956704514034 2.8313919957993816
5 98.7613064604988 2.032357010936224

View File

@ -1,5 +0,0 @@
5.015052099488824; 4.055085354483843
9.839297042431014; 2.2387211385683425
19.708460197689764; 1.2189895989248674
50.120105449151986; 0.49659232145033727
99.34721307419954; 0.2818382931264458
1 5.015052099488824 4.055085354483843
2 9.839297042431014 2.2387211385683425
3 19.708460197689764 1.2189895989248674
4 50.120105449151986 0.49659232145033727
5 99.34721307419954 0.2818382931264458

View File

@ -1,3 +0,0 @@
10.038068731719024; 1.4367778871086752
100.76282386271518; 0.7437057711666111
199.67791490816478; 0.5858066785834567
1 10.038068731719024 1.4367778871086752
2 100.76282386271518 0.7437057711666111
3 199.67791490816478 0.5858066785834567

View File

@ -1,3 +0,0 @@
10; 1.8980643862295867
100.76282386271518; 0.9276207214357883
199.67791490816478; 0.7371610501169261
1 10 1.8980643862295867
2 100.76282386271518 0.9276207214357883
3 199.67791490816478 0.7371610501169261

View File

@ -1,3 +0,0 @@
9.92429510870452; 2.850325339883499
100.76282386271518; 1.5488850711364055
199.67791490816478; 1.3446177759671738
1 9.92429510870452 2.850325339883499
2 100.76282386271518 1.5488850711364055
3 199.67791490816478 1.3446177759671738

View File

@ -1,3 +0,0 @@
10; 2.3054935712377356
100.76282386271518; 1.049816136090719
198.16625542394166; 0.8052859018667691
1 10 2.3054935712377356
2 100.76282386271518 1.049816136090719
3 198.16625542394166 0.8052859018667691

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 KiB

View File

@ -1,3 +0,0 @@
10; 2.563475521052897
100.38068731719024; 1
199.67791490816478; 0.7670732751979543
1 10 2.563475521052897
2 100.38068731719024 1
3 199.67791490816478 0.7670732751979543

View File

@ -1,3 +0,0 @@
10; 1.5420548019516276
100.38068731719024; 0.8017347542813508
199.67791490816478; 0.6427786162225773
1 10 1.5420548019516276
2 100.38068731719024 0.8017347542813508
3 199.67791490816478 0.6427786162225773

View File

@ -1,9 +0,0 @@
202,97159045689085; 2,870821251841819
493,62843297110385; 2,120486081991352
789,3018264543583; 1,722949305824931
1013,5564768245204; 1,628558370192401
1483,4109724050659; 1,4241031945513674
2002,568136043121; 1,2616407836292618
3045,8553406742876; 1,09372808300933
4983,9913111605565; 0,8886628824162796
10116,086432495827; 0,6593474448589979
1 202 97159045689085; 2 870821251841819
2 493 62843297110385; 2 120486081991352
3 789 3018264543583; 1 722949305824931
4 1013 5564768245204; 1 628558370192401
5 1483 4109724050659; 1 4241031945513674
6 2002 568136043121; 1 2616407836292618
7 3045 8553406742876; 1 09372808300933
8 4983 9913111605565; 0 8886628824162796
9 10116 086432495827; 0 6593474448589979

View File

@ -1,9 +0,0 @@
200,6424043638923; 3,0628594206904824
493,62843297110385; 2,262307524341795
795,3985507023424; 1,9027463399615197
1021,3853885815306; 1,760109364516406
1466,3881949840988; 1,512822440016997
2010,2873757128875; 1,3635579819828156
3022,508881097584; 1,1618613226754184
4945,78905312065; 0,9359079659557669
10155,080609166793; 0,7034431020028873
1 200 6424043638923; 3 0628594206904824
2 493 62843297110385; 2 262307524341795
3 795 3985507023424; 1 9027463399615197
4 1021 3853885815306; 1 760109364516406
5 1466 3881949840988; 1 512822440016997
6 2010 2873757128875; 1 3635579819828156
7 3022 508881097584; 1 1618613226754184
8 4945 78905312065; 0 9359079659557669
9 10155 080609166793; 0 7034431020028873

View File

@ -1,9 +0,0 @@
202,97159045689085; 5,230578600305607
491,73296457790207; 4,06886745979215
810,8471866516105; 3,4816976949280916
994,2457296427418; 3,220835982615804
1483,4109724050659; 2,8043001628397395
2025,8152351174235; 2,505895099093425
3045,8553406742876; 2,2293985477843727
4983,9913111605565; 1,84294785992263
10272,967317129345; 1,4525325413623644
1 202 97159045689085; 5 230578600305607
2 491 73296457790207; 4 06886745979215
3 810 8471866516105; 3 4816976949280916
4 994 2457296427418; 3 220835982615804
5 1483 4109724050659; 2 8043001628397395
6 2025 8152351174235; 2 505895099093425
7 3045 8553406742876; 2 2293985477843727
8 4983 9913111605565; 1 84294785992263
9 10272 967317129345; 1 4525325413623644

Some files were not shown because too many files have changed in this diff Show More