Smart Home Hub - IoT Project

by amitkamin131 in Circuits > Arduino

70 Views, 0 Favorites, 0 Comments

Smart Home Hub - IoT Project

Final Project TOA
Smart home hub.png
Screenshot 2025-04-09 at 19.34.40.png

Hey! We're Omer, Amit, and Theo, and we're excited to show you our final project: a cool smart home hub that we built. This project is all about connecting the physical stuff in your house (like sensors and lights) with the digital world.

Basically, we wanted to create a system that makes your home a little smarter and more responsive. It's got a bit of everything: an alarm that helps you wake up and tracks your sleep, an anti-theft system to keep things secure, and even a closet that changes its LED lights depending on the weather outside!

We used an ESP32 microcontroller as the brain of the whole operation, and we hooked it up with Blynk for the user interface and Make.com to connect to other online stuff. So, let's dive in and see how it all works!

For each scenario, we uploaded the video in the exact seconds of where it is shown :)


*** For some reason some of the photos are not showing on desktop but they are working on the phone

Supplies

System Wiring Setup.png

Hardware Components

  1. ESP32 Development Board - We use ESP32-WROOM-32.
  2. Micro USB Cable
  3. Speaker a small speaker to play the alarm sounds.
  4. Joystick for turning off the alarm
  5. Ultrasonic Sensor to detect movement for the anti-theft system.
  6. IR Transmitter to send infrared signals
  7. NeoPixel LED Strip for the weather-reactive closet lighting. The code uses 24 LEDs, but you can adjust this.
  8. Light Sensor to detect when the closet is opened.
  9. Jumper Wires to connect components.

Tools Required

  1. Computer To program the ESP32.
  2. Arduino IDE The software we'll use to write and upload code to the ESP32. We used 2.3.5 IDE.
  3. Fritzing - We used fritzing.org for visualizing the connections. We've added the file but this is actually a paid software.
  4. Duct Tape

There might be alternative components or tools you can use depending on your specific needs and what you have available.

Project Overview and Architecture

Image 09-04-2025 at 9.16.jpg

The main idea is that we've got the ESP32 microcontroller at the center of everything. It's in charge of processing data, controlling all the devices, and communicating with the outside world. We're using Blynk to let you interact with the system (like controlling it from your phone) and Make.com to connect it to other online stuff and make things happen automatically.

The information moves around the "Real" and "Digital" worlds:

From the Real World to the Digital World: The sensors (joystick, ultrasonic sensor, and light sensor) collect information from the environment and send it to the ESP32. The ESP32 then processes this information and sends it to Blynk or Make.com.

From the Digital World to the Real World: Blynk sends commands to the ESP32, and the ESP32 then controls the actuators (like the speaker, the NeoPixel LEDs, and the IR transmitter) to do things.

There are 6 scenarios in the project:

  1. Alarm and Sleep System: Manages alarms, tracks sleep, and sends notifications. This one actually contains 2 separate scenarios, one for turning on the alarm and one for turning off.
  2. Anti-Theft System: Detects intrusions, triggers alerts, and controls devices.
  3. Weather-Reactive LED Closet: Adjusts LED lighting based on weather conditions, to decide what to wear today.
  4. Water Bowl: Makes sure the dog has enough water before you leave home.
  5. Sound Monitor: Tracks sound levels to make sure 2-4 PM remains quiet.

Communication Flow:

  1. User (Blynk) → ESP32 → Actuators (speaker, LEDs, IR transmitter): For control and actions.
  2. Sensors (joystick, ultrasonic, light) → ESP32 → Blynk/Make.com: For data reporting and alerts.

Setting Up the Development Environment

Screenshot 2025-04-03 at 23.17.26.png

