{"id":64649,"date":"2025-03-30T18:20:47","date_gmt":"2025-03-30T22:20:47","guid":{"rendered":"https:\/\/www.engineersgarage.com\/?p=64649"},"modified":"2025-04-20T07:06:31","modified_gmt":"2025-04-20T11:06:31","slug":"how-to-use-iot-based-d2d-automation","status":"publish","type":"post","link":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/","title":{"rendered":"How to use IoT-based D2D automation"},"content":{"rendered":"<p>In this tutorial, we\u2019ll learn how to use device-to-device (D2D) communication to make daily life a little simpler. For example, you\u2019ll be able to control household appliances, such as the coffee machine, a light switch, or the AC \u2014 and do so from inside your vehicle. So, if you\u2019re arriving home one evening, the presence of your vehicle can signal the porch light to switch on before you get to the front door.<\/p>\n<p>D2D communication typically refers to the technology that lets devices or appliances \u201ccommunicate\u201d without the use of network infrastructures.<\/p>\n<p>In this case, the D2D detects the presence of your car by using an ultrasonic sensor and the MQ Telemetry Transport (MQTT) protocol for signaling. MQTT is a network protocol that transports messages between devices.<\/p>\n<p>D2D communication is completely automated and does not rely on human interaction. This means that the use of a CCTV camera is unnecessary to detect your vehicle\u2019s presence. (You can even get a notification if someone tries to tamper with your car.)<\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-6.09.05-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-64650\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-6.09.05-PM-300x82.png\" alt=\"\" width=\"707\" height=\"194\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-6.09.05-PM-300x82.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-6.09.05-PM-1024x281.png 1024w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-6.09.05-PM-768x211.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-6.09.05-PM-368x101.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-6.09.05-PM.png 1181w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/a><\/p>\n<p><strong>Circuit diagram<\/strong><\/p>\n<p><strong>The switch board socket. <\/strong>You can also use the standard Arduino UNO3 and the ESP8266 WiFi microchip, separately. The key is to ensure everything fits inside the switchboard.<\/p>\n<div id=\"attachment_64651\" style=\"width: 699px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Circuit_digramn.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-64651\" class=\"wp-image-64651\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Circuit_digramn-300x141.png\" alt=\"\" width=\"689\" height=\"324\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Circuit_digramn-300x141.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Circuit_digramn-1024x482.png 1024w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Circuit_digramn-768x361.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Circuit_digramn-1536x722.png 1536w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Circuit_digramn-2048x963.png 2048w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Circuit_digramn-368x173.png 368w\" sizes=\"auto, (max-width: 689px) 100vw, 689px\" \/><\/a><p id=\"caption-attachment-64651\" class=\"wp-caption-text\">Customized Atmgea 328p board with an <span data-preserver-spaces=\"true\">ESP8266<\/span> and a relay circuit.<\/p><\/div>\n<p>Note: The rest of the circuit setup is the same if connecting with the ESP8266.<\/p>\n<p><strong>Technical insights<br \/>\n<\/strong>For this project we use Arduino UNO (Atmega 328p), ESP8266, and an ultrasonic distance-measuring sensor (to detect the presence of the vehicle), and the MQTT protocol for communication between devices.<\/p>\n<p>To ensure a successful D2D communication, it\u2019s first necessary to generate a control signal. This signal is sent between the smart sensor that detects the vehicle&#8217;s presence to the device that controls the home appliance (the lights, AC, coffee maker, etc.). The control device will require a pre-defined definition of what each control signal means.<\/p>\n<p>For instance, if the vehicle is newly arriving or leaving the driveway, the sensor will send a different control signal message.<\/p>\n<p>Since these signals are sent via the MQTT protocol, they can be accessed by multiple devices using their \u201ctopics.\u201d This means that it\u2019s possible to control multiple devices.<\/p>\n<p><strong>Block diagram | Algorithm<\/strong><\/p>\n<p><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Automatic-parking.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-64652\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Automatic-parking-300x139.png\" alt=\"\" width=\"681\" height=\"316\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Automatic-parking-300x139.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Automatic-parking-768x355.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Automatic-parking-368x170.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Automatic-parking.png 891w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" \/><\/a><\/p>\n<p><span data-preserver-spaces=\"true\">We\u2019ll need to make two devices. One for detecting the vehicle\u2019s presence in the driveway (we\u2019ll call the detection device) and another for controlling the home appliance (the controlling device).<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The controlling device uses a simple PCB board that connects the ESP8266 and Atmega328\u2019s (or Arduino UNO\u2019s) controller with a relay circuit. It \u201clistens\u201d (or subscribes) for a control signal, which is sent over the MQTT protocol on a specific topic.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">The detection device is an ultrasonic distance-measuring sensor, used with the Atmega 328p controller and the ESP8266 to communicate. This device sends a control signal on the topic, \u201cts\/light.\u201d Essentially, this device is continually sensing the presence or absence of the vehicle.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Now, let\u2019s take a look at how these devices will communicate with one another.<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">How it works<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">There are three scenarios as described below of this device on how it can work.\u00a0<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">1.<\/span><\/strong><span data-preserver-spaces=\"true\">\u00a0<\/span><strong><span data-preserver-spaces=\"true\">Absence of vehicle:\u00a0<\/span><\/strong><span data-preserver-spaces=\"true\">If there\u2019s no vehicle within the detection device\u2019s sensor range, it will continually send an \u201cOFF\u201d signal to the appliance-controlling device. So, the appliance connected to this device will remain off.<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">2. Parked vehicle:\u00a0<\/span><\/strong><span data-preserver-spaces=\"true\">When the car is parked in the driveway, the detection device sends an \u201cON\u201d signal that\u2019s on the \u201cts\/light\u201d topic. The home appliance is then turned on.<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">3. Vehicle departure:\u00a0<\/span><\/strong><span data-preserver-spaces=\"true\">If the vehicle leaves the driveway, the detection device sends an \u201cOFF\u201d signal to the controlling device.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">It\u2019s possible to add more complicated control signals but, for this project, we\u2019re keeping it simple.<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Understanding the source code<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">There are two main parts of the code.<\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">1. The detection device.\u00a0<\/span><\/strong><span data-preserver-spaces=\"true\">The vehicle is monitored by the detection device\u2019s ultrasonic sensor. If the distance in front of the sensor matches a set condition, it flags that car as detected.<\/span><\/p>\n<p><strong><span style=\"color: #800000;\" data-preserver-spaces=\"true\">if (int(sensor) &lt; 100.00) {<br \/>\n<\/span><\/strong><strong><span style=\"color: #800000;\" data-preserver-spaces=\"true\">\u00a0 \u00a0\u00a0times1 = times1 + 1;<br \/>\n<\/span><\/strong><strong><span style=\"color: #800000;\" data-preserver-spaces=\"true\">\u00a0\u00a0}<\/span><\/strong><\/p>\n<p><span data-preserver-spaces=\"true\">To ensure it\u2019s not a false detection, it repeats this five times to ensure the condition is true. If so, it sends an \u201cON\u201d signal.<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>if(times1 == 5){<br \/>\n<\/strong><\/span><span style=\"color: #800000;\"><strong>Serial.print(&#8220;ON&#8221;);<br \/>\n<\/strong><\/span><span style=\"color: #800000;\"><strong>\u00a0 \u00a0\u00a0times1 = 0;<br \/>\n<\/strong><\/span><span style=\"color: #800000;\"><strong>delay(1200);}<\/strong><\/span><\/p>\n<p><strong><span data-preserver-spaces=\"true\">2. Network communication<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">The common subscription is published to the ESP8266.<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>const char* topicSubscribe = &#8220;ts\/light&#8221;;<br \/>\n<\/strong><\/span><span style=\"color: #800000;\"><strong>const char* topicPublish = &#8220;ts\/report&#8221;;<\/strong><\/span><\/p>\n<p><span data-preserver-spaces=\"true\">To access the network, both ESP8266 and Atmega328P are used. Anything from Atmega328p is directly published (\u201csend\u201d) as a control signal to the \u201cts\/light\u201d topic.<\/span><\/p>\n<p><span style=\"color: #800000;\"><strong>if (Serial.available()) {<br \/>\nString recivedData = Serial.readString();<br \/>\ntemp_str = recivedData;<br \/>\nchar temp[temp_str.length() + 2];<br \/>\ntemp_str.toCharArray(temp, temp_str.length() + 1);<br \/>\nclient.publish(topicPublish, temp);<br \/>\n}<\/strong><\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Note: The ode snippet of the ESP8266.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Also, anything received over the MQTT is sent on the serial port from the ESP8266 to Atmega328p.<\/span><\/p>\n<p><strong><span style=\"color: #800000;\">void Received_data(char* topic, byte* payload, unsigned int length) {<br \/>\ndata_r_in_string = &#8220;&#8221;;<br \/>\nfor (int i = 0; i &lt; length; i++) {\u00a0 \u00a0<\/span><\/strong><\/p>\n<p><strong><span style=\"color: #800000;\" data-preserver-spaces=\"true\">data_r_in_string = String(data_r_in_string + (char)payload[i]);<\/span><\/strong><\/p>\n<p><strong><span style=\"color: #800000;\">\/\/Serial.print((char)payload[i]);<br \/>\n}<\/span><\/strong><\/p>\n<p><strong><span style=\"color: #800000;\">\u00a0Serial.print(data_r_in_string);<br \/>\n}<\/span><\/strong><\/p>\n<p>To provide a proper communication delay, the ESP function takes one second as a timeout. It will also consider anything received within that second as a single string.<\/p>\n<p>Also, as one device is publishing on the \u201cts\/light\u201d topic, the other must be subscribed to the same topic if it&#8217;s to receive the message sent.<\/p>\n<div style=\"width: 740px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-64649-1\" width=\"740\" height=\"463\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/VideoDemo.mp4?_=1\" \/><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/VideoDemo.mp4\">https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/VideoDemo.mp4<\/a><\/video><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we\u2019ll learn how to use device-to-device (D2D) communication to make daily life a little simpler. For example, you\u2019ll be able to control household appliances, such as the coffee machine, a light switch, or the AC \u2014 and do so from inside your vehicle. So, if you\u2019re arriving home one evening, the presence&hellip;<\/p>\n","protected":false},"author":394,"featured_media":64653,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[13,22],"tags":[1175,422,429,210,2393,1408,2090],"class_list":{"2":"type-post","16":"entry","17":"has-post-thumbnail"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.2 (Yoast SEO v25.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to use IoT-based D2D automation<\/title>\n<meta name=\"description\" content=\"D2D communication typically refers to the technology that lets devices or appliances \u201ccommunicate\u201d without the use of network infrastructures.\" \/>\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.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use IoT-based D2D automation\" \/>\n<meta property=\"og:description\" content=\"D2D communication typically refers to the technology that lets devices or appliances \u201ccommunicate\u201d without the use of network infrastructures.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/\" \/>\n<meta property=\"og:site_name\" content=\"Engineers Garage\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineersgarage\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM.png\" \/>\n\t<meta property=\"og:image:width\" content=\"963\" \/>\n\t<meta property=\"og:image:height\" content=\"571\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"EG Projects\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:site\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"EG Projects\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/\"},\"author\":{\"name\":\"EG Projects\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/46bbd53b9db1c5d1580cd604e3d6a2f2\"},\"headline\":\"How to use IoT-based D2D automation\",\"datePublished\":\"2025-03-30T22:20:47+00:00\",\"dateModified\":\"2025-04-20T11:06:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/\"},\"wordCount\":940,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM.png\",\"keywords\":[\"Arduino\",\"automation\",\"circuit\",\"communication\",\"d2dcommunication\",\"IoT\",\"MQTT\"],\"articleSection\":[\"Electronic Projects\",\"PIC Microcontroller\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/\",\"url\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/\",\"name\":\"How to use IoT-based D2D automation\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM.png\",\"datePublished\":\"2025-03-30T22:20:47+00:00\",\"dateModified\":\"2025-04-20T11:06:31+00:00\",\"description\":\"D2D communication typically refers to the technology that lets devices or appliances \u201ccommunicate\u201d without the use of network infrastructures.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#primaryimage\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM.png\",\"width\":963,\"height\":571},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.engineersgarage.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use IoT-based D2D automation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.engineersgarage.com\/#website\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"name\":\"Engineers Garage\",\"description\":\"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News\",\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.engineersgarage.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\",\"name\":\"Engineer's Garage - WTWH Media\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"width\":372,\"height\":52,\"caption\":\"Engineer's Garage - WTWH Media\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/engineersgarage\",\"https:\/\/x.com\/EngineersGarage\",\"https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/46bbd53b9db1c5d1580cd604e3d6a2f2\",\"name\":\"EG Projects\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/258abb93057dea88a2a5a7616dccf9a0dc3a77d050ca970493853035a0e6f634?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/258abb93057dea88a2a5a7616dccf9a0dc3a77d050ca970493853035a0e6f634?s=96&r=g\",\"caption\":\"EG Projects\"},\"url\":\"https:\/\/www.engineersgarage.com\/author\/eg-projects\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to use IoT-based D2D automation","description":"D2D communication typically refers to the technology that lets devices or appliances \u201ccommunicate\u201d without the use of network infrastructures.","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.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/","og_locale":"en_US","og_type":"article","og_title":"How to use IoT-based D2D automation","og_description":"D2D communication typically refers to the technology that lets devices or appliances \u201ccommunicate\u201d without the use of network infrastructures.","og_url":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/","og_site_name":"Engineers Garage","article_publisher":"https:\/\/www.facebook.com\/engineersgarage","og_image":[{"width":963,"height":571,"url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM.png","type":"image\/png"}],"author":"EG Projects","twitter_card":"summary_large_image","twitter_creator":"@EngineersGarage","twitter_site":"@EngineersGarage","twitter_misc":{"Written by":"EG Projects","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#article","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/"},"author":{"name":"EG Projects","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/46bbd53b9db1c5d1580cd604e3d6a2f2"},"headline":"How to use IoT-based D2D automation","datePublished":"2025-03-30T22:20:47+00:00","dateModified":"2025-04-20T11:06:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/"},"wordCount":940,"commentCount":0,"publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"image":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM.png","keywords":["Arduino","automation","circuit","communication","d2dcommunication","IoT","MQTT"],"articleSection":["Electronic Projects","PIC Microcontroller"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/","url":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/","name":"How to use IoT-based D2D automation","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#primaryimage"},"image":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM.png","datePublished":"2025-03-30T22:20:47+00:00","dateModified":"2025-04-20T11:06:31+00:00","description":"D2D communication typically refers to the technology that lets devices or appliances \u201ccommunicate\u201d without the use of network infrastructures.","breadcrumb":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#primaryimage","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM.png","width":963,"height":571},{"@type":"BreadcrumbList","@id":"https:\/\/www.engineersgarage.com\/how-to-use-iot-based-d2d-automation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.engineersgarage.com\/"},{"@type":"ListItem","position":2,"name":"How to use IoT-based D2D automation"}]},{"@type":"WebSite","@id":"https:\/\/www.engineersgarage.com\/#website","url":"https:\/\/www.engineersgarage.com\/","name":"Engineers Garage","description":"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News","publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.engineersgarage.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.engineersgarage.com\/#organization","name":"Engineer's Garage - WTWH Media","url":"https:\/\/www.engineersgarage.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","width":372,"height":52,"caption":"Engineer's Garage - WTWH Media"},"image":{"@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/engineersgarage","https:\/\/x.com\/EngineersGarage","https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw"]},{"@type":"Person","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/46bbd53b9db1c5d1580cd604e3d6a2f2","name":"EG Projects","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/258abb93057dea88a2a5a7616dccf9a0dc3a77d050ca970493853035a0e6f634?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/258abb93057dea88a2a5a7616dccf9a0dc3a77d050ca970493853035a0e6f634?s=96&r=g","caption":"EG Projects"},"url":"https:\/\/www.engineersgarage.com\/author\/eg-projects\/"}]}},"featured_image_src":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM-600x400.png","featured_image_src_square":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2021\/08\/Screen-Shot-2021-08-04-at-7.10.49-PM-600x571.png","author_info":{"display_name":"EG Projects","author_link":"https:\/\/www.engineersgarage.com\/author\/eg-projects\/"},"_links":{"self":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/64649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/users\/394"}],"replies":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/comments?post=64649"}],"version-history":[{"count":0,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/64649\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media\/64653"}],"wp:attachment":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media?parent=64649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/categories?post=64649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/tags?post=64649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}