DIY Modular IoT Kit for Smart Home
by CodersCafeTech in Circuits > Arduino
444 Views, 4 Favorites, 0 Comments
DIY Modular IoT Kit for Smart Home
Smart homes are becoming increasingly popular, as more and more people are looking for ways to make their lives easier and more convenient. Smart home technology can be used to automate a wide range of tasks, from turning on the lights to adjusting the thermostat to locking the doors and much more.
According to a recent report by Statista, the global smart home market is expected to grow from $103.7 billion in 2022 to $387.4 billion by 2028. This growth is being driven by a number of factors, including the increasing availability of affordable smart home devices, the growing popularity of voice assistants, and the increasing awareness of the benefits of smart homes.
Another recent report, by Juniper Research, predicts that the number of smart home devices in use worldwide will reach 83 billion by 2024. This represents a significant increase from the 22 billion smart home devices in use in 2020.
These statistics suggest that the smart home market is growing rapidly and that smart homes are becoming increasingly popular.
Smart homes offer many advantages, including:
- Convenience: Smart homes can make our lives easier and more convenient by automating tasks that we would otherwise have to do manually. For example, a smart thermostat can automatically adjust the temperature in our homes based on our preferences, and a smart lock can automatically unlock our doors when we arrive home.
- Energy efficiency: Smart homes can help us to save energy and money. For example, a smart thermostat can learn our heating and cooling habits and adjust the temperature accordingly to reduce energy consumption. Smart lights can also be programmed to turn off automatically when we leave a room.
- Security and safety: Smart homes can help to improve our safety and security. For example, a smart security system can alert us if there is an intrusion into our homes, and a smart smoke detector can alert us if there is a fire.
- Peace of mind: Smart homes can give us peace of mind by allowing us to monitor and control our homes remotely. For example, we can check the status of our security system or turn on the lights before we arrive home.
Despite the many advantages of smart homes, several hurdles prevent common people from implementing them. Some of these hurdles include:
- Cost: Smart home devices can be expensive, especially if you are trying to automate a large number of tasks in your home.
- Complexity: Installing and configuring smart home devices can be complex, especially for people who are not familiar with technology.
- Security and privacy concerns: There are some security and privacy concerns associated with smart homes, such as the risk of hackers gaining access to devices or the potential for companies to collect personal data about users' habits and preferences.
The Modular IoT Kit is a cheap, no-code, easy-to-setup, and secure solution for the above problems that are preventing common people from implementing smart homes.
Getting Started - How to Setup Your Own IoT Network
Before diving into the intricate details of constructing your Modular IoT Network Creator Kit, let's begin by exploring its core components and how to set them up so that you can read and visualize data from the sensor nodes and control your actuator nodes from the dashboard. Understanding these basics will pave the way for a smoother and more comprehensive setup process.
Kit Contents
The current version of the kit comes with five things,
- The Gateway
- An Environmental Sensor Node
- A Motion Sensor Node
- A Door Sensor Node
- A Smart Plug Node
We'll understand how each of them works later in this article. Now let's focus only on setting up the IoT network.
Setup Your IoT Network
The kit comes in such a way that all the codes are preinstalled on the boards, you just need to turn on the gateway as well as the nodes and they create an IoT network instantly. All you have to do is set up the dashboard to connect the gateway and sensors to the dashboard.
To do that follow these steps,
- Accessing the Modular IoT Dashboard: Open a web browser and navigate to the Modular IoT Dashboard. Upon arrival, you will see a blank dashboard interface.
- Adding Widgets to the Dashboard: Utilize the '+' icon on the landing page to add widgets to your dashboard. Widgets are graphical elements that display data from the connected nodes.
- Customizing Widgets: The dashboard widgets are resizable and draggable, offering versatility in design. Click the edit icon to link widgets to specific nodes and configure their appearance.
- Linking Widgets to Nodes: You'll find a link icon in the edit mode. Click on this icon to open a form. Enter the display name and the unique Node ID for the respective node. Repeat this process for each widget, linking them to the appropriate nodes.
- Associating the Dashboard with the Kit: Click on the user icon on the dashboard to access a form. Enter your name and the unique 'Kit ID' associated with your kit. This step links your dashboard to your Modular IoT Kit.
By following these steps, users can seamlessly set up their Modular IoT Kit, connect the nodes to the dashboard, and begin monitoring data from nodes and control them in a user-friendly and intuitive manner.
Data Flow in Modular IoT Network
The kit comprises a gateway equipped with an ESP32-S3 and a collection of nodes, each featuring an ESP32-C3 along with corresponding sensors or actuators. What sets this solution apart is its seamless connectivity through BLE (Bluetooth Low Energy) protocol, with nodes effortlessly connecting to the gateway, while the gateway establishes an internet connection via the ESP32-S3's Wi-Fi capabilities.
These nodes are powered by built-in batteries, ensuring flexibility in their placement, while the gateway is designed to draw power directly from a standard electrical socket. The sensor nodes diligently gather data from their surroundings and transmit it to a web-based dashboard through the MQTT protocol, where it can be conveniently visualized. Actuator nodes are equally accessible through the dashboard, allowing users to control them with ease.
The dashboard offers a wealth of features, including various widgets for data visualization, such as graphs, numerical displays, sliders, alerts, gauges, and buttons. It also allows users to create custom rules for actuators based on sensor inputs, affording a high degree of personalization.
The range of sensor nodes includes temperature sensors, barometric pressure sensors, humidity sensors, ambient light sensors, human presence and motion sensors, door sensors, and more, while actuators encompass smart plugs and smart light holders.
Gateway
The gateway serves as a central point for communication and data transfer between the nodes and the cloud. It is designed so that it can be easily plugged into the socket. So Let's see the components and brief making.
The ESP32-S3 is a critical component in the gateway and it is a highly capable microcontroller with built-in Wi-Fi and Bluetooth connectivity.
These are the features of ESP32-S3 which is utilized.
- High-Performance MCU: Equipped with an ESP32S3, a 32-bit dual-core processor running at up to 240MHz, capable of handling demanding tasks efficiently. It supports both Arduino and MicroPython development.
- Wireless Connectivity: Provides 2.4GHz WiFi and Bluetooth Low Energy (BLE) 5.0 connectivity, enabling seamless wireless communication. It supports long-range communication up to 100m with the U.FL antenna.
- Compact Design: The thumb-sized form factor (21 x 17.5mm) is perfect for space-constrained projects like wearables, making it highly versatile.
- Production-Ready: Designed with a breadboard-friendly and surface-mount layout, suitable for mass production. All SMD components are on a single-sided board for ease of manufacturing.
- Memory and Storage: Features 8MB of PSRAM and 8MB of Flash memory, providing ample storage and memory for data-intensive applications.
The PCB was designed in Easy EDA and the enclosure is 3d printed with the PLA filament with 20 percent infill. The Enclosure has two parts, The first one is the PCB holder and the second is its enclosure. The PCB can be easily attached to the PCB holder part with the help of Mx10mm screws.
For powering up the ESP32 S3 we used a Hi-Link power supply that can deliver 3 watts of power(5V 0.6A) with some decoupling capacitors.Small pins are used in the gateway to connect to the socket and these are taken from the 3-pin plug top.
Node
These are the Node we made which contain both the sensors and actuators. They are not limited to this, you can create your own. All these devices will have a custom PCB with 3D-printed case. All the PCBs used in this project were designed in Easy EDA software and fabricated from PCB Way. The ESP32 C3 powers all the nodes, The reason why we opted for it is due to its small form factor and ability to connect the lipo battery directly and also charge them easily without any additional charge controller.
Environmental Sensor Node
This node will fetch the air quality details such as Temperature, Humidity, and Pressure through the BME680 sensor. We used the I2C protocol for communicating between ESP32 C3 and BME680. ESP32 C3 will update the value to the gateway only once every 10 minutes while utilizing deep sleep mode. All the nodes have this kind of SPDT push switch for turning ON/OFF the device and also this 400 mah lipo battery for powering up, except the smart plug.
Motion Detector Node
This node uses MH-SR602 MINI Motion Sensor Detector to detect human motions.In this node also, we use the deep sleep capability of the controller. This ESP will be in deep sleep every time unless a trigger is given to the ESP32 by the PIR motion sensor whenever the motion is detected. When it wakes up it will give the message to the gateway and again goes back to the deep sleep.
Door Sensor Node
This node is powered by magnetic reed switches and magnets. Employing normally open magnetic reed switches, the node closes its circuit only when a magnet attaches to it, remaining open when no magnet is present. The reed switch is configured in a pull-down setup.
Functionally, this node operates similarly to the motion detection node. The key distinction lies in the triggering mechanism for the interrupt. Instead of relying on a motion sensor, the interrupt is initiated by the magnetic reed switch when someone opens the door. Subsequently, the node transmits a corresponding message to the gateway.
Powerful Neodymium magnets are used here to activate the reed switches.
Smart Plug Node
It's the only node that is controlled through the dashboard. So we can connect appliances to it and we can control it from anywhere in the world.
Here the ESP is powered through the Hi link power supply which can provide 0.6A. The solid-state relay unit is used to control the AC appliances by combining three-pin plugs of both male and female.
The whole structure of the Smart Plug and the gateway are the same, but the Smart Plug has this extra AC socket and also the relay unit.
Web Dashboard Development
The customizable dashboard is a versatile web application crafted using HTML, CSS, and JavaScript. It serves as a user-friendly interface for monitoring and managing data stored in the Firebase Realtime Database or Firestore. The dashboard's key features include a drag-and-drop interface and a plethora of widgets, allowing users to customize their views based on their preferences.
Dashboard Structure:
- HTML/CSS Layout: The dashboard's layout is structured using HTML and styled with CSS, ensuring a visually appealing and intuitive interface.
- JavaScript Functionality: JavaScript provides interactive functionalities, handling widget manipulation, drag-and-drop functionality, and dynamic data rendering.
Drag-and-Drop Widgets:
The dashboard offers an array of customizable widgets, enhancing the user experience
- Text Widget: Enables users to display and edit text dynamically, catering to various information display needs.
- Gauge Widget: Provides visual representations of numeric data, offering quick insights at a glance.
- Slider Widget: Empowers users to control variables or settings through an interactive sliding mechanism.
- Chart Widget: Renders data in various graphical formats like line, bar, and pie charts, aiding in data visualization.
- Switch Widget: Offers an intuitive on/off switch for controlling functionalities or devices seamlessly.
- Alert Widget: Displays notifications or alerts based on preset conditions or events, enhancing user awareness.
Functionality:
- Drag-and-Drop Interface: Allows effortless customization by enabling users to arrange widgets using simple drag-and-drop actions.
- Widget Customization: Provides options to configure and customize each widget's appearance, behavior, and data source.
Future Improvements
The future of the Modular IoT Kit holds great promise with advancements in artificial intelligence, analytics, and predictive maintenance. AI integration can enhance the kit's capabilities by enabling proactive decision-making. Machine learning algorithms can predict sensor behavior, anticipate potential issues, and automate responses. Predictive maintenance, powered by AI, can detect anomalies in sensor data, allowing for timely repairs or replacements.
Additionally, advanced analytics can offer deeper insights into usage patterns, optimizing energy efficiency and enhancing user experience. The integration of voice assistants or natural language processing can enable voice-activated control of the kit, further simplifying user interaction. With AI and analytics, the kit's potential for personalization and efficiency is boundless, making it a crucial tool in the era of smart living and industry.
With the Modular IoT Kit, setting up a smart home no longer requires specialized expertise. This kit combines simplicity and power, turning the complex IoT landscape into an accessible and exciting playground. Embrace a future where innovation knows no bounds, and connectivity is effortless. Welcome to the Modular IoT Kit—your gateway to a simpler, smarter tomorrow