Bluetooth Controlled Ceiling LED Strip lights, 220Vac Led Strip Bluetooth controller
Table of Contents
Bluetooth Controlled Ceiling LED Strip:
Bluetooth Controlled Ceiling LED Strip lights, 220Vac Led Strip Bluetooth controller- “Finally, the work of installing LED strips in my room is done. As you can see, I have used 3 different colored LED strips. These LED strips run on a 220Vac supply. And these are simple LED strips, there is no remote controller, so right now I can’t turn these LED strips ON or OFF remotely.
So I am thinking of designing a Bluetooth application for this, so that I can easily control these ceiling lights from my bed. By the way, readymade LED strip lights are also available that come with a remote controller. You can also purchase them. But there is a different fun in making a control system with your own hands.
For this project, I am going to use ESP32 WiFi + Bluetooth Module. You can also use Arduino, but it will increase the project overall cost. And with Arduino, you can’t show much creativity.
But if you use the ESP32 controller board, then the cost of your project will decrease because you don’t have to purchase the Bluetooth module separately, its available on the ESP32 board itself. And in addition to that, ESP32 has WiFi as well, so you can make an IoT application for it in the future by using Blynk IoT. And this way, you will be able to control your ceiling lights from any part of the world. I have already written several articles on this. Anyway, before I am going to explain the connections and programming first let’s watch this Bluetooth Controlled Ceiling LED Strip lights controller in action.
JLCPCB Sponsor:
Feel free to visit their website https://jlcpcb.com/SKL to not only find out what awesome PCB and Assembly services they offer, but also to easily upload your Gerber files and thus order affordable and high-quality PCBs quickly. You will only need to pay 2 dollars for 1- 4 layers PCBs, and 0 dollars for your PCB assembly. Besides this JLCPCB also offers industrial 3D printing services starting at only 1 dollar.
My ESP32-based Led Strips Bluetooth controller is already powered up and right now you can’t see it, because it’s hidden. Before, controlling the Ceiling LED Strips using my mobile application. First, I paired the ESP32 Bluetooth with my cell phone. Then I opened my application and selected the desired device. For the step-by-step explanation, you can watch the video tutorial given at the end of this article.
Using this application I can control 4 loads. But since I have installed 3 Led strips so I am going to use the first 3 buttons to control all three LED strips. The first button I am using to control the Golden Color Led Strip.
The 2nd button on my smart phone application is used to control the Blue color LED strip.
And the 3rd button on my Led strips controller Bluetooth application is used to control the Green color Led strip.
So, this is exactly what you are going to learn after reading this article. So, without any further delay let’s get started!!!
Amazon Links:
ESP32 WiFi + Bluetooth Module(Recommended)
*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.
Bluetooth Controlled Ceiling LED Strip lights Circuit:
J1 is the Dc female power jack and this is where we connect a 12v adaptor, battery or a solar panel. Two 470uf capacitors are connected at the input and output sides of the voltage regulator. The output of the voltage regulator is connected with the 5v pin of the ESP32 module and the ground of the power supply is connected with the ground of ESP32 module.
These are 12v SPDT type relays and can’t be directly controlled using the ESP32 Module, So, that’s why we need a driver to control these relays. You can use a relay driver IC or you can use 2n2222 NPN transistor and a 10k resistor. One pin of the relay coil is connected with the collector of the 2n2222 NPN transistor while the other pin of the relay coil is connected with the 12 volts. The emitter of the transistor is connected with the ground while the base is connected with the 10k ohm resistor.
Now to control these relays you simply need to connect these 10k resistors with the ESP32 I/O pins. In this project, I am using the GPIO pins 13, 12, 14, and 27. I will be using the same pins in the programming.
The neutral wire from the 110/220Vac supply is connected with the neutral of all the LED strips. While the Live wire from the AC supply is connected with the LED strips through these relays.
PCBs from JLCPC:
These are the PCBs I received from JLCPCB. As you can see, the quality is really great, the Silkscreen is quite clear, and the Black solder mask looks amazing.
This is how my ESP32 development board looks after soldering. If you want to make the same development board then you can download the PCB Gerber files.
Anyway, as you can see this board has 4 relays. And using these 4 relays you can control 4 loads. Now, let’s go ahead and take a look at the programming.
Bluetooth Controlled Ceiling LED Strip Programming:
If this is your first time using ESP32 WiFi module, then first you will need to install the ESP32 board in the Arduino IDE; I already have a very detailed article on this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
#include "BluetoothSerial.h" #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it #endif BluetoothSerial SerialBT; long int Bluedata; int relay1 = 13; long int password1 = 98421615;// Relay1 ON long int password11 = 96951628;// Relay1 OFF int relay2 = 12; long int password2 = 74151525; // Relay2 ON long int password21 = 45614787; // Relay2 OFF int relay3 = 14; long int password3 = 84515822; // relay3 ON long int password31 = 81599922; // Relay3 OFF int relay4 = 27; long int password4 = 81426337; long int password41 = 88428399; void setup() { Serial.begin(115200); SerialBT.begin("ESP32_Electronic_Clinic"); //Bluetooth device name Serial.println("The device started, now you can pair it with bluetooth!"); pinMode(relay1, OUTPUT); digitalWrite(relay1, LOW); pinMode(relay2, OUTPUT); digitalWrite(relay2, LOW); pinMode(relay3, OUTPUT); digitalWrite(relay3, LOW); pinMode(relay4, OUTPUT); digitalWrite(relay4, LOW); } void loop() { if (Serial.available()) { SerialBT.write(Serial.read()); } if (SerialBT.available()) { Bluedata = SerialBT.parseInt(); } delay(20); // Serial.println(Bluedata); if ( password1 == Bluedata ) { digitalWrite(relay1, HIGH); SerialBT.println("Relay 1 is turned ON"); Bluedata = 0; delay(100); } if ( password11 == Bluedata ) { digitalWrite(relay1, LOW); SerialBT.println("Relay 1 is turned OFF"); Bluedata = 0; delay(100); } // RELAY 2 if ( password2 == Bluedata ) { digitalWrite(relay2, HIGH); SerialBT.println("Relay 2 is turned ON"); Bluedata = 0; delay(100); } if ( password21 == Bluedata ) { digitalWrite(relay2, LOW); SerialBT.println("Relay 2 is turned OFF"); Bluedata = 0; delay(100); } // RELAY 3 if ( password3 == Bluedata ) { digitalWrite(relay3, HIGH); SerialBT.println("Relay 3 is turned ON"); Bluedata = 0; delay(100); } if ( password31 == Bluedata ) { digitalWrite(relay3, LOW); SerialBT.println("Relay 3 is turned OFF"); Bluedata = 0; delay(100); } // RELAY 4 if ( password4 == Bluedata ) { digitalWrite(relay4, HIGH); SerialBT.println("Relay 4 is turned ON"); Bluedata = 0; delay(100); } if ( password41 == Bluedata ) { digitalWrite(relay4, LOW); SerialBT.println("Relay 4 is turned OFF"); Bluedata = 0; delay(100); } } |
Bluetooth App for controlling Ceiling LED strips:
As you know it takes hours and even days to design an android application, so in this article, I am not explaining how I designed this Bluetooth application for controlling Ceiling LED strips. As I have a separate article on how to design our own Android application using Android Studio. But, if you want to use the same application then you can download the APK file.