{"id":159435,"date":"2025-03-18T16:27:00","date_gmt":"2025-03-18T10:57:00","guid":{"rendered":"https:\/\/www.electronicsforu.com\/?p=159435"},"modified":"2025-03-19T16:46:34","modified_gmt":"2025-03-19T11:16:34","slug":"control-multiple-ac-appliances-wirelessly","status":"publish","type":"post","link":"https:\/\/www.electronicsforu.com\/electronics-projects\/control-multiple-ac-appliances-wirelessly","title":{"rendered":"Wirelessly Control Multiple AC Appliances with Web Interface"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"161\" height=\"147\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Ashwini-EFY-Tested-1.webp\" alt=\"Electronics For You Project\" class=\"wp-image-159678\"\/><\/figure><\/div>\n\n\n<p>In today&#8217;s era of the Internet of Things (IoT), smart home automation has evolved from being a luxury to an accessible and essential part of modern living. This project demonstrates a scalable and real-time home automation system built around the powerful <a href=\"https:\/\/indus.electronicsforu.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">IndusBoard Coin<\/a>, a compact development board based on the <a href=\"https:\/\/www.electronicsforu.com\/technology-trends\/esp32\">ESP32-S2 microcontroller<\/a>. <\/p>\n\n\n\n<p>The system allows users to wirelessly control multiple <strong>AC appliances like lights and fans<\/strong> through an interactive web interface hosted directly on the board itself, without requiring any external cloud services or mobile apps.<\/p>\n\n\n\n<p>Unlike traditional automation systems that only offer ON\/OFF control through relays, this project takes a step ahead by integrating <strong>PWM-based fan speed control<\/strong>, enabling smooth real-time adjustment of AC fan speed via a slider on the webpage. <\/p>\n\n\n\n<p>The board generates PWM signals from its GPIO pins, which are then sent to an <strong>AC Fan Speed Controller module<\/strong> that modulates the fan speed accordingly.<\/p>\n\n\n\n<p>At the same time, standard relay modules are used to control the switching of lights and fans. The Coin board\u2019s GPIOs are connected to the relay modules, acting as electronic switches for turning appliances ON or OFF with a simple tap on the web interface.<\/p>\n\n\n\n<p>The system runs on <strong>Wi-Fi Access Point (AP) mode<\/strong> by default, allowing users to connect their phones or laptops directly to the IndusBoard\u2019s Wi-Fi (SSID: IndusBoard_AP) and access the control panel through a browser. <\/p>\n\n\n\n<p>However, this can easily be modified to <strong>Station Mode (STA)<\/strong>, where the board connects to your home Wi-Fi network. In this mode, any device on the same network can access and control the system through the board&#8217;s local IP address, enabling seamless integration into existing smart homes.<\/p>\n\n\n\n<p>One of the major advantages of using the IndusBoard Coin is its <strong>high number of available GPIOs (30+ pins)<\/strong>, which means this system is not limited to just two lights and a fan. It can be <strong>easily scaled<\/strong> to control additional appliances by simply connecting more relays or PWM controllers to unused GPIOs and expanding the user interface accordingly. <\/p>\n\n\n\n<p>For example, additional buttons and sliders can be added to the webpage to control more lights, fans, or even future sensors like motion detectors, temperature sensors, or <a href=\"https:\/\/www.electronicsforu.com\/technology-trends\/learn-electronics\/ldr-light-dependent-resistors-basics\">LDRs<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"313\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Home-Automation-System-UI.jpeg\" alt=\"Home Automation System Project UI\" class=\"wp-image-159468\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Home-Automation-System-UI.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Home-Automation-System-UI-500x153.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Home-Automation-System-UI-696x213.jpeg 696w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig. 1: Home Automation System UI<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Bill of Material<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Components<\/strong><\/td><td><strong>Quantity<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td><strong>IndusBoard Coin<\/strong><\/td><td>1<\/td><td>IndusBoard Coin<\/td><\/tr><tr><td><strong>Relay Module (5V)<\/strong><\/td><td>1<\/td><td>Channel Relay Module (5V) 250V AC<\/td><\/tr><tr><td><strong>Fan Speed Controller Module<\/strong><\/td><td>1<\/td><td>Fan Speed Controller Module<\/td><\/tr><tr><td><strong>5V DC Adapter<\/strong><\/td><td>1<\/td><td>5V&nbsp; DC&nbsp;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Circuit Diagram<\/strong><\/h2>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;684ff01fdb630&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"572\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Wi-Fi-Based-AC-Control-Circuit.webp\" alt=\"Circuit Diagram to wirelessly control multiple AC appliances\" class=\"wp-image-159469\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Wi-Fi-Based-AC-Control-Circuit.webp 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Wi-Fi-Based-AC-Control-Circuit-500x279.webp 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Wi-Fi-Based-AC-Control-Circuit-752x420.webp 752w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Wi-Fi-Based-AC-Control-Circuit-696x389.webp 696w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Fig. 2: Circuit Diagram<\/figcaption><\/figure>\n\n\n\n<p>Here, <strong>IndusBoard Coin<\/strong> acts as the central brain of the entire smart home automation system. It not only processes control commands but also establishes wireless communication by creating a Wi-Fi Access Point (AP mode) or by connecting to an existing Wi-Fi network using Station (STA) mode. <\/p>\n\n\n\n<p>Through this connectivity, the Coin board hosts a real-time interactive webpage that allows users to control connected appliances directly from a browser. Using its multiple GPIO pins, the board sends digital control signals to various actuators such as relays and fan speed controller modules. <\/p>\n\n\n\n<p>The <strong>relay modules<\/strong>, connected to GPIO pins (for example, GPIO 3 for Light 1 &#8211; GPIO 6 for Light 4), serve as the switching interface for AC appliances like bulbs or fans. These relays function as electrically operated switches, toggled by the digital HIGH or LOW outputs from the Coin board. <\/p>\n\n\n\n<p>For fans, while a regular <a href=\"https:\/\/www.electronicsforu.com\/technology-trends\/learn-electronics\/relay-switch-pin-diagram\">relay<\/a> can only turn the fan ON or OFF, integrating a <strong>fan speed controller module<\/strong>, such as an AC dimmer or a PWM-compatible controller, enables variable speed control. <\/p>\n\n\n\n<p>This module receives a PWM signal\u2014typically from a pin like GPIO 21\u2014where the duty cycle or firing angle of the signal determines the actual fan speed. This allows for a smooth and precise adjustment of fan speed directly through the web interface, providing a complete and advanced smart automation experience.<\/p>\n\n\n\n<p>The relay module acts like an electronic switch that isolates and safely controls the AC side of the circuit. Each relay channel on the module has input control pins connected to one of the GPIO pins of the Coin board (for instance, GPIO 3 is connected to control Light 1, and GPIO 6 to control Light 2). <\/p>\n\n\n\n<p>When a digital HIGH signal is sent from the Coin board to the relay input pin, it triggers the internal electromagnetic coil inside the relay, which closes (or opens) a switch on the AC side, allowing current to flow through the connected appliance.<\/p>\n\n\n\n<p>To connect an <strong>AC bulb or other AC appliance<\/strong>, the <strong>Live (L)<\/strong> wire from the mains power supply is first connected to the <strong>Common (COM)<\/strong> terminal of the relay. The <strong>Normally Open (NO)<\/strong> terminal is then connected to one terminal of the AC bulb or appliance. The other terminal of the appliance is connected directly to the <strong>Neutral (N)<\/strong> wire of the mains supply. <\/p>\n\n\n\n<p>When the relay is activated by the Coin board, the circuit between COM and NO closes, completing the path and powering ON the appliance. When the relay is deactivated, the circuit breaks, and the appliance turns OFF.<\/p>\n\n\n\n<p>This configuration ensures that <strong>high-voltage appliances are safely switched<\/strong> using the <strong>low-voltage logic level<\/strong> control from the Coin board, keeping the user and the controller board isolated from dangerous AC voltages. <\/p>\n\n\n\n<p>Multiple such relays can be connected to multiple GPIO pins on the IndusBoard Coin to control several appliances individually and in real time from the web interface. <\/p>\n\n\n\n<p>Additionally, the system can be expanded easily due to the availability of over <strong>30+ GPIO pins<\/strong> on the Coin board, making it highly scalable and adaptable for larger smart home setups.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Code<\/strong><\/h2>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;684ff01fdd373&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"573\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/scscs-1024x573.jpeg\" alt=\"Code for Wirelessly Control Multiple AC Appliances with Web Interface\" class=\"wp-image-159438\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/scscs-1024x573.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/scscs-500x280.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/scscs-1536x859.jpeg 1536w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/scscs-751x420.jpeg 751w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/scscs-696x389.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/scscs.jpeg 1652w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Fig. 3: Code for Wirelessly Control Multiple AC Appliances with Web Interface<\/figcaption><\/figure>\n\n\n\n<p>The code begins with the definition of GPIO pins assigned to control various appliances like lights and fans. <\/p>\n\n\n\n<p>After that, a simple and interactive <strong>HTML webpage user interface (UI)<\/strong> is created within the code using embedded HTML and JavaScript, allowing users to control appliances in real time through any browser. The <strong>pinMode()<\/strong> function is used in the setup section to configure each GPIO pin as an output. <\/p>\n\n\n\n<p>The <strong>Wi-Fi settings<\/strong> are configured to enable <strong>Access Point (AP) mode<\/strong>, so the IndusBoard Coin can create its own wireless network for users to connect directly. <\/p>\n\n\n\n<p>The code also initializes the web server, defines routes to handle button clicks and fan speed control commands, and continuously checks for incoming client requests in the loop to ensure smooth operation of the automation system.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Testing<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"313\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/UI-1024x313.jpeg\" alt=\"Webpage UI for home automation\" class=\"wp-image-159439\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/UI-1024x313.jpeg 1024w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/UI-500x153.jpeg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/UI-1536x470.jpeg 1536w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/UI-1374x420.jpeg 1374w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/UI-696x213.jpeg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/UI.jpeg 1570w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">fig 4. Webpage UI for automation<\/figcaption><\/figure>\n\n\n\n<p>Now, power on the device and relay. Then, open the Wi-Fi settings on your phone or laptop and search for <strong>IndusBoard_AP<\/strong>. Connect to it using the password set in the code.<\/p>\n\n\n\n<p>Next, open a web browser and enter <strong>192.168.4.1<\/strong> in the address bar. From there, you can control appliances such as light bulbs, fans, and AC units. Use the slider bar to adjust the speed and the text input to set automation. The system will automatically turn off all appliances after the specified time.<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-c3142e21-c2af-4c87-b4e1-bb7df0184c60\" href=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Homeautomation.zip\"><strong>Source Code<\/strong><\/a><a href=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2025\/03\/Homeautomation.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-c3142e21-c2af-4c87-b4e1-bb7df0184c60\">Download<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In today&#8217;s era of the Internet of Things (IoT), smart home automation has evolved from being a luxury to an accessible and essential part of modern living. This project demonstrates a scalable and real-time home automation system built around the powerful IndusBoard Coin, a compact development board based on the ESP32-S2 microcontroller. The system allows [&hellip;]<\/p>\n","protected":false},"author":33369,"featured_media":159677,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,23,6070,7786,6189,11851],"tags":[11666],"class_list":{"0":"post-159435","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-electronics-projects","8":"category-hardware-diy","9":"category-advanced-projects","10":"category-ai-ml-projects","11":"category-esp32-projects","12":"category-super-innovative-projects","13":"tag-indusboard"},"_links":{"self":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/159435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/users\/33369"}],"replies":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/comments?post=159435"}],"version-history":[{"count":2,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/159435\/revisions"}],"predecessor-version":[{"id":159744,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/159435\/revisions\/159744"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media\/159677"}],"wp:attachment":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media?parent=159435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/categories?post=159435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/tags?post=159435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}