Software Installation:

  1. Install Arduino IDE (We personally like the new IDE, 2.3.5)
  2. Install ESP32 board support, the one you are using
  3. Required libraries: (If the code doesn't compile for some reason)
  4. BlynkSimpleEsp32
  5. WiFi
  6. HTTPClient
  7. TimeLib
  8. IRremote
  9. Adafruit_NeoPixel
  10. ArduinoJson

Development Environment Configuration:

  1. Configure Arduino IDE for ESP32
  2. Set serial monitor baud rate to 112500


Set Up Make

Picture1.png
Screenshot 2025-04-09 at 9.51.40.png
Screenshot 2025-04-09 at 9.51.48.png
Screenshot 2025-04-09 at 9.51.36.png

We're using Make.com to connect our smart home hub to the internet and automate some tasks.

Here's how we've set things up and how you can do it too:

  1. Create a Make.com Account:
  2. If you don't have one, go to the Make.com website and create an account. They have a free tier you can start with.
  3. Create a New Scenario:
  4. In Make.com, create a new scenario. This is where you'll define your automated workflow.
  5. Add a Webhook Module:
  6. We use webhooks to get data from our ESP32.
  7. Search for the "Webhook" module in Make.com and add it to your scenario.
  8. Choose the "Custom webhook" option.
  9. Click "Add" to create a new webhook. You can give it a name (e.g., "ESP32 Data").
  10. Make.com will give you a URL. This is your webhook URL that you'll need in your ESP32 code.
  11. Configure Your ESP32 Code to Send Data:
  12. In your ESP32 code (like in AlarmSystem.ino or AntiTheft.ino), we use the HTTPClient library to send data to the Make.com webhook URL.
  13. Including the URL: You'll see a line like this in our code:
const char* makeWebhookUrl = "YOUR_MAKE_WEBHOOK_URL"; // Replace with your actual URL
  1. Make sure to replace "YOUR_MAKE_WEBHOOK_URL" with the actual URL that Make.com gave you.
  2. Sending Data: When an event happens (like an alarm is triggered or an intrusion is detected), we send an HTTP request to the Make.com webhook.
http.begin(makeWebhookUrl);
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
String httpRequestData = "noise_alert=0&dog_feeding=0&burgler_alert=1&hours_slept=8"; // Example data
int httpResponseCode = http.POST(httpRequestData);
  1. This code sends data like whether there's a noise alert, dog feeding info, a burglar alert, and hours slept. You'll need to adjust the data you send based on what you want to do in Make.com.
  2. Configure Make.com to Receive and Process Data:
  3. After your ESP32 sends data to the webhook, go back to your Make.com scenario.
  4. You should be able to see the data that the ESP32 sent in the Webhook module.
  5. Now you can add other modules to your scenario to do something with that data.
  6. Testing:
  7. Test your setup by triggering the events in your system (e.g., simulate an intrusion).
  8. Check Make.com to make sure it's receiving the data correctly and performing the actions you've set up.


Set Up Blynk

IMG_0314.jpeg
IMG_3051.jpeg
Screenshot 2025-04-09 at 14.18.51.png

Blynk is the platform we're using to create a user-friendly interface for our smart home hub. It lets you control the system from your smartphone and see what's going on. Here's how we set it up and how it works:

1. Blynk Setup:

  1. Create a Blynk Account:
  2. Download the Blynk app on your phone (available for iOS and Android) and create an account.
  3. Create a New Project:
  4. In the Blynk app, create a new project.
  5. Give it a name (e.g., "Smart Home Hub").
  6. Choose your hardware type (in our case, ESP32).
  7. Blynk will give you an Auth Token. This is a unique code that your ESP32 uses to connect to your Blynk project.
  8. Add Widgets:
  9. Blynk uses "widgets" to create the user interface. You can add things as you can see in the picture above.
  10. In our project, we're using widgets to:
  11. Set the alarm time.
  12. Enable or disable the alarm.
  13. Potentially display status information (you can expand on this).
  14. Configure Widgets:
  15. Each widget needs to be configured. This usually involves:
  16. Assigning a "Virtual Pin" to the widget. Virtual Pins are how the Blynk app communicates with your ESP32 code.
  17. Setting the widget's properties (e.g., the button's label).
  18. Include Blynk Library in ESP32 Code:
  19. In your ESP32 code, you need to include the Blynk library (BlynkSimpleEsp32.h).
  20. Connect ESP32 to Blynk:
  21. In your ESP32 code, you'll need to:
  22. Enter your Wi-Fi credentials (SSID and password).
  23. Enter the Auth Token that Blynk gave you.
  24. Use the Blynk.begin() function to connect to the Blynk server.
  25. Use Virtual Pins in ESP32 Code:
  26. You'll use the Virtual Pins you assigned to your widgets in your ESP32 code to send and receive data.
  27. You can see which Virtual Pin we used for each box of information in the second picture.
  28. For example:
  29. To send data to a Blynk widget, you'd use Blynk.virtualWrite(V1, value); (where V1 is the Virtual Pin).
  30. To receive data from a Blynk widget, you'd use BLYNK_WRITE(V1) (this is a function that gets called when the value of Virtual Pin V1 changes).

2. Blynk App on the Phone:

  1. User Interface: The Blynk app on your phone provides the user interface for controlling and monitoring your smart home hub.
  2. Important Note - for some reason the Blynk interface on desktop and on the phone don't really communicate well, and what works on the phone didn't work for us on desktop.
  3. As you can see in the picture, we are displaying a couple of things:
  4. Alarm status & time
  5. Weather temprature
  6. Noise level + Text label
  7. Bowl of water status
  8. Home alarm status + LED

Example: Alarm Control with Blynk

  1. In the Blynk app, you might have:
  2. A Time Input widget assigned to Virtual Pin V0.
  3. A Button widget assigned to Virtual Pin V1.
  4. In your ESP32 code:
  5. The BLYNK_WRITE(V0) function would handle receiving the alarm time from the Time Input widget.
  6. The BLYNK_WRITE(V1) function would handle receiving the alarm enable/disable command from the Button widget.
  7. You might use Blynk.virtualWrite() to send alarm status or sleep data back to the Blynk app (if you want to display it).


Set Up Tomorrow.io

Screenshot 2025-04-09 at 9.46.05.png
Screenshot 2025-04-09 at 9.48.19 1.png

In our project, we're using the Tomorrow.io API to get real-time weather data. This allows our Weather-Reactive LED Closet to change its LED colors based on the current weather conditions. Here's how to set it up:

  1. Create a (FREE) Tomorrow.io Account:
  2. If you don't have one, go to the Tomorrow.io website (https://www.tomorrow.io/) and create an account.
  3. You'll need to sign up to get an API key
  4. Get Your API Key:
  5. Once you've created an account, go to your Tomorrow.io dashboard to find your API key.
  6. This key is a unique string of characters that you'll need to include in your ESP32 code to access the weather data.
  7. Include the API Key in Your ESP32 Code:
  8. In your WeatherCloset.ino code, you'll need to add your Tomorrow.io API key.
  9. You'll see a line similar to this:
#define API_KEY "YOUR_TOMORROW_IO_API_KEY" // Replace with your actual API key
  1. Specify Your Location:
  2. The Tomorrow.io API needs to know the location for which you want to get weather data.
  3. In your code, you're likely using coordinates (latitude and longitude) to specify the location.
  4. For example:
#define LOCATION "32.161,34.849" // This is Herzliya, Israel
  1. Make sure the LOCATION is set to the correct coordinates for your desired location. You can find these coordinates on Google Maps or other mapping services.
  2. Understand the Weather Data:
  3. The Tomorrow.io API provides various weather data points. In your code, you're likely using temperature and rain information.
  4. Familiarize yourself with the Tomorrow.io API documentation to understand the available data and how it's formatted. This will help you interpret the data in your ESP32 code.
  5. Test the API Integration:
  6. After you've added your API key and location, upload the code to your ESP32 and test the Weather-Reactive LED Closet.
  7. Check if the LEDs are changing color correctly based on the weather data.
  8. Use the Serial Monitor to debug any issues and see the raw data being received from the API.

Important Notes:

  1. API Usage Limits: Be aware of the usage limits of your Tomorrow.io API plan. If you exceed these limits, your API requests may be blocked.
  2. Error Handling: Implement error handling in your ESP32 code to deal with potential issues like API connection errors or invalid data. We had lots of those.
  3. Tomorrow.io Documentation: Refer to the official Tomorrow.io API documentation for detailed information on their API and its features.


Alarm Clock 2 Scenarios

Screenshot 2025-04-09 at 19.33.03.png

https://youtu.be/qRPGj36vkL0?t=51

A user activates the alarm system remotely through the Blynk mobile app before going to sleep. This sens a command to the ESP32 microcontroller, storing the timestamp and enabling the alarm system.

