{"id":2054,"date":"2019-04-13T13:00:14","date_gmt":"2019-04-13T12:00:14","guid":{"rendered":"https:\/\/chewett.co.uk\/blog\/?p=2054"},"modified":"2019-04-14T23:56:40","modified_gmt":"2019-04-14T22:56:40","slug":"mq-135-air-quality-and-hazardous-gas-sensor-for-arduino-review-and-code","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/2054\/mq-135-air-quality-and-hazardous-gas-sensor-for-arduino-review-and-code\/","title":{"rendered":"MQ-135 Air Quality and Hazardous Gas Sensor For Arduino Review and Code"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"254\" data-attachment-id=\"2062\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2054\/mq-135-air-quality-and-hazardous-gas-sensor-for-arduino-review-and-code\/mq135_gas_sensor\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/mq135_gas_sensor.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"mq135_gas_sensor\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/mq135_gas_sensor.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/mq135_gas_sensor.jpg?fit=678%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/mq135_gas_sensor.jpg?resize=678%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-2062\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/mq135_gas_sensor.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/mq135_gas_sensor.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/mq135_gas_sensor.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/mq135_gas_sensor.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>This post talks about using the MQ-135 Air Quality and Hazardous Gas sensor with an Arduino. <\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">MQ-135 Air Quality and Hazardous Gas Sensor<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignleft is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2057\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2054\/mq-135-air-quality-and-hazardous-gas-sensor-for-arduino-review-and-code\/mq-135-sensor-air-quality-sensor-hazardous-gas-detection-module-for-arduino_mainimage\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_mainimage.jpg?fit=800%2C800&amp;ssl=1\" data-orig-size=\"800,800\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"MQ-135 Sensor Air Quality Sensor Hazardous Gas Detection Module for Arduino_mainimage\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_mainimage.jpg?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_mainimage.jpg?fit=678%2C678&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_mainimage.jpg?resize=331%2C331&#038;ssl=1\" alt=\"\" class=\"wp-image-2057\" width=\"331\" height=\"331\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_mainimage.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_mainimage.jpg?resize=300%2C300&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_mainimage.jpg?resize=768%2C768&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_mainimage.jpg?resize=50%2C50&amp;ssl=1 50w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_mainimage.jpg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_mainimage.jpg?resize=200%2C200&amp;ssl=1 200w\" sizes=\"auto, (max-width: 331px) 100vw, 331px\" \/><\/figure><\/div>\n\n\n\n<p>The MQ-135 air quality and hazadous gas sensor is a small unit that reports the relative quality of the air.<\/p>\n\n\n\n<p>This specific variant works particularly well with detecting carbon dioxide,<br>benzene, alcohol, and smoke in the air.<\/p>\n\n\n\n<p>These gasses are typically used as a measure of air quality. This is why this sensor is typically sold as a &#8220;Air quality and hazardous gas sensor&#8221;.<\/p>\n\n\n\n<p>The analogue pin will output a relative value according to the amount of particulates in the air.<\/p>\n\n\n\n<p>Without calibration it is not possible to relate this to a specific concentration (in parts per million) but works well as a relative measure.<\/p>\n\n\n\n<p>When using this in an area you will be able to detect if the air quality is getting better or worse by the trend in values reported.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wiring it up to an Arduino<\/h2>\n\n\n\n<p>This MQ-135 sensor has two pins which can be used to read the value of the sensor. The first is a basic analogue pin which will return a value between 0 and 5 volts.<\/p>\n\n\n\n<p>This voltage represents a relative range of high to low gas concentration. The lower the voltage the lower the amount of gas detected.<\/p>\n\n\n\n<p>On the underside of the sensor a potentiometer allows configuring of the digital pin. The digital pin will be brought high once a specific level of gas is detected. This level is set by the potentiometer on the back.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"196\" data-attachment-id=\"2155\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2054\/mq-135-air-quality-and-hazardous-gas-sensor-for-arduino-review-and-code\/mq-135-wiring_diagram\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/MQ-135-wiring_diagram.jpg?fit=864%2C250&amp;ssl=1\" data-orig-size=\"864,250\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"MQ-135 wiring_diagram\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/MQ-135-wiring_diagram.jpg?fit=300%2C87&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/MQ-135-wiring_diagram.jpg?fit=678%2C196&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/MQ-135-wiring_diagram.jpg?resize=678%2C196&#038;ssl=1\" alt=\"\" class=\"wp-image-2155\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/MQ-135-wiring_diagram.jpg?w=864&amp;ssl=1 864w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/MQ-135-wiring_diagram.jpg?resize=300%2C87&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/MQ-135-wiring_diagram.jpg?resize=768%2C222&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/04\/MQ-135-wiring_diagram.jpg?resize=50%2C14&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><figcaption><br><\/figcaption><\/figure>\n\n\n\n<p>The VCC pin must be connected to the 5 volt pin on the Arduino. The GND pin must similarly be connected to the Ground pin on the Arduino.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Programming the Arduino with the  <br>MQ-135 Air Quality and Hazardous Gas Sensor <\/h2>\n\n\n\n<p>In this post I am using the analogue pin to read the relatively value of the sensor.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#define ANALOG_IN_PIN 0\nint sensorVal = 0;\n\nvoid setup() {\n  Serial.begin(115200);\n}\n\nvoid loop() {\n  sensorVal = analogRead(ANALOG_IN_PIN);\n  Serial.println(sensorVal);\n  delay(2000);\n}\n<\/pre><\/div>\n\n\n<p>Here the serial out is  initialized in the setup. In the loop method the sensor is continually read from <code>ANALOG_IN_PIN<\/code>, and sent on the serial line.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Final Review<\/h2>\n\n\n\n<p>This is a simple air quality sensor which can be used to calculate the quality of the air. It is typically used to compare the relatively air quality in an area over time.<\/p>\n\n\n\n<p>With some work it can be calibrated to give a more specific value in parts per million but this was not done here.<\/p>\n\n\n\n<p>Providing both an analogue and digital pin to read the output gives various options to its use. This is especially useful in smaller IoT projects where pins are at a premium.<\/p>\n\n\n\n<p>Since this is a small and useful sensor I would definitely look at using this in a project again.<\/p>\n\n\n\n<p><strong>Would buy again!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post talks about using the MQ-135 Air Quality and Hazardous Gas sensor with an Arduino.<\/p>\n","protected":false},"author":1,"featured_media":2058,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Today I talk about the #MQ135 Air Quality and Hazardous Gas #Sensor For #Arduino #Review and #Code","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[97],"tags":[132,131,333,343,152],"class_list":["post-2054","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electronics","tag-arduino","tag-arduino-sensor","tag-gas-sensor","tag-mq-135","tag-sensor"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/MQ-135-Sensor-Air-Quality-Sensor-Hazardous-Gas-Detection-Module-for-Arduino_posticon.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-x8","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":745,"url":"https:\/\/chewett.co.uk\/blog\/745\/ds18b20-onewire-temperature-sensor\/","url_meta":{"origin":2054,"position":0},"title":"DS18B20 onewire temperature sensor","author":"Chewett","date":"November 15, 2017","format":false,"excerpt":"The DS18B20 temperature sensor is a digital temperature sensor using the 1-Wire protocol. In this post I will review the sensor, show how it can be used and give a final judgement on it. What can the DS18B20 temperature sensor do? The DSB18B20 temperature sensor is a digital temperature sensor\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1380,"url":"https:\/\/chewett.co.uk\/blog\/1380\/displaying-temperature-sensor-data-on-a-liquid-crystal-display-with-arduino\/","url_meta":{"origin":2054,"position":1},"title":"Displaying temperature sensor data on a Liquid Crystal Display with Arduino","author":"Chewett","date":"August 4, 2018","format":false,"excerpt":"This blog post expands on displaying Hello World on a Liquid Crystal Display to show temperature sensor values on this display. Combining the LCD display and\u00a0DS18B20 Temperature Sensor This project combines two of my favourite pieces of electrical components the 16x2 LCD display and the DS18B20 temperature sensor. Both have\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_temp_sensor.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_temp_sensor.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_temp_sensor.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_temp_sensor.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":311,"url":"https:\/\/chewett.co.uk\/blog\/311\/dht22-sensor-review-code-examples\/","url_meta":{"origin":2054,"position":2},"title":"DHT22 Sensor review and code examples","author":"Chewett","date":"October 18, 2017","format":false,"excerpt":"The DHT22 sensor works as a duel temperature and humidity sensor. In this post I will review the sensor, show how it can be used and give a final judgement on it. What can the DHT22 do? The DHT22 sensor is actually a slightly more accurate and powerful version of\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/dht22_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/dht22_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/dht22_post_icon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/dht22_post_icon.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":714,"url":"https:\/\/chewett.co.uk\/blog\/714\/magnetic-reed-switch-sensor-module-review-and-code-examples\/","url_meta":{"origin":2054,"position":3},"title":"Magnetic Reed Switch Sensor Module Review and code examples","author":"Chewett","date":"September 8, 2018","format":false,"excerpt":"This post reviews a\u00a0magnetic reed switch sensor module. There are many of these available on the internet and all\u00a0work similarly using a basic reed switch. Here I review and test the sensor and provide code to use it. Overview of the Magnetic Reed Switch sensor The magnetic reed switch Arduino\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/magnetic_reed_switch_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/magnetic_reed_switch_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/magnetic_reed_switch_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/magnetic_reed_switch_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":309,"url":"https:\/\/chewett.co.uk\/blog\/309\/dht11-sensor-review-code-examples\/","url_meta":{"origin":2054,"position":4},"title":"DHT11 Sensor Review and code examples","author":"Chewett","date":"August 12, 2017","format":false,"excerpt":"The DHT11 sensor works as a basic temperature and humidity sensor at a low price. In this post I will review the sensor, show how it can be used and give a final judgement on it. What can the DHT11 do? The DHT11 sensor is a basic sensor that lets\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/dht11_text.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/dht11_text.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/dht11_text.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/dht11_text.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":721,"url":"https:\/\/chewett.co.uk\/blog\/721\/sw-18010p-motion-vibration-sensor-review-code-examples\/","url_meta":{"origin":2054,"position":5},"title":"SW-18010P Motion Vibration Sensor review and code examples","author":"Chewett","date":"December 6, 2017","format":false,"excerpt":"This post reviews the\u00a0SW-18010P motion vibration sensor. Here I review, test and provide code to use the sensor. Overview of the Vibration Sensor The SW-18010P vibration sensor is a small spring inside a metal casing. As the sensor vibrates or moves the spring will make contact with the metal casing\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/vibration_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/vibration_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/vibration_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/vibration_sensor_post_icon.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2054","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=2054"}],"version-history":[{"count":6,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2054\/revisions"}],"predecessor-version":[{"id":2156,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2054\/revisions\/2156"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/2058"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}