{"id":923,"date":"2017-02-22T19:23:02","date_gmt":"2017-02-22T18:23:02","guid":{"rendered":"http:\/\/www.albertopasca.it\/whiletrue\/?p=923"},"modified":"2018-07-25T20:06:51","modified_gmt":"2018-07-25T18:06:51","slug":"arduino-automatic-power-on-a-220v-lamp-or-whatever","status":"publish","type":"post","link":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/","title":{"rendered":"Arduino \u2013 Automatic power on a 220v lamp (or whatever)"},"content":{"rendered":"<p>Today, a simple Arduino project that permit you to power on something connected to a\u00a0<strong>220v power<\/strong>\u00a0using a simple relay.<\/p>\n<p><center><br \/>\n<a href=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium_large wp-image-4817\" src=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q-768x768.jpg?resize=650%2C650&#038;ssl=1\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" srcset=\"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q-768x768.jpg 768w, https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q-150x150.jpg 150w, https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q-300x300.jpg 300w, https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q-1024x1024.jpg 1024w, https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q.jpg 1080w\" alt=\"2Q==\" width=\"650\" height=\"650\" \/><\/a><\/center><!--more--><\/p>\n<p>What you need for this example:<\/p>\n<ul>\n<li>Arduino (Uno, Micro, Nano, Lillypad\u2026 any)<\/li>\n<li>A small breadboard<\/li>\n<li>1 Relay (220v)<\/li>\n<li>1 Pyro Sensor (*)<\/li>\n<li>1 Photocell Diode (LDR) (*)<\/li>\n<li>1 Lamp (OR a fan, a door, a washing machine\u2026)\u00a0(220v) (*)<\/li>\n<\/ul>\n<p>(*) these sensors, are optional, you can change with your favorite input sensor, according to the needs.<\/p>\n<p>In this example we want use a simple lamp (classic one, the cheapest from Ikea).<\/p>\n<p><center><br \/>\n<a href=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/lamp.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4815\" src=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/lamp.png?resize=500%2C500&#038;ssl=1\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" srcset=\"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/lamp.png 500w, https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/lamp-150x150.png 150w, https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/lamp-300x300.png 300w\" alt=\"lamp\" width=\"500\" height=\"500\" \/><\/a><\/center>&nbsp;<\/p>\n<h4>Scope of the circuit:<\/h4>\n<p>Get out of bed\u00a0in the morning without power-on the\u00a0chandelier but only a soft lamp\u00a0on the nightstand.<\/p>\n<p>This lamp is powered if the room is dark and\u00a0if\u00a0a movement is detected. If you walk in your room during the day,\u00a0anything will be ignored and lamp still power-off.<\/p>\n<p>It\u2019s very-very simple project and a useless thing, but in the spare time everything is good.<\/p>\n<h4>Let\u2019s start:<\/h4>\n<p><a href=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/sketch_bb.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-medium_large wp-image-4800 aligncenter\" src=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/sketch_bb-768x513.png?resize=650%2C434&#038;ssl=1\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" srcset=\"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/sketch_bb-768x513.png 768w, https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/sketch_bb-300x200.png 300w, https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/sketch_bb-1024x684.png 1024w\" alt=\"sketch_bb\" width=\"650\" height=\"434\" \/><\/a><\/p>\n<p>I\u00a0not go more in deep, but fundamentally the pyro is connected to\u00a0<strong>digital pin 3<\/strong>\u00a0and the photo-diod is connected to\u00a0<strong>analog pin A0<\/strong>. It\u2019s just an example.<\/p>\n<p>The relay is connected to\u00a0<strong>digital\u00a0pin 4<\/strong>.<\/p>\n<p><em>Vcc<\/em>\u00a0and\u00a0<em>ground<\/em>\u00a0are connected to vcc and ground of Arduino.<\/p>\n<h4>How components works?<\/h4>\n<p>Light sensor:<\/p>\n<div class=\"desc col-sm-6 col-md-6\">\n<p>A\u00a0<strong>Light Sensor<\/strong>\u00a0generates an output signal indicating the intensity of light by measuring the radiant energy that exists in a very narrow range of frequencies basically called \u201clight\u201d, and which ranges in frequency from \u201cInfra-red\u201d to \u201cVisible\u201d up to \u201cUltraviolet\u201d light spectrum.<\/p>\n<div id='gallery-1' class='gallery galleryid-923 gallery-columns-2 gallery-size-medium'><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/io61\/'><img loading=\"lazy\" decoding=\"async\" width=\"263\" height=\"142\" src=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2018\/05\/io61.gif?fit=263%2C142&amp;ssl=1\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/io58a\/'><img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"183\" src=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2018\/05\/io58a.jpg?fit=100%2C183&amp;ssl=1\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a>\n\t\t\t<\/div><\/figure>\n\t\t<\/div>\n\n<p>Pyro sensor:<\/p>\n<p>A\u00a0<strong>pyroelectric sensor<\/strong>\u00a0has an infrared filter window that admits IR within the 5 to 15 micrometer wavelength range. One end of the two series-connected elements in an analog sensor is connected to pin 3 that is normally grounded. The other end connects internally to the gate of a Field Effect Transistor and to a very high value pulldown resistor. Power is applied to FET drain pin 1 and the output signal comes from FET source pin 2 which usually connects through an external pulldown resistor to ground and to an amplifier. A digital sensor not shown here, includes internal processing circuits and outputs digital pulses.<\/p>\n<div id='gallery-2' class='gallery galleryid-923 gallery-columns-2 gallery-size-medium'><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/lens2\/'><img loading=\"lazy\" decoding=\"async\" width=\"274\" height=\"250\" src=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2018\/05\/lens2.jpg?fit=274%2C250&amp;ssl=1\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/hc-sr501-500x274\/'><img loading=\"lazy\" decoding=\"async\" width=\"255\" height=\"250\" src=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2018\/05\/hc-sr501-500x274.jpg?fit=255%2C250&amp;ssl=1\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a>\n\t\t\t<\/div><\/figure>\n\t\t<\/div>\n\n<p>With few lines of code we are able to detect the intensity of light and an eventual movements.<\/p>\n<p>Combining these results we can power-on something attached to a 220v.<\/p>\n<p>Or simply power-on only when is dark, like this snippet:<\/p>\n<p>[code lang=&#8221;cpp&#8221; autolinks=&#8221;false&#8221; collapse=&#8221;false&#8221; firstline=&#8221;1&#8243; gutter=&#8221;true&#8221; htmlscript=&#8221;false&#8221; light=&#8221;false&#8221; padlinenumbers=&#8221;false&#8221; smarttabs=&#8221;true&#8221; tabsize=&#8221;4&#8243; toolbar=&#8221;false&#8221;]void loop()<br \/>\n{<br \/>\n  \/\/ give power to relay if room is dark, else shutdown.<br \/>\n  digitalWrite ( relayPin,  isDark() ? HIGH : LOW );<br \/>\n}<\/p>\n<p>bool isDark()<br \/>\n{<br \/>\n  \/\/ read from photo-diod (Analog pin A0) the intensity and decide your limit.<br \/>\n  return analogRead( A0 ) &amp;gt; 900;<br \/>\n}[\/code]<\/p>\n<p>The code for pyro sensor is well explained on the Arduino playground site:<\/p>\n<p><a href=\"http:\/\/playground.arduino.cc\/Code\/PIRsense\" target=\"_blank\" rel=\"noopener\">http:\/\/playground.arduino.cc\/Code\/PIRsense<\/a><\/p>\n<p>You can adapt to your exigence.<\/p>\n<hr \/>\n<p>The coolest thing is that you can control anything you want with a few line of codes and few wire link.<\/p>\n<p>I give you some inspirations\u2026<\/p>\n<ul>\n<li>use a\u00a0<strong>Soil Moisture<\/strong>\u00a0sensor to detect the humidity of the terrain and if you want power-on the\u00a0<em>garden\u2019s pump<\/em>!<\/li>\n<li>use a\u00a0<strong>Temperature<\/strong>\u00a0sensor to detect the temperature. If is too hot..\u00a0<em>start a fan<\/em>!<\/li>\n<li>use a\u00a0<strong>Fingerprint<\/strong>\u00a0sensor to detect your finger and\u00a0<em>open a door<\/em>!<\/li>\n<li>use a\u00a0<strong>Microphone<\/strong>\u00a0sensor to detect a clap and power-on the\u00a0<em>sexy ambient light<\/em>of room house!<\/li>\n<li>use a\u00a0<strong>Wifi\/Ethernet<\/strong>\u00a0shield to control remotely your\u00a0<em>washing machine<\/em>!<\/li>\n<li>and many mooooore\u2026. only fantasy!<\/li>\n<\/ul>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-medium_large wp-image-4810 aligncenter\" src=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/sketch_bb-1-768x513.png?resize=650%2C434&#038;ssl=1\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" srcset=\"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/sketch_bb-1-768x513.png 768w, https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/sketch_bb-1-300x200.png 300w, https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/sketch_bb-1-1024x684.png 1024w\" alt=\"sketch_bb\" width=\"650\" height=\"434\" \/><\/p>\n<p>enjoy with your home automation!<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today, a simple Arduino project that permit you to power on something connected to a\u00a0220v power\u00a0using a simple relay.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[588,257,589,590,272,591,260,592,593,594,595,596,262,597,598,599,600],"class_list":["post-923","post","type-post","status-publish","format-standard","hentry","category-generic","tag-220v","tag-arduino","tag-automation","tag-door","tag-fingerprint","tag-home","tag-lamp","tag-light","tag-microphone","tag-motion","tag-night","tag-photodiod","tag-pyro","tag-relay","tag-sensor","tag-soil-moisture","tag-temperature"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Arduino \u2013 Automatic power on a 220v lamp (or whatever) - while (true) {\u00a0}<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arduino \u2013 Automatic power on a 220v lamp (or whatever) - while (true) {\u00a0}\" \/>\n<meta property=\"og:description\" content=\"Today, a simple Arduino project that permit you to power on something connected to a\u00a0220v power\u00a0using a simple relay.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/\" \/>\n<meta property=\"og:site_name\" content=\"while (true) {\u00a0}\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-22T18:23:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-07-25T18:06:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2018\/05\/io61.gif?fit=263%2C142&amp;ssl=1\" \/>\n<meta name=\"author\" content=\"Alberto Pasca\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@lupasca\" \/>\n<meta name=\"twitter:site\" content=\"@lupasca\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alberto Pasca\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/\"},\"author\":{\"name\":\"Alberto Pasca\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#\\\/schema\\\/person\\\/d3cf0df774eb4aac797f246a795e9fac\"},\"headline\":\"Arduino \u2013 Automatic power on a 220v lamp (or whatever)\",\"datePublished\":\"2017-02-22T18:23:02+00:00\",\"dateModified\":\"2018-07-25T18:06:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/\"},\"wordCount\":610,\"publisher\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#\\\/schema\\\/person\\\/d3cf0df774eb4aac797f246a795e9fac\"},\"image\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/2Q-768x768.jpg\",\"keywords\":[\"220v\",\"arduino\",\"automation\",\"door\",\"fingerprint\",\"home\",\"lamp\",\"light\",\"microphone\",\"motion\",\"night\",\"photodiod\",\"Pyro\",\"relay\",\"sensor\",\"Soil Moisture\",\"Temperature\"],\"articleSection\":[\"generic\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/\",\"url\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/\",\"name\":\"Arduino \u2013 Automatic power on a 220v lamp (or whatever) - while (true) {\u00a0}\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/2Q-768x768.jpg\",\"datePublished\":\"2017-02-22T18:23:02+00:00\",\"dateModified\":\"2018-07-25T18:06:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/2Q-768x768.jpg\",\"contentUrl\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/2Q-768x768.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/arduino-automatic-power-on-a-220v-lamp-or-whatever\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino \u2013 Automatic power on a 220v lamp (or whatever)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#website\",\"url\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/\",\"name\":\"while (true) {\u00a0}\",\"description\":\"notes from a developer, tutorials, how-to, ideas\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#\\\/schema\\\/person\\\/d3cf0df774eb4aac797f246a795e9fac\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.albertopasca.it\\\/whiletrue\\\/#\\\/schema\\\/person\\\/d3cf0df774eb4aac797f246a795e9fac\",\"name\":\"Alberto Pasca\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g\",\"caption\":\"Alberto Pasca\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g\"},\"description\":\"Software engineer @ Pirelli &amp; C. S.p.A. with a strong passion for mobile \uf8ff development, security, and connected things.\",\"sameAs\":[\"https:\\\/\\\/www.albertopasca.it\",\"albertopasca\",\"https:\\\/\\\/x.com\\\/lupasca\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Arduino \u2013 Automatic power on a 220v lamp (or whatever) - while (true) {\u00a0}","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/","og_locale":"en_US","og_type":"article","og_title":"Arduino \u2013 Automatic power on a 220v lamp (or whatever) - while (true) {\u00a0}","og_description":"Today, a simple Arduino project that permit you to power on something connected to a\u00a0220v power\u00a0using a simple relay.","og_url":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/","og_site_name":"while (true) {\u00a0}","article_published_time":"2017-02-22T18:23:02+00:00","article_modified_time":"2018-07-25T18:06:51+00:00","og_image":[{"url":"https:\/\/i0.wp.com\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2018\/05\/io61.gif?fit=263%2C142&amp;ssl=1","type":"","width":"","height":""}],"author":"Alberto Pasca","twitter_card":"summary_large_image","twitter_creator":"@lupasca","twitter_site":"@lupasca","twitter_misc":{"Written by":"Alberto Pasca","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/#article","isPartOf":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/"},"author":{"name":"Alberto Pasca","@id":"https:\/\/www.albertopasca.it\/whiletrue\/#\/schema\/person\/d3cf0df774eb4aac797f246a795e9fac"},"headline":"Arduino \u2013 Automatic power on a 220v lamp (or whatever)","datePublished":"2017-02-22T18:23:02+00:00","dateModified":"2018-07-25T18:06:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/"},"wordCount":610,"publisher":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/#\/schema\/person\/d3cf0df774eb4aac797f246a795e9fac"},"image":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/#primaryimage"},"thumbnailUrl":"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q-768x768.jpg","keywords":["220v","arduino","automation","door","fingerprint","home","lamp","light","microphone","motion","night","photodiod","Pyro","relay","sensor","Soil Moisture","Temperature"],"articleSection":["generic"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/","url":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/","name":"Arduino \u2013 Automatic power on a 220v lamp (or whatever) - while (true) {\u00a0}","isPartOf":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/#primaryimage"},"image":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/#primaryimage"},"thumbnailUrl":"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q-768x768.jpg","datePublished":"2017-02-22T18:23:02+00:00","dateModified":"2018-07-25T18:06:51+00:00","breadcrumb":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/#primaryimage","url":"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q-768x768.jpg","contentUrl":"https:\/\/www.albertopasca.it\/whiletrue\/wp-content\/uploads\/2017\/02\/2Q-768x768.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.albertopasca.it\/whiletrue\/arduino-automatic-power-on-a-220v-lamp-or-whatever\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.albertopasca.it\/whiletrue\/"},{"@type":"ListItem","position":2,"name":"Arduino \u2013 Automatic power on a 220v lamp (or whatever)"}]},{"@type":"WebSite","@id":"https:\/\/www.albertopasca.it\/whiletrue\/#website","url":"https:\/\/www.albertopasca.it\/whiletrue\/","name":"while (true) {\u00a0}","description":"notes from a developer, tutorials, how-to, ideas","publisher":{"@id":"https:\/\/www.albertopasca.it\/whiletrue\/#\/schema\/person\/d3cf0df774eb4aac797f246a795e9fac"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.albertopasca.it\/whiletrue\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.albertopasca.it\/whiletrue\/#\/schema\/person\/d3cf0df774eb4aac797f246a795e9fac","name":"Alberto Pasca","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g","caption":"Alberto Pasca"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/4d8fe43c412d0bb34a71c41f60dce53eff3afc027853cbfd20bee6ddc7e93f35?s=96&d=retro&r=g"},"description":"Software engineer @ Pirelli &amp; C. S.p.A. with a strong passion for mobile \uf8ff development, security, and connected things.","sameAs":["https:\/\/www.albertopasca.it","albertopasca","https:\/\/x.com\/lupasca"]}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/posts\/923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/comments?post=923"}],"version-history":[{"count":5,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/posts\/923\/revisions"}],"predecessor-version":[{"id":1110,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/posts\/923\/revisions\/1110"}],"wp:attachment":[{"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/media?parent=923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/categories?post=923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.albertopasca.it\/whiletrue\/wp-json\/wp\/v2\/tags?post=923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}