{"id":2055,"date":"2019-05-11T13:00:20","date_gmt":"2019-05-11T12:00:20","guid":{"rendered":"https:\/\/chewett.co.uk\/blog\/?p=2055"},"modified":"2019-05-12T23:44:57","modified_gmt":"2019-05-12T22:44:57","slug":"daorier-sensor-button-switch-input-for-arduino-review-and-code","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/2055\/daorier-sensor-button-switch-input-for-arduino-review-and-code\/","title":{"rendered":"DaoRier sensor button switch input 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=\"2064\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2055\/daorier-sensor-button-switch-input-for-arduino-review-and-code\/daorier-sensor-button-switch-input\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-sensor-button-switch-input.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=\"DaoRier sensor button switch input\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-sensor-button-switch-input.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-sensor-button-switch-input.jpg?fit=678%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-sensor-button-switch-input.jpg?resize=678%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-2064\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-sensor-button-switch-input.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-sensor-button-switch-input.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-sensor-button-switch-input.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-sensor-button-switch-input.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 DaoRier sensor button switch input with an Arduino. <\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">DaoRier sensor button switch input<\/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=\"2060\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2055\/daorier-sensor-button-switch-input-for-arduino-review-and-code\/daorier-module-sensor-buttons-switch-input-signal-module_mainimage\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-module-sensor-buttons-switch-input-signal-module_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=\"DaoRier module sensor buttons switch input signal module_mainimage\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-module-sensor-buttons-switch-input-signal-module_mainimage.jpg?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-module-sensor-buttons-switch-input-signal-module_mainimage.jpg?fit=678%2C678&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-module-sensor-buttons-switch-input-signal-module_mainimage.jpg?resize=351%2C351&#038;ssl=1\" alt=\"\" class=\"wp-image-2060\" width=\"351\" height=\"351\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-module-sensor-buttons-switch-input-signal-module_mainimage.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-module-sensor-buttons-switch-input-signal-module_mainimage.jpg?resize=300%2C300&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-module-sensor-buttons-switch-input-signal-module_mainimage.jpg?resize=768%2C768&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-module-sensor-buttons-switch-input-signal-module_mainimage.jpg?resize=50%2C50&amp;ssl=1 50w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-module-sensor-buttons-switch-input-signal-module_mainimage.jpg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/03\/DaoRier-module-sensor-buttons-switch-input-signal-module_mainimage.jpg?resize=200%2C200&amp;ssl=1 200w\" sizes=\"auto, (max-width: 351px) 100vw, 351px\" \/><\/figure><\/div>\n\n\n\n<p>The DaoRier sensor button switch input is a simple single button trigger.<\/p>\n\n\n\n<p>Whenever the button is pressed the signal pin is set to LOW. When the button is not pressed the signal pin will be HIGH.<\/p>\n\n\n\n<p>This is a useful little board as you don&#8217;t need to connect any additional resistors to safely use this with an Arduino. This is because they are included on the board.<\/p>\n\n\n\n<p>The button is a standard large push button but in addition the button front can be removed and replaced with another. This means that if the standard grey colour is not what you want it can be replaced easily.<\/p>\n\n\n\n<p>An additional benefit to this sensor is that there are two different ways to connect wires to it. Either using a standard four pin connector or the 3 pin headers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wiring it up to an Arduino <\/h2>\n\n\n\n<p>Since the sensor includes inbuilt resistors no additional electronic components are needed. This means that we can wire up the pins directly to the Arduino. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"416\" data-attachment-id=\"2195\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2055\/daorier-sensor-button-switch-input-for-arduino-review-and-code\/daorier-module-sensor-buttons-switch-wiring\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/05\/DaoRier-module-sensor-buttons-switch-wiring.jpg?fit=688%2C422&amp;ssl=1\" data-orig-size=\"688,422\" 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=\"DaoRier module sensor buttons switch wiring\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/05\/DaoRier-module-sensor-buttons-switch-wiring.jpg?fit=300%2C184&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/05\/DaoRier-module-sensor-buttons-switch-wiring.jpg?fit=678%2C416&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/05\/DaoRier-module-sensor-buttons-switch-wiring.jpg?resize=678%2C416&#038;ssl=1\" alt=\"\" class=\"wp-image-2195\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/05\/DaoRier-module-sensor-buttons-switch-wiring.jpg?w=688&amp;ssl=1 688w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/05\/DaoRier-module-sensor-buttons-switch-wiring.jpg?resize=300%2C184&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/05\/DaoRier-module-sensor-buttons-switch-wiring.jpg?resize=50%2C31&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>G needs to be connected to ground, V to the 5 volt line, and S to a digital pin that you want to read the data from.<\/p>\n\n\n\n<p>Once these are connected you are ready to read the button state using the Arduino.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Programming the Arduino with the DaoRier sensor button switch input  <\/h2>\n\n\n\n<p>To see whether the button is pressed or not I can use the following code.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#define SWITCH_PIN 2\n\nvoid setup() {\n  Serial.begin(115200);\n  pinMode(SWITCH_PIN, INPUT);\n}\n\nvoid loop() {\n  int btnState = digitalRead(SWITCH_PIN);\n  Serial.println(btnState);\n  delay(25);\n}\n<\/pre><\/div>\n\n\n<p>Here the switch pin, 2, is configured as a hash define. In the setup this is used to set the digital pin mode as an input. In addition to this, the serial connection is configured here at 115200 baud rate.<\/p>\n\n\n\n<p>In the main loop the button state is read using the hash define. This is stored to an int and then printed out as either a 1 or a 0.<\/p>\n\n\n\n<p>Each loop is delayed by 25 seconds so there is a very short delay in reading and printing the data. This stops the serial connection being flooded with data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"mce_5\">Final Review<\/h2>\n\n\n\n<p>This is a very useful button sensor as no additional components are needed for its use. This makes it very simple to install and use out of the box.<\/p>\n\n\n\n<p>The ability to switch the button keycap is also very useful and means you can purchase a number of additional coloured keycaps and configure them as needed.<\/p>\n\n\n\n<p>Overall a very nice little sensor to easily integrate with an Arduino. <strong>Would buy again!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post talks about using the DaoRier sensor button switch input with an Arduino.<\/p>\n","protected":false},"author":1,"featured_media":2061,"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":"Yesterday I reviewed the #DaoRier sensor button switch input For #Arduino and provided example 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,332,318],"class_list":["post-2055","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electronics","tag-arduino","tag-push-switch","tag-switch"],"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\/DaoRier-module-sensor-buttons-switch-input-signal-module_posticon.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-x9","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1928,"url":"https:\/\/chewett.co.uk\/blog\/1928\/daorier-ky-008-saver-laser-transmitter-module-650nm-for-arduino-review-and-code\/","url_meta":{"origin":2055,"position":0},"title":"Daorier Ky 008 Saver Laser Transmitter Module 650nm for Arduino Review and Code","author":"Chewett","date":"February 20, 2019","format":false,"excerpt":"Today I review the Daorier Ky 008 Saver Laser Transmitter Module 650nm module for Arduino and provide example code. Overview of the Daorier Ky 008 Saver Laser Transmitter Module 650nm The Daorier Ky 008 Laser transmitter module includes a standard 650nm red laser on the PCB. This is an incredibly\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\/2019\/01\/Daorier_Ky_008_laser_mainimage.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\/2019\/01\/Daorier_Ky_008_laser_mainimage.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/Daorier_Ky_008_laser_mainimage.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/Daorier_Ky_008_laser_mainimage.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":558,"url":"https:\/\/chewett.co.uk\/blog\/558\/ttp223b-capacitive-touch-sensor-review-code\/","url_meta":{"origin":2055,"position":1},"title":"TTP223B Capacitive Touch Sensor Review and Code","author":"Chewett","date":"September 13, 2017","format":false,"excerpt":"The TTP223B Capacitive touch sensor is a button type sensor that allows you to detect when it is being pressed. In this post I review the sensor and provide code and a wiring diagram to use such a sensor. What can a Capacitive Touch Sensor do? The sensor is essentially\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\/TTP223B_touch_sensor_article_image.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\/TTP223B_touch_sensor_article_image.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/TTP223B_touch_sensor_article_image.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/TTP223B_touch_sensor_article_image.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1879,"url":"https:\/\/chewett.co.uk\/blog\/1879\/using-the-ttp223b-capacitive-touch-sensor-with-a-wemos-d1-mini-esp8266\/","url_meta":{"origin":2055,"position":2},"title":"Using the TTP223B Capacitive Touch Sensor with a WeMos D1 Mini (ESP8266)","author":"Chewett","date":"January 5, 2019","format":false,"excerpt":"In this blog post I talk about how you can use the TTP223B Capacitive Touch sensor with a WeMos D1 Mini (ESP8266) using the Arduino IDE. Summary of the TTP223B Capacitive Touch Sensor The TTP223B capacitive touch sensor works as a standard button. The main difference being that it requires\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\/2019\/01\/ttp223b_capacitive_sensor_wemos.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\/2019\/01\/ttp223b_capacitive_sensor_wemos.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/ttp223b_capacitive_sensor_wemos.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2019\/01\/ttp223b_capacitive_sensor_wemos.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2520,"url":"https:\/\/chewett.co.uk\/blog\/2520\/junlinto-45mm-push-arcade-button-12v-power-led-for-arduino-review-and-code\/","url_meta":{"origin":2055,"position":3},"title":"Junlinto 45mm Push Arcade Button 12V Power LED For Arduino Review and Code","author":"Chewett","date":"August 1, 2020","format":false,"excerpt":"This post talks about how you can use the Junlinto 45mm Push Arcade Button 12V Power LED with an Arduino. Junlinto 45mm Push Arcade Button 12V Power LED This 45mm push button is a relatively standard button for an arcade machine. Inside of the button is a white LED which\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\/2020\/06\/Junlinto-45mm-Push-Arcade-Button-12V-Power-LED_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\/2020\/06\/Junlinto-45mm-Push-Arcade-Button-12V-Power-LED_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/Junlinto-45mm-Push-Arcade-Button-12V-Power-LED_post_icon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/Junlinto-45mm-Push-Arcade-Button-12V-Power-LED_post_icon.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":959,"url":"https:\/\/chewett.co.uk\/blog\/959\/review-arduino-starter-kit\/","url_meta":{"origin":2055,"position":4},"title":"Review of the Arduino Starter Kit","author":"Chewett","date":"January 6, 2018","format":false,"excerpt":"This post reviews the Arduino Starter Kit. This is an ideal kit for a beginner in electronics and embedded systems or for someone wanting to learn how work with an Arduino. Here I look over what you get in the kit and the projects it provides. Arduino\/Genuino Starter Kit The\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\/01\/review_of_starter_kit_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\/2018\/01\/review_of_starter_kit_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/01\/review_of_starter_kit_post_icon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/01\/review_of_starter_kit_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":2055,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2055","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=2055"}],"version-history":[{"count":5,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2055\/revisions"}],"predecessor-version":[{"id":2197,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2055\/revisions\/2197"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/2061"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}