{"id":1169,"date":"2018-01-16T11:24:27","date_gmt":"2018-01-16T13:24:27","guid":{"rendered":"https:\/\/arduxop.com.br\/loja\/produto\/ky-021-mini-magnetic-reed-modules\/"},"modified":"2024-07-25T07:58:20","modified_gmt":"2024-07-25T11:58:20","slug":"ky-021-mini-magnetic-reed-modules","status":"publish","type":"product","link":"https:\/\/arduxop.com.br\/loja\/produto\/ky-021-mini-magnetic-reed-modules\/","title":{"rendered":"KY-021 Mini magnetic reed modules"},"content":{"rendered":"<p>MINI reed switch moduleA reed module is a magnetic sensor that is normally open and get closed when exposed to a magnetic field.In our example turn off the buildin LED on pin 13 if the sensor is closed. For this you need to keep a magnet near the sensor.The module includes a 10 K Ohm resistor, so no additional parts needed.SchematicArduino GND &#8211;&gt; Module pin -Arduino +5V &#8211;&gt; Module PLUS (middle pin)Arduino Digital pin 3 &#8211;&gt; Module S&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;Example Code&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-\/\/\/\/ Example code for sensor KY021\/\/ More info on ,http:\/\/tkkrlab.nl\/wiki\/Arduino_KY-021_Mini_magnetic_reed_modules\/\/int Led = 13 ;\/\/ define LED Interfaceint buttonpin = 3; \/\/ define the Reed sensor interfacesint val ;\/\/ define numeric variables valvoid setup (){ pinMode (Led, OUTPUT) ;\/\/ define LED as output interface pinMode (buttonpin, INPUT) ;\/\/ output interface as defined Reed sensor}void loop (){ val = digitalRead (buttonpin) ;\/\/ digital interface will be assigned a value of 3 to read val if (val == HIGH) \/\/ When the Reed sensor detects a signal, LED flashes { digitalWrite (Led, HIGH); } else { digitalWrite (Led, LOW); }}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MINI reed switch moduleA reed module is a magnetic sensor that is normally open and get closed when exposed to a magnetic field.In our example turn off the buildin LED on pin 13 if the sensor is closed. For this you need to keep a magnet near the sensor.The module includes a 10 K Ohm [&hellip;]<\/p>\n","protected":false},"featured_media":1170,"template":"","meta":[],"product_brand":[],"product_cat":[178],"product_tag":[],"class_list":{"0":"post-1169","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-sensores","8":"entry","9":"has-media","11":"first","12":"onbackorder","13":"sale","14":"sold-individually","15":"purchasable","16":"product-type-simple","17":"has-product-nav","18":"col","19":"span_1_of_3","20":"owp-content-center","21":"owp-thumbs-layout-horizontal","22":"owp-btn-normal","23":"owp-tabs-layout-horizontal"},"_links":{"self":[{"href":"https:\/\/arduxop.com.br\/loja\/wp-json\/wp\/v2\/product\/1169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduxop.com.br\/loja\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/arduxop.com.br\/loja\/wp-json\/wp\/v2\/types\/product"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arduxop.com.br\/loja\/wp-json\/wp\/v2\/media\/1170"}],"wp:attachment":[{"href":"https:\/\/arduxop.com.br\/loja\/wp-json\/wp\/v2\/media?parent=1169"}],"wp:term":[{"taxonomy":"product_brand","embeddable":true,"href":"https:\/\/arduxop.com.br\/loja\/wp-json\/wp\/v2\/product_brand?post=1169"},{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/arduxop.com.br\/loja\/wp-json\/wp\/v2\/product_cat?post=1169"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/arduxop.com.br\/loja\/wp-json\/wp\/v2\/product_tag?post=1169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}