{"id":4651,"date":"2025-12-31T09:30:36","date_gmt":"2025-12-31T17:30:36","guid":{"rendered":"https:\/\/www.donluc.com\/?p=4651"},"modified":"2025-12-31T09:30:36","modified_gmt":"2025-12-31T17:30:36","slug":"project-28-sensors-mq-135-gas-sensor-mk22","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=4651","title":{"rendered":"Project #28 \u2013 Sensors \u2013 MQ-135 Gas Sensor \u2013 Mk22"},"content":{"rendered":"<div style=\"width: 1200px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-4651-1\" width=\"1200\" height=\"675\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #MQ135  #ArduinoUNOR4 #Display #IoT #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05a.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05a.jpg\" alt=\"MQ-135 Gas Sensor\n\" width=\"720\" height=\"602\" class=\"alignnone size-full wp-image-4653\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05a.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05a-300x251.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05b.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05b.jpg\" alt=\"MQ-135 Gas Sensor\n\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4654\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05b.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05b-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05c.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05c.jpg\" alt=\"MQ-135 Gas Sensor\n\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-4655\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05c.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2025\/12\/DL2512Mk05c-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>MQ-135 Gas Sensor<\/strong><\/p>\n<p>The gas sensing material used in the MQ135 gas sensor is tin dioxide (SnO2), which has low conductivity in clean air. When there is polluted gas in the environment where the sensor is located, the conductivity of the sensor increases with the increase of the concentration of polluted gas in the air. The MQ135 gas sensor has a high sensitivity to ammonia, sulfide, and benzene-based vapors, and is ideal for monitoring smoke and other harmful gases. This sensor can detect a variety of harmful gases and is a low-cost sensor suitable for a variety of applications.<\/p>\n<p><strong>DL2512Mk05<\/strong><\/p>\n<p>1 x Arduino UNO R4 WiFi<br \/>\n1 x Adafruit SHARP Memory Display Breakout &#8211; 1.3&#8243; 168&#215;144 Monochrome<br \/>\n1 x  MQ-135 Gas Sensor<br \/>\n1 x USB Battery Pack<br \/>\n1 x USB 3.0 to Type-C Cable<\/p>\n<p><strong>DL2512Mk05p<\/strong><\/p>\n<p><strong>DL2512Mk05p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/****** Don Luc Electronics \u00a9 ******\r\nSoftware Version Information\r\nProject #28 \u2013 Sensors \u2013 MQ-135 Gas Sensor \u2013 Mk22\r\n28-22\r\nDL2512Mk05p.ino\r\nDL2512Mk05\r\n1 x Arduino UNO R4 WiFi\r\n1 x Adafruit SHARP Memory Display Breakout - 1.3&quot; 168x144 Monochrome\r\n1 x MQ-135 Gas Sensor\r\n1 x USB Battery Pack\r\n1 x USB 3.0 to Type-C Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ MQ-135 Unified\r\n#include &lt;MQUnifiedsensor.h&gt;\r\n\/\/ SHARP Memory Display\r\n#include &lt;Adafruit_SharpMem.h&gt;\r\n#include &lt;Adafruit_GFX.h&gt;\r\n\r\n\/\/ MQ-135 Unified\r\n#define placa &quot;Arduino UNO R4 WiFi&quot;\r\n#define Voltage_Resolution 5\r\n#define pin A0              \r\n#define type &quot;MQ-135&quot;        \r\n#define ADC_Bit_Resolution 10  \r\n#define RatioMQ135CleanAir 3.6  \r\nMQUnifiedsensor MQ135(placa, Voltage_Resolution, ADC_Bit_Resolution, pin, type);\r\nfloat fV;\r\nfloat fPPM;\r\n \r\n\/\/ SHARP Memory Display\r\n\/\/ any pins can be used\r\n#define SHARP_SCK  13\r\n#define SHARP_MOSI 11\r\n#define SHARP_SS   10\r\n\/\/ Set the size of the display here, e.g. 144x168!\r\nAdafruit_SharpMem display(SHARP_SCK, SHARP_MOSI, SHARP_SS, 144, 168);\r\n\/\/ The currently-available SHARP Memory Display (144x168 pixels)\r\n\/\/ requires &gt; 4K of microcontroller RAM; it WILL NOT WORK on Arduino Uno\r\n\/\/ or other &lt;4K &quot;classic&quot; devices!  The original display (96x96 pixels)\r\n\/\/ does work there, but is no longer produced.\r\n#define BLACK 0\r\n#define WHITE 1\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;28-22&quot;;\r\n\r\nvoid loop() {\r\n  \r\n  \/\/ MQ135\r\n  isMQ135();\r\n\r\n  \/\/ isDisplayMQ135\r\n  isDisplayMQ135();\r\n\r\n  \/\/ Delay\r\n  delay( 1000 );\r\n  \r\n}\r\n<\/pre>\n<p><strong>getDisplay.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Adafruit SHARP Memory Display\r\n\/\/ Adafruit SHARP Memory Display - UID\r\nvoid isDisplayUID(){\r\n\r\n  \/\/ text display\r\n  display.setRotation(4);\r\n  display.setTextSize(3);\r\n  display.setTextColor(BLACK);\r\n  display.setCursor(0,2);\r\n  display.println( &quot;Don Luc&quot; );\r\n  \/\/display.setTextSize(2);\r\n  display.setTextColor(BLACK);\r\n  display.setCursor(0,35);\r\n  display.println( sver );\r\n  display.refresh();\r\n  delay( 100 );\r\n\r\n}\r\n\/\/ isDisplayMQ135\r\nvoid isDisplayMQ135(){\r\n\r\n  \/\/ text display MQ135\r\n  display.clearDisplay();\r\n  display.setRotation(4);\r\n  display.setTextSize(3);\r\n  display.setTextColor(BLACK);\r\n  display.setCursor(0,0);\r\n  display.println( &quot;MQ135&quot; );\r\n  display.setCursor(0,35);\r\n  display.println( &quot;Volt&quot; );\r\n  display.setCursor(0,65);\r\n  display.println( fV );\r\n  display.setCursor(0,95);\r\n  display.println( &quot;PPM&quot; );\r\n  display.setCursor(0,125);\r\n  display.print( fPPM );\r\n  display.refresh();\r\n  delay( 100 );\r\n  \r\n}\r\n<\/pre>\n<p><strong>getMQ135.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ MQ-135 Unified\r\n\/\/ is MQ135\r\nvoid isMQ135(){\r\n\r\n  \/\/ MQ-135 Unified Analog\r\n  MQ135.update();\r\n  \/\/ Volt\r\n  fV = MQ135.getVoltage();\r\n  \/\/ PPM\r\n  fPPM = MQ135.readSensor() + 400;\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n \r\n  \/\/ Delay\r\n  delay( 100 );\r\n  \/\/ Delay\r\n  delay( 100 );\r\n  \r\n  \/\/ SHARP Display start &amp; clear the display\r\n  display.begin();\r\n  display.clearDisplay();\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ MQ-135 Unified\r\n  \/\/ PPM =  a*ratio^b\r\n  MQ135.setRegressionMethod(1);\r\n  MQ135.setA(110.47);\r\n  MQ135.setB(-2.862);\r\n  MQ135.init();\r\n\r\n  \/\/Calibraci\u00f3n\r\n  float calcR0 = 0;\r\n  for (int i = 1; i &lt;= 10; i++) {\r\n    \r\n    \/\/ Analog\r\n    MQ135.update();\r\n    calcR0 += MQ135.calibrate(RatioMQ135CleanAir);\r\n\r\n  }\r\n  \r\n  MQ135.setR0(calcR0 \/ 10);\r\n  \r\n  \/\/ Delay 2 Second\r\n  delay( 2000 );\r\n\r\n  \/\/ Don Luc Electronics\r\n  \/\/ Version\r\n  isDisplayUID();\r\n\r\n  \/\/ Delay 5 Second\r\n  delay( 5000 );\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Consultant, R&#038;D, Electronics, IoT, Teacher and Instructor<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Automation<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank , Underwater and UAV Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial,  Marine and UAV<\/li>\n<li>Machine Learning<\/li>\n<li>Artificial Intelligence (AI)<\/li>\n<li>RTOS<\/li>\n<li>Sensors, eHealth Sensors, Biosensor, and Biometric<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<li>Consulting<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2026<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.jlpconsultants.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/@thesass2063<br \/>\n<strong>DFRobot:<\/strong> https:\/\/learn.dfrobot.com\/user-10186.html<br \/>\n<strong>Elecrow:<\/strong> https:\/\/www.elecrow.com\/share\/sharepj\/center\/no\/760816d385ebb1edc0732fd873bfbf13<br \/>\n<strong>TikTok:<\/strong> https:\/\/www.tiktok.com\/@luc.paquin8<br \/>\n<strong>Hackster:<\/strong> https:\/\/www.hackster.io\/luc-paquin<br \/>\n<strong>LinkedIn:<\/strong> https:\/\/www.linkedin.com\/in\/jlucpaquin\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #MQ135 #ArduinoUNOR4 #Display #IoT #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; MQ-135 Gas Sensor The gas sensing material used in the MQ135 gas sensor is tin dioxide (SnO2), which has low conductivity in clean air. When there is polluted gas in the environment where the sensor is located, the &#8230; <a title=\"Project #28 \u2013 Sensors \u2013 MQ-135 Gas Sensor \u2013 Mk22\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=4651\" aria-label=\"Read more about Project #28 \u2013 Sensors \u2013 MQ-135 Gas Sensor \u2013 Mk22\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[294,47,397,50,49,38,59,115,5,287,58,10,408],"tags":[6,92,102,4,87,19,85,24,409,9,27,248,33,410,34,108],"class_list":["post-4651","post","type-post","status-publish","format-standard","hentry","category-sensors","category-adafruit","category-arduino-digitalelectronics","category-arduino","category-consultant","category-digitalelectronics","category-fritzing","category-e-mentor","category-microcontrollers","category-program","category-arduino-programming","category-projects","category-tecneu","tag-arduino","tag-battery","tag-components","tag-consultant","tag-display","tag-electronics","tag-fritzing","tag-microcontroller","tag-mq-135-gas-sensor","tag-programming","tag-projects-2","tag-sensors","tag-technology","tag-tecneu","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4651"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4651\/revisions"}],"predecessor-version":[{"id":4656,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/4651\/revisions\/4656"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}