The INTERNET OF THINGS
Requirements
Arduino UNO,5 Volt 2 Channel Relay, HC 05 Bluetooth Module, Programming cable, Connecting Wires, Bug Strips, Zero Voltage Bulb, and Electrical Wires.
Procedure
- For our experiment, we are using 5V 2channel Relay by using this Relay we can connect two devices.
- First of all, we need to check whether our relay is in a working state or not.
STEP 1 - TO TEST OUR RELAY WE NEED TO FOLLOW THE FOLLOWING STEPS
Connections
- First, we need to connect GND of Relay to GND of Arduino
- VCC of Relay to 5V of Arduino
- IN1 of Relay to pin no. 2 of Arduino Digital section
- After completing all the connections we need to connect our Arduino to the PC/LAPTOP through programming cable and check whether it is connected or not
- Then compile and upload the program into the Arduino board
- If our relay starts blinking ON and OFF for 2 seconds then we can confirm that our relay is in a working state.

STEP 2 - TO CHECK OUR BLUETOOTH MODULE IS WORKING OR NOT
Here, we are using HC 05 Bluetooth Module
Connections
- Connect the VCC of Bluetooth to VCC of Arduino
- Connect the GND of Bluetooth to GND of Arduino
- Then connect our Arduino to the PC/LAPTOP.
- If our Bluetooth module starts blinking, then the module is in a working state

- If it shows a light then our Module is in a working state.
- We need to pair our HC 05 Bluetooth Module with our mobile Bluetooth.
- Now, Download "BT VOICE CONTROLLER FOR ARDUINO" APP from the PlayStore and connect our Bluetooth Module through the APP.
After testing these two products our actual concept starts from step 3.
STEP 3 - OVERALL CONNECTIONS
- Now, take one male to the female wire, connect the male part to VCC of Arduino and the female part to Bugstrip.
- Take one female to female wire & connect one female end to VCC of the relay & another end to the Bugstrip.
- Take one male to the female wire, connect one male end to the GND of Relay & female end to the GND of Arduino.
- Take one male to the female wire, connect one female end to the IN1 of Relay & male end to pin no. 2 of the Arduino Digital section.
- Take one female to female wire & connect one female end to the VCC of Bluetooth & another end to the Bugstrip.
- Take one male to the female wire, connect one male end to the GND of Arduino & female end to the GND of Bluetooth.
- Take two electrical wires to connect one end to the black holder & another end to white plug. The yellow wire is cut into 2 parts, & connect as shown in the figure below.

- The one end of the yellow wire goes to "COM1" of Relay & another end goes to "NO1" of Relay.
- Then connect your Arduino to PC/LAPTOP using Programming cable. Now, compile and upload the below-given program over all connections.
Use the Arduino IDE or run the code:
String voice
- #define relay1 2
- # define relay2 3
- void setup() {
- Serial.begin(9600);
- pinMode(relay1, OUTPUT);
- pinMode(relay2, OUTPUT);
- digitalWrite(relay1, HIGH);
- digitalWrite(relay2, HIGH);
- }
- void loop() {
- while (Serial.available()) {
- delay(10);
- char c = Serial.read();
- if (c == '#') {
- break;
- }
- voice += c;
- }
- if (voice.length() > 0) {
- Serial.println(voice);
- if (voice == "*light on") {
- lighton();
- } else if (voice == "*light off") {
- lightoff();
- } else if (voice == "*fan on") {
- fanon();
- } else if (voice = "*fan stop") {
- fanoff();
- }
- voice = "";
- }
- }
- void lighton() {
- digitalWrite(relay1, LOW);
- }
- void lightoff() {
- digitalWrite(relay1, HIGH);
- }
- void fanon() {
- digitalWrite(relay2, LOW);
- }
- void fanoff() {
- digitalWrite(relay2, HIGH);
- }
- After uploading the program to the Arduino Board:
- Then connect TX of Bluetooth to RX of Arduino & RX of Bluetooth to TX of Arduino.
- Now, connect a zero volt bulb to the holder and connect the plug to the 230V power supply.
- After connecting to the power supply don't touch any wires or boards in the experiment be careful.
- Then connect your mobile to the internet & open "BT VOICE CONTROLLER FOR ARDUINO" APP & connect it to our HC 05 Bluetooth Module through the APP.

Then if you give the command "LIGHT ON" then the zero volt bulb is ON,

When you give the command "LIGHT OFF" then the zero volt bulb is OFF.

Thank you for reading my article.


Ashish JainPosted Dec 3, 2019, 11:47 PM EST
Awesome article, but I found a problem (not with article :P ). I am a good programmer but i don't know more about electronics, can you please help me to understand the hardware or hardware nodes with answers of When, Why, What and How? It will be really helpful not for me only but other programmers too who are keen to learn IoT but don't understand the hardware language of microprocessors.
farva ahmedPosted Mar 21, 2019, 12:35 AM EDT
Ravikanth Reddy From where have u collected the dataset for fn and light can u plz share the link
Rahmi Tuğrul AltınPosted Oct 13, 2018, 11:07 AM EDT
Thanks for your article.
Govind DwivedyPosted Sep 3, 2018, 8:21 AM EDT
How much i have to spent in tis project
Hadshana KamalanathanTOP 100Posted Jul 19, 2018, 12:58 AM EDT
Thanks for sharing
Mahesh AkuthotaPosted Jul 18, 2018, 1:07 AM EDT
Nice article
Hiten PandyaPosted Jul 16, 2018, 7:22 PM EDT
Superb article. One of the good articles I have read. Keep it up. :)
Kartik PawarPosted Jul 16, 2018, 5:01 PM EDT
Nice article... Keep it up...
Viknaraj ManogararajahTOP 100Posted Jul 16, 2018, 2:47 PM EDT
nice article thank you for sharing...