The INTERNET OF THINGS
IoT is the network of physical devices, vehicles, home appliances, and other items embedded with electronics, software, sensors, actuators, and network connectivity which enable these objects to connect and exchange data. Each thing is uniquely identifiable through its embedded computing system but is able to inter-operate within the existing Internet infrastructure. Experts estimate that the IoT will consist of about 30 billion objects by 2020.
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.