At a preset wake-up time, the ESP32 triggers a speaker to play an alarm sound. The alarm continues until the user physically interacts with the system by pressing a joystick button.

This single physical action triggers three things:

1. The alarm sound stops (digital-to-physical interaction ends).

2. The Blynk interface updates, showing the alarm is deactivated (physical-to-digital feedback).

3. A timestamp of when the alarm was stopped is sent to Make.com, which calculates the sleep duration based on the activation time and stores the result in a Google Spreadsheet.

Over time, the spreadsheet provides a visual log of sleep patterns throughout the week — offering insights into user behavior and sleep consistency. This project is actually a combination of two distinct flows: a digital-to-physicalsystem, where a cloud-based trigger (Blynk) initiates a real-world action (activating the alarm speaker), and a physical-to-digital system, where a hardware interaction (joystick press) sends data back to online platforms (Blynk and Make.com). Together, they form a complete, bidirectional IoT experience.

Anti Theft Scenario

Screenshot 2025-04-09 at 19.34.00.png

https://youtu.be/qRPGj36vkL0?t=166

This project uses an ESP32, an ultrasonic distance sensor, an IR transmitter, the Blynk IoT platform, and Make.com to detect motion and respond with automated deterrents and real-time alerts.

When the user enables “alarm mode” through the Blynk mobile app, the ESP32 begins monitoring the area using the ultrasonic sensor. If motion is detected within a preset distance (less than 80 cm), the system performs two actions:

1. It sends an IR command to a Samsung TV using the IRremote library, turning it on to simulate someone being home.

2. It sends a webhook request to Make.com, which then forwards an alert via Telegram, notifying the user of a potential intrusion.

The system also updates Blynk (virtual pin V5) whenever motion is detected, allowing the user to track activity through the app.

This project demonstrates a digital-to-physical flow, where logic and triggers within the ESP32 result in real-world actions — including IR device control and cloud-based alerting.

Downloads

Dog's Water Bowl Scenario

Screenshot 2025-04-09 at 19.32.48.png

https://youtu.be/qRPGj36vkL0?t=12

This project uses an ESP32, a water level sensor, the Blynk IoT platform, and Make.com to help ensure a pet’s water bowl isn’t forgotten when leaving the house.

The system regularly checks the bowl’s water level using an analog sensor connected to the ESP32. If the bowl is empty, a warning message appears in the Blynk app, updating the status to “NOTICE! Bowl is EMPTY.” If water is present, the status displays “Bowl is FULL.”

Before heading out, the user can activate an “alarm mode” through the Blynk app. If the alarm is on and the bowl is empty, the ESP32 automatically triggers a webhook to Make.com, which sends a Telegram message reminding the user to refill the bowl. This alert only sends once per event, so it won’t flood the user with messages unless the conditions reset.

The system combines local sensing with cloud-based messaging, making it easy to monitor and act on real-world conditions in real time. This project demonstrates a physical-to-digital flow, where data from the physical environment is captured, interpreted, and pushed to cloud services for meaningful and timely action.

Downloads

Sound Monitoring Scenario

Screenshot 2025-04-09 at 19.33.38.png

https://youtu.be/qRPGj36vkL0?t=125

This project monitors sound levels in a home environment using an ESP32 and a sound sensor. The system samples ambient noise every second and calculates an average over a 15-second period.

If the average sound level exceeds a defined threshold, the ESP32 sends a notification to Make.com, which forwards the alert via Telegram. This allows the user to be notified in real time if there’s unusually high noise in the house — even when away.

The ESP32 also sends continuous updates to Blynk, including both the numeric sound level and a simple status label (“LOW”, “MED”, or “HIGH”) to indicate the current noise environment.

This project demonstrates a physical-to-digital flow, where real-world sound is detected, interpreted, and transmitted to cloud services for remote monitoring and notification.

Downloads

Weather Closet Scenario

Screenshot 2025-04-09 at 19.33.23.png

https://youtu.be/qRPGj36vkL0?t=104

This project uses an ESP32, a light sensor, a NeoPixel LED strip, the Blynk IoT platform, and a custom Weather APIintegration to display real-time weather conditions inside a closet. The goal is to give the user a quick, visual representation of the weather at their workplace — right when they open their closet to get dressed.

