ESP32 Projects

ESP32 Bluetooth Relay Control with Android App

Last Updated on October 24, 2025 by Engr. Shahzada Fahad

Description:

Imagine controlling all your home appliances with just your Smartphone; even when WiFi is down.

Today, I will show you how I built a Bluetooth-based relay control system using the ESP32-S3 and my own custom Android application designed and programmed in Android Studio.

Android application controlling relays via ESP32 Bluetooth Relay Control

And trust me, it’s faster and more reliable than you think!

This is my 3rd article on the MaTouch 1.28” Toolset Timer Switch Relay from Makerfabs.




In my last article, I showed you how to turn the MaTouch 1.28” Toolset Timer Switch Relay into a smart home controller using the ESP32S3 and Blynk IoT app.

ESP32 Bluetooth Relay Control and Blynk app working together

The best part was the real-time synchronization; whether you switched a load ON or OFF from the display or from the Blynk app, both interfaces updated instantly. Plus, I made the system reliable enough to work online and offline, so even if WiFi dropped, the touchscreen UI still worked smoothly. This project gave us complete remote appliance control, smart automation, and a polished user interface; perfect for anyone interested in home automation, IoT projects, and ESP32 smart switches.

And for the hardware overview and software setups; read the first article.

Touch screen relay board for ESP32 Bluetooth Relay Control smart home project



Anyway, I liked this kit so much that I decided to make my own custom Android application for it. I kept the app very simple; no fancy images on the buttons; so even beginners can easily make changes and customize it in their own way.

Android Studio app designed for ESP32 Bluetooth Relay Control project

And yes, I built this application in Android Studio.

The full project folder is available on my Patreon.

Before starting the practical demo, there are a few important things I want to share with you.

Makerfabs touch screen relay board for ESP32 Bluetooth Relay Control

As you can see right now, the kit is powered ON, but the display is completely blank. That’s because this time, I did not use the display at all; I also ignored the encoder and the button.

I am pretending as if this board doesn’t even have a display, encoder, or button.

I am only using the ESP32-S3 and the relay board. The benefit of this is simple; the code I share with you will work on any ESP32 board without changes. And later, if you want more features, you can easily add them according to your needs.



So, you can think of today’s project as a template project for building Bluetooth-based projects.

It’s not that we won’t use the display, encoder, or button; we definitely will.

In my next video, I will use this same kit to build a Smartphone-based complete control system for a bike. In that project, we will use the display, encoder, and button to accept or reject calls, and even control the bike’s engine. So, make sure to subscribe if you don’t want to miss that video and article.

Anyway, let’s begin with the practical demonstration.

I have already paired the mobile application, just like we normally pair apps with any Bluetooth-supported device.

Simple Android application UI for ESP32 Bluetooth Relay Control

At the top, you can see this Bluetooth switch. I added it just as an example; you can rename it later and use it for any other purpose, or you can keep it as a connect and disconnect switch for Bluetooth.

To control the 4 relays, I have added 4 buttons. Of course, you can increase or decrease the number of buttons according to your own needs.

And finally, the SCAN and Connect buttons are very simple; their function is clear from their names.

And in that area where you can see “Log output will appear here…” , acknowledgment messages will be displayed; like when a relay turns ON or OFF.

This way, we know for sure whether the command we sent was successfully executed or not.

This feature is very useful in situations where the device is not in front of us; for example, if we are in the bathroom and want to turn the water pump ON or OFF.

Here, if you want, you can also display sensor values.



Now, let’s control all four relays.

Real-time relay feedback in Android app for ESP32 Bluetooth Relay Control

As you can see, the moment I pressed the Relay 1 button, the relay turned ON, and at the same time I received the feedback message “Relay 1 ON.”

Let me turn it OFF; and this time, I instantly received the feedback message “Relay 1 OFF.”

Feedback acknowledgment system in ESP32 Bluetooth Relay Control Android app

In the Video tutorial, I have also practically demonstrated that how fast this entire system is.

So, I highly recommend watching the Video tutorial given at the end of this article.

So now, let’s move on and take a look at the programming.




ESP32 BLE Programming:

Sample ESP32 Bluetooth Relay Control code for Android Studio project

Don’t get scared by looking at the code. All of the files you see here are not even used in this project. As I already mentioned, we are only using the Bluetooth and a few GPIO pins.

These extra files were generated from SquareLine Studio in my previous project. If you want, you can delete all of them except the main .ino file.

I am not deleting them because later, if you want to use this project with a UI, these files will already be there to make things easier for you.

In fact, I will be modifying this same project in my next video, where I will build a bike control system with full smartphone integration.

I already explained the uploading method in Part 1, so I won’t repeat it here.

The complete source code of this project is available on my Patreon Shop.

So that’s all for now.



Watch Video Tutorial:

 


Discover more from Electronic Clinic

Subscribe to get the latest posts sent to your email.

Engr. Shahzada Fahad

Engr. Shahzada Fahad is an Electrical Engineer with over 15 years of hands-on experience in electronics design, programming, and PCB development. He specializes in microcontrollers (Arduino, ESP32, STM32, Raspberry Pi), robotics, and IoT systems. He is the founder and lead author at Electronic Clinic, dedicated to sharing practical knowledge.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Discover more from Electronic Clinic

Subscribe now to keep reading and get access to the full archive.

Continue reading

Electronic Clinic
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.