{"id":3445,"date":"2017-01-04T15:41:32","date_gmt":"2017-01-04T11:41:32","guid":{"rendered":"https:\/\/nayarweb.com\/blog\/?p=3445"},"modified":"2017-10-08T20:54:02","modified_gmt":"2017-10-08T16:54:02","slug":"iot-series-smart-lightsensors-in-the-kitchen","status":"publish","type":"post","link":"https:\/\/nayarweb.com\/blog\/2017\/iot-series-smart-lightsensors-in-the-kitchen\/","title":{"rendered":"IoT Series: Smart Light\/Sensors in the Kitchen"},"content":{"rendered":"<h3>The Idea<\/h3>\n<p>The idea\u00a0is simple. When someone is the kitchen, the lights should be turned on. When their&#8217;s no one,obviously it should be turned off.\u00a0Wouldn&#8217;t\u00a0a simple $10 IR switch from eBay do the job?<\/p>\n<figure id=\"attachment_3455\" aria-describedby=\"caption-attachment-3455\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-3455 size-large\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/img_20161231_231028-1024x576.jpg\" width=\"640\" height=\"360\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/img_20161231_231028-1024x576.jpg 1024w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/img_20161231_231028-300x169.jpg 300w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/img_20161231_231028-768x432.jpg 768w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/img_20161231_231028-1272x716.jpg 1272w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption id=\"caption-attachment-3455\" class=\"wp-caption-text\">WiFi Switch with Motion Sensor attached<\/figcaption><\/figure>\n<p>&#8220;Would the lights turn on even during the day&#8221; my mom asked when I presented the system to her. &#8220;Of course not&#8221; I replied. It would have be counterproductive and non-environmental friendly then.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3448\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.27.57-PM.png\" alt=\"\" width=\"417\" height=\"189\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.27.57-PM.png 417w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.27.57-PM-300x136.png 300w\" sizes=\"auto, (max-width: 417px) 100vw, 417px\" \/><\/p>\n<p>Everyone can start using cheap sensors and all but using them in such a way that actually makes sense is what&#8217;s the challenge.<\/p>\n<h3>How it works<\/h3>\n<p>When the motion sensor detects motion, it sends a signal to via MQTT to my main app server.<\/p>\n<p>The server side application calculates\u00a0whether the sun is above or below horizon &#8212; the sun doesn&#8217;t rise and set at the same time throughout the year. e.g. in summer, the sun can set around 1900 but in winter, around 1800. The application will calculate the exact time \u00a0on a daily basis so I won&#8217;\u00a0have to worry about this.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3447\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.21.46-PM.png\" alt=\"\" width=\"370\" height=\"292\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.21.46-PM.png 370w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.21.46-PM-300x237.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p>If the sun is below horizon, the kitchen light will turn on. Else the motion detected will just be ignored (but still be graphed for future use).<\/p>\n<h3>Is that the only benefit?<\/h3>\n<p>Having a IoT sensors and switches would allow be to get into the next phase of my work: Machine Learning or AI (Artifical Intelligence) as you wish to call it.<\/p>\n<p>For instance, you might start by looking at the graphs for each light to find a pattern visually.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-3449\" src=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.31.23-PM-1024x199.png\" alt=\"\" width=\"640\" height=\"124\" srcset=\"https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.31.23-PM-1024x199.png 1024w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.31.23-PM-300x58.png 300w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.31.23-PM-768x149.png 768w, https:\/\/nayarweb.com\/blog\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-04-at-3.31.23-PM.png 1178w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Right now, I do not have the ressources to send all the data in an\u00a0Elasticsearch cluster then visualise it using Kibana.\u00a0Another idea would be to mine the data with Google&#8217;s Tensorflow.\u00a0Alone, it will take me some time to do it all.<\/p>\n<h3>Previous works on IoT<\/h3>\n<p>If you haven&#8217;t been following me previously, I made a system that whenever I reach in front of my house, my outside lights turn on automatically for 2 minutes &#8212; the time I reverse my car and enter my house. You may find the article here:\u00a0<span style=\"color: #ffcc00;\"><a style=\"color: #ffcc00;\" href=\"https:\/\/nayarweb.com\/blog\/2016\/internet-of-things-iot-in-mauritius-lemme-just-do-it\/\">Internet of Things (IoT) in Mauritius, lemme just do it!<\/a><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>Wanna get into the world of Home Automation too? Wanna turn on your coffee machine from your bed and more? Feel free to contact me on <span style=\"color: #ffcc00;\"><a style=\"color: #ffcc00;\" href=\"https:\/\/www.linkedin.com\/in\/nayar-joolfoo-2589b2a2\">LinkedIn<\/a>,<\/span>\u00a0<span style=\"color: #ffcc00;\"><a style=\"color: #ffcc00;\" href=\"https:\/\/www.facebook.com\/NayarJoolfoo\">Facebook<\/a><\/span> or <span style=\"color: #ffcc00;\"><a style=\"color: #ffcc00;\" href=\"https:\/\/twitter.com\/Dr_Zoule\">Twitter<\/a>.<\/span><\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Idea The idea\u00a0is simple. When someone is the kitchen, the lights should be turned on. When their&#8217;s no one,obviously it should be turned off.\u00a0Wouldn&#8217;t\u00a0a simple $10 IR switch from eBay do the job? &#8220;Would the lights turn on even during the day&#8221; my mom asked when I presented the system to her. &#8220;Of course &hellip; <a href=\"https:\/\/nayarweb.com\/blog\/2017\/iot-series-smart-lightsensors-in-the-kitchen\/\" class=\"continue-reading\">Continue reading <span class=\"screen-reader-text\">IoT Series: Smart Light\/Sensors in the Kitchen<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[210],"tags":[232,237],"class_list":["post-3445","post","type-post","status-publish","format-standard","hentry","category-technology","tag-internet-of-things-iot","tag-smart-home"],"_links":{"self":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/3445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/comments?post=3445"}],"version-history":[{"count":4,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/3445\/revisions"}],"predecessor-version":[{"id":3456,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/posts\/3445\/revisions\/3456"}],"wp:attachment":[{"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/media?parent=3445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/categories?post=3445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nayarweb.com\/blog\/wp-json\/wp\/v2\/tags?post=3445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}