The system works by monitoring ambient light using a photoresistor connected to the ESP32. When the closet door is opened and light is detected (indicating activity), the ESP32 fetches the current temperature from a weather API for a preset location (e.g. the user’s office). Based on the temperature value, the NeoPixel LEDs light up in a color that reflects the outdoor conditions:

Blue for cold temperatures

Red for hot temperatures

Gradient transitions between blue-yellow-red for intermediate values

The temperature is also sent to Blynk, where it’s displayed in real time for remote viewing. The system automatically checks for weather updates periodically while active, and turns off the LEDs when the closet is closed (no light detected).

This project demonstrates a digital-to-physical flow: weather data from the internet is processed and transformed into a physical visual cue using colored lighting, creating an intuitive and automated ambient weather display.


*** IMPORTANT NOTE: Change Weather.ino to Weather.h! (We had a problem to upload it for some reason)

Testing and Troubleshooting

IMG_2972.jpeg

A thorough testing process is crucial. So we broke down tests we did ourselves in order to ensure functionality.

Every basic test we used the premade sketches found in the Arduino library.

1. Individual Component Testing

  1. ESP32:
  2. Upload simple "Hello World" sketches to verify basic functionality.
  3. Test Wi-Fi connectivity by connecting to your network and printing the IP address to the Serial Monitor.
  4. Blynk:
  5. Test Blynk connectivity with basic control widgets (e.g., a button to turn an LED on/off).
  6. Ensure that data is correctly sent and received between the ESP32 and the Blynk app.
  7. Make.com Integration:
  8. Set up a simple webhook in Make.com and trigger it from your ESP32 code.
  9. Verify that Make.com receives the data correctly.
  10. Sensors:
  11. Use simple test sketches to read sensor values and print them to the Serial Monitor.
  12. Check for accurate and consistent readings.
  13. Actuators (Motors, LEDs):
  14. Test each actuator individually to ensure it functions as expected.
  15. For servo motors, check the range of motion and accuracy.
  16. For LEDs, check for correct color and brightness control.

2. System Integration Testing

  1. Digital-to-Physical Interface:
  2. Test the web-based control panel (if applicable) to ensure it correctly controls the motors and LEDs.
  3. Verify that the physical actions match the digital commands.
  4. Physical-to-Digital Interface:
  5. Test the sensor input and button/switch interface.
  6. Ensure that physical actions are correctly translated into digital signals.
  7. End-to-End Testing:
  8. Test the complete system by simulating real-world scenarios.
  9. For example, trigger an alarm event and verify that it's correctly detected, the notification is sent via Make.com, and the alarm is activated.

3. Troubleshooting

When troubleshooting, try to make the code really simple and use the serial Monitor to inspect what went wrong.

Common bugs we had:

  1. Weird fatal errors - we connected too many components at once.
  2. API errors - we set wrong API keys or didn't configure it correctly on the website itself.
  3. Wrong Data Input - we didn't connect the components to the correct pins.


Serial monitor can be found on the top right, the second one:

Enhancements and Future Work

This project only works on a small buy varied scenarios that can actually be very useful for one to use at his home.

If you have more time and more sensors, there are many other cool ideas to implement.

For example some other ideas we had but didn't implement:

  1. Pet Care:
  2. Automate pet feeding or monitor pet activity.
  3. Garden Monitoring:
  4. Monitor soil moisture, temperature, and sunlight levels.
  5. Automate watering systems.
  6. Energy Monitoring:
  7. Track energy consumption in the home.
  8. Identify areas where energy can be saved.


Final Notes

This project demonstrates the practical application of IoT concepts and technologies we learned throughout a very cool course we learnt in Reichman University.

This project has provided us with valuable experience in several key areas. We gained practical skills in microcontroller programming, specifically working with the ESP32, including its Wi-Fi capabilities and interfacing with various peripherals.

We also developed integration, implementing and processing data from different types of sensors, and actuator control, managing output devices like speakers, LEDs, and IR transmitters. Furthermore, we deepened our understanding of IoT communication protocols, utilizing methods through Blynk and Make.com. The project also enhanced our abilities in system design and architecture, as we designed a modular and interconnected IoT system. Finally, we honed our problem-solving and debugging skills by identifying and resolving technical challenges throughout the development process.