SlideShare a Scribd company logo
1 of 32
Smart Home Lighting
using Arduino
Santosh Kumar Kar
skkar.2k2@gmail.com
What you need?
1. Arduino Board
2. Bluetooth Module (HC-05 or HM-10)
3. Resistors (470 Ohms)
4. Coloured 3v LED lights
5. Cables
Arduino Board
I am using Arduino UNO R3 Compatible Development Board
(ATmega328P)
Bluetooth Module (HC-05 or HM-10)
To communicate with Arduino, we need a Bluetooth module. Bluetooth
module will receive the signal from a Bluetooth enabled device such as
smart phone.
HC-05 has limitation that it can’t be connected to IoS device such as
iPhone because Apple uses MFi licensing program. If you are not using
IoS devices, you can use HC-05
If you have an iPhone and want to connect to Arduino via bluetooth,
your phone can’t be paired with HC-05. So you have to choose HM-10
module for Bluetooth communication.
HM-10
step
1
Connect LED to Arduino Board
Now we will connect all LED lights to Arduino board. For that you need
1. Arduino board with power cable/USB
2. LED lights of 3v each (colours: white, red, green, yellow, blue)
3. 5 resistors of 470 amps each
4. Cables to connect LED lights to Arduino
First we will connect LED lights to Arduino. Each LED light has 2 pins –
ANODE & CATHODE. One of these two is bit bigger than the other. The
bigger pin is ANODE(+) which needs 3v power. This will be supplied
from the Arduino board. Instead of connecting directly, we will use a
470 amp resistor. The smaller pin is CATHODE(-) which will be
connected to Gnd(Ground). So we use 5 Led bulbs and 5 resistors. Let’s
connect as:
Red LED will connect to Arduino A0 pin, white to A1 pin, green to A2,
yellow to A3 and blue to A4.
Connect LED to Arduino Board
Connect LED to Arduino Board
step
2
First we will write the program. The program will read the input and
power on the LED for the respective pins in the Arduino. So here we are
using 5 pins in the Arduino board – A0, A1, A2, A3, A4 which are
connected and control to 5 leds.
Write program for Arduino Controller
int REDLED = A0;
int WHITELED = A1;
int GREENLED = A2;
int YELLOWLED = A3;
int BLUELED = A4;
char input;
We are declaring the constants which for the
Arduino pins will be used later in the program.
The variable input will be used to store the value
from the user operation. This is used to turn the led
on and off as per the user interaction.
void setup() {
Serial.begin(9600);
pinMode(REDLED, OUTPUT);
pinMode(WHITELED, OUTPUT);
pinMode(GREENLED, OUTPUT);
pinMode(YELLOWLED, OUTPUT);
pinMode(BLUELED, OUTPUT);
Serial.println(">> START<<");
}
Serial.begin(9600)
This opens serial port, sets data
rate to 9600 bps. You can see the
data rate in the Arduino app, press
Ctrl+Shift+M or Tools>Serial
Monitor
• pinMode(REDLED, OUTPUT);
• pinMode(WHITELED, OUTPUT);
• pinMode(GREENLED, OUTPUT);
• pinMode(YELLOWLED, OUTPUT);
• pinMode(BLUELED, OUTPUT);
Here we are registering the pins for output to the LEDs from Arduino.
void loop() {
if (Serial.available() > 0) {
input = Serial.read();
Serial.println(input);
-- remaining code in next slide --
}
}
In these code, we are reading the input which
will be supplied by the user. According to the
input we will control the LED lights.
if (input == 'A') {
Serial.println("ON");
digitalWrite(REDLED, HIGH);
delay(500);
} else if (input == 'a') {
Serial.println("OFF");
digitalWrite(REDLED, LOW);
delay(500);
} else if(input == 'B') {
Serial.println("ON");
digitalWrite(WHITELED, HIGH);
delay(500);
} else if (input == 'b') {
Serial.println("OFF");
digitalWrite(WHITELED, LOW);
delay(500);
}
else if (input == 'C') {
Serial.println("ON");
digitalWrite(YELLOWLED, HIGH);
delay(500);
} else if (input == 'c') {
Serial.println("OFF");
digitalWrite(YELLOWLED, LOW);
delay(500);
} else if(input == 'D') {
Serial.println("ON");
digitalWrite(GREENLED, HIGH);
delay(500);
} else if (input == 'd') {
Serial.println("OFF");
digitalWrite(GREENLED, LOW);
delay(500);
}
else if (input == 'E') {
Serial.println("ON");
digitalWrite(BLUELED, HIGH);
delay(500);
} else if (input == 'e') {
Serial.println("OFF");
digitalWrite(BLUELED, LOW);
delay(500);
} else {
Serial.println("NO INPUT");
Serial.println(input);
}
step
3
Once the code is finished, connect Arduino to your laptop. Now Upload
the application.
Once done, start testing the app.
Press ctrl+shift+M. This will open the Serial monitor. Enter your input
character – A. When you provide A and send, it will turn the red led
on. To turn other lights on, you can try any characters from A – E.
To turn them off, you pass character in small letters i.e. any character
from a – e
Let’s test it
step
4
There are many Bluetooth modules for Arduino available in the market.
However as discussed in the previous slide, we will choose one from
either HC-05 or HM-10 as per your device type. If you use iPhone to
communicate, you choose HM-10 else HC-05 is enough for only
Android.
The Bluetooth module has 6 pins. However we will use only 4 pins as:
VCC – This should be connected to 5v pin in the Arduino
GND – This should be connected to any GND pin in the Arduino
TXD – This should be connected to RD←0 pin in the Arduino
RXD – This should be connected to RD→1 pin in the Arduino
Connect Bluetooth module to Arduino
step
5
NO extra code for Bluetooth
Yes you read it correctly.
There is absolutely NO extra code for Bluetooth.
The same program will work to communicate from phone to Arduino.
step
6
Turn on/off LED lights from your phone
In your phone, go to Settings > Bluetooth. When you scan for devices,
your Bluetooth module should be listed under available devices. You
should find it as HC-05. Pair the device. For the password, you type
1234 for pairing.
• Once the device is paired, you can download an Android application. I
am using Arduino Bluetooth Control app.
Once you install the app, now open it. Before you operate, you need to
connect the device first. (I have renamed the buttons)
Turn on/off LED lights from your phone
There will be buttons, each button is configured to send a letter to the
Bluetooth device. It starts from A (A for on, a for off) for Device 1
button, B (B for on, b for off) for Device 2, …. and so on.
Now you should be able to operate the lights through the buttons.
That’s all. In my next slide, instead of LED lights we will connect to bulb
and fans used at our smart home.
Turn on/off LED lights from your phone
Write to
skkar.2k2@gmail.com
Smart home   arduino

More Related Content

What's hot

Smart home automation
Smart home automationSmart home automation
Smart home automationVikas Rathod
 
Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2DIPAN GHOSH
 
IR BASED HOME AUTOMATION USING ARDUINO UNO
IR BASED HOME AUTOMATION USING ARDUINO UNOIR BASED HOME AUTOMATION USING ARDUINO UNO
IR BASED HOME AUTOMATION USING ARDUINO UNOMln Phaneendra
 
Android wi fi home automation – arduino
Android wi fi home automation – arduinoAndroid wi fi home automation – arduino
Android wi fi home automation – arduinosvsembedded
 
ELECTRONICS PROJECT REPORT OF HOME AUTOMATION CUM BUILDING SECUIRITY
ELECTRONICS PROJECT REPORT OF HOME AUTOMATION CUM BUILDING SECUIRITYELECTRONICS PROJECT REPORT OF HOME AUTOMATION CUM BUILDING SECUIRITY
ELECTRONICS PROJECT REPORT OF HOME AUTOMATION CUM BUILDING SECUIRITYEldhose George
 
Controlling home appliances using ir modules
Controlling home appliances using ir modulesControlling home appliances using ir modules
Controlling home appliances using ir modulesSatya Jeet
 
Project presentation
Project presentationProject presentation
Project presentationShabbir Hasan
 
Development of a Low Cost, Reliable & Scalable Home Automation System.
Development of a Low Cost, Reliable & Scalable Home Automation System.Development of a Low Cost, Reliable & Scalable Home Automation System.
Development of a Low Cost, Reliable & Scalable Home Automation System.imtiyazEEE
 
Automatic room light controller with bi directional visitor counter using Ard...
Automatic room light controller with bi directional visitor counter using Ard...Automatic room light controller with bi directional visitor counter using Ard...
Automatic room light controller with bi directional visitor counter using Ard...PRASENJITMORE2
 
Home automation system using arduino with android
Home automation system using arduino with androidHome automation system using arduino with android
Home automation system using arduino with androidrahul takalkar
 
Arduino bluetooth controlled robot
Arduino bluetooth controlled robotArduino bluetooth controlled robot
Arduino bluetooth controlled robotUVSofts Technologies
 
bluetooth controlled home automation using arduino by shubham sinha
bluetooth controlled home automation using arduino by shubham sinhabluetooth controlled home automation using arduino by shubham sinha
bluetooth controlled home automation using arduino by shubham sinhaShubham Sinha
 
Infrared Remote Controlled Devices
Infrared Remote Controlled DevicesInfrared Remote Controlled Devices
Infrared Remote Controlled DevicesNarayan Jaiswal
 
Digital home automation with Arduino bluetooth
Digital home automation with Arduino bluetoothDigital home automation with Arduino bluetooth
Digital home automation with Arduino bluetoothShishupal03012015
 
Electronic switch control through rf
Electronic switch control through rfElectronic switch control through rf
Electronic switch control through rfRitesh Kumar
 
Smart home automation using microcontroller
Smart home automation using microcontrollerSmart home automation using microcontroller
Smart home automation using microcontrollerR.RAJA SHARMA
 
Remote Controlled Home Appliance
Remote Controlled Home Appliance Remote Controlled Home Appliance
Remote Controlled Home Appliance Samir Ahmed Shimul
 
Ppt rf based home automation system 1
Ppt rf based home automation system 1Ppt rf based home automation system 1
Ppt rf based home automation system 1Ankit Gosain
 

What's hot (20)

Smart home automation
Smart home automationSmart home automation
Smart home automation
 
Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2
 
IR BASED HOME AUTOMATION USING ARDUINO UNO
IR BASED HOME AUTOMATION USING ARDUINO UNOIR BASED HOME AUTOMATION USING ARDUINO UNO
IR BASED HOME AUTOMATION USING ARDUINO UNO
 
Android wi fi home automation – arduino
Android wi fi home automation – arduinoAndroid wi fi home automation – arduino
Android wi fi home automation – arduino
 
ELECTRONICS PROJECT REPORT OF HOME AUTOMATION CUM BUILDING SECUIRITY
ELECTRONICS PROJECT REPORT OF HOME AUTOMATION CUM BUILDING SECUIRITYELECTRONICS PROJECT REPORT OF HOME AUTOMATION CUM BUILDING SECUIRITY
ELECTRONICS PROJECT REPORT OF HOME AUTOMATION CUM BUILDING SECUIRITY
 
Controlling home appliances using ir modules
Controlling home appliances using ir modulesControlling home appliances using ir modules
Controlling home appliances using ir modules
 
Project presentation
Project presentationProject presentation
Project presentation
 
Development of a Low Cost, Reliable & Scalable Home Automation System.
Development of a Low Cost, Reliable & Scalable Home Automation System.Development of a Low Cost, Reliable & Scalable Home Automation System.
Development of a Low Cost, Reliable & Scalable Home Automation System.
 
Automatic room light controller with bi directional visitor counter using Ard...
Automatic room light controller with bi directional visitor counter using Ard...Automatic room light controller with bi directional visitor counter using Ard...
Automatic room light controller with bi directional visitor counter using Ard...
 
Home automation system using arduino with android
Home automation system using arduino with androidHome automation system using arduino with android
Home automation system using arduino with android
 
Arduino bluetooth controlled robot
Arduino bluetooth controlled robotArduino bluetooth controlled robot
Arduino bluetooth controlled robot
 
bluetooth controlled home automation using arduino by shubham sinha
bluetooth controlled home automation using arduino by shubham sinhabluetooth controlled home automation using arduino by shubham sinha
bluetooth controlled home automation using arduino by shubham sinha
 
Infrared Remote Controlled Devices
Infrared Remote Controlled DevicesInfrared Remote Controlled Devices
Infrared Remote Controlled Devices
 
Digital home automation with Arduino bluetooth
Digital home automation with Arduino bluetoothDigital home automation with Arduino bluetooth
Digital home automation with Arduino bluetooth
 
Electronic switch control through rf
Electronic switch control through rfElectronic switch control through rf
Electronic switch control through rf
 
Smart home automation using microcontroller
Smart home automation using microcontrollerSmart home automation using microcontroller
Smart home automation using microcontroller
 
Magnetic door lock
Magnetic door lockMagnetic door lock
Magnetic door lock
 
MPU-6050_RF24L01
MPU-6050_RF24L01MPU-6050_RF24L01
MPU-6050_RF24L01
 
Remote Controlled Home Appliance
Remote Controlled Home Appliance Remote Controlled Home Appliance
Remote Controlled Home Appliance
 
Ppt rf based home automation system 1
Ppt rf based home automation system 1Ppt rf based home automation system 1
Ppt rf based home automation system 1
 

Similar to Smart home arduino

Arduino projects &amp; tutorials
Arduino projects &amp; tutorialsArduino projects &amp; tutorials
Arduino projects &amp; tutorialsAnshu Pandey
 
Basic arduino sketch example
Basic arduino sketch exampleBasic arduino sketch example
Basic arduino sketch examplemraziff2009
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbookFelipe Belarmino
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slidesmkarlin14
 
Arduino slides
Arduino slidesArduino slides
Arduino slidessdcharle
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
IoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorsIoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorssaritasapkal
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixelssdcharle
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshopatuline
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1Afzal Ahmad
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfssuser0e9cc4
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptxHebaEng
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt maineddy royappa
 

Similar to Smart home arduino (20)

Arduino projects &amp; tutorials
Arduino projects &amp; tutorialsArduino projects &amp; tutorials
Arduino projects &amp; tutorials
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
 
Basic arduino sketch example
Basic arduino sketch exampleBasic arduino sketch example
Basic arduino sketch example
 
Arduino electronics cookbook
Arduino electronics cookbookArduino electronics cookbook
Arduino electronics cookbook
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Embedded system application
Embedded system applicationEmbedded system application
Embedded system application
 
Arduino workshop sensors
Arduino workshop sensorsArduino workshop sensors
Arduino workshop sensors
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
IoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensorsIoT Basics with few Embedded System Connections for sensors
IoT Basics with few Embedded System Connections for sensors
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Arduino Workshop
Arduino WorkshopArduino Workshop
Arduino Workshop
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
ARDUINO.pptx
ARDUINO.pptxARDUINO.pptx
ARDUINO.pptx
 
Robotics Session day 1
Robotics Session day 1Robotics Session day 1
Robotics Session day 1
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdf
 
Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
arduino.ppt
arduino.pptarduino.ppt
arduino.ppt
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
 

More from Santosh Kumar Kar

Operating electrical devices with PIR sensor. No coding, No controller
Operating electrical devices with PIR sensor. No coding, No controllerOperating electrical devices with PIR sensor. No coding, No controller
Operating electrical devices with PIR sensor. No coding, No controllerSantosh Kumar Kar
 
Pir motion sensor with raspberry pi
Pir motion sensor with raspberry piPir motion sensor with raspberry pi
Pir motion sensor with raspberry piSantosh Kumar Kar
 
Writing simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorWriting simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorSantosh Kumar Kar
 

More from Santosh Kumar Kar (10)

Operating electrical devices with PIR sensor. No coding, No controller
Operating electrical devices with PIR sensor. No coding, No controllerOperating electrical devices with PIR sensor. No coding, No controller
Operating electrical devices with PIR sensor. No coding, No controller
 
Pir motion sensor with raspberry pi
Pir motion sensor with raspberry piPir motion sensor with raspberry pi
Pir motion sensor with raspberry pi
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
Raspberry pi complete setup
Raspberry pi complete setupRaspberry pi complete setup
Raspberry pi complete setup
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
 
Spring transaction part4
Spring transaction   part4Spring transaction   part4
Spring transaction part4
 
Spring & hibernate
Spring & hibernateSpring & hibernate
Spring & hibernate
 
Spring database - part2
Spring database -  part2Spring database -  part2
Spring database - part2
 
Springs
SpringsSprings
Springs
 
Writing simple web services in java using eclipse editor
Writing simple web services in java using eclipse editorWriting simple web services in java using eclipse editor
Writing simple web services in java using eclipse editor
 

Recently uploaded

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 

Recently uploaded (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 

Smart home arduino

  • 1. Smart Home Lighting using Arduino Santosh Kumar Kar skkar.2k2@gmail.com
  • 2. What you need? 1. Arduino Board 2. Bluetooth Module (HC-05 or HM-10) 3. Resistors (470 Ohms) 4. Coloured 3v LED lights 5. Cables
  • 3. Arduino Board I am using Arduino UNO R3 Compatible Development Board (ATmega328P)
  • 4. Bluetooth Module (HC-05 or HM-10) To communicate with Arduino, we need a Bluetooth module. Bluetooth module will receive the signal from a Bluetooth enabled device such as smart phone. HC-05 has limitation that it can’t be connected to IoS device such as iPhone because Apple uses MFi licensing program. If you are not using IoS devices, you can use HC-05 If you have an iPhone and want to connect to Arduino via bluetooth, your phone can’t be paired with HC-05. So you have to choose HM-10 module for Bluetooth communication.
  • 7. Connect LED to Arduino Board Now we will connect all LED lights to Arduino board. For that you need 1. Arduino board with power cable/USB 2. LED lights of 3v each (colours: white, red, green, yellow, blue) 3. 5 resistors of 470 amps each 4. Cables to connect LED lights to Arduino
  • 8. First we will connect LED lights to Arduino. Each LED light has 2 pins – ANODE & CATHODE. One of these two is bit bigger than the other. The bigger pin is ANODE(+) which needs 3v power. This will be supplied from the Arduino board. Instead of connecting directly, we will use a 470 amp resistor. The smaller pin is CATHODE(-) which will be connected to Gnd(Ground). So we use 5 Led bulbs and 5 resistors. Let’s connect as: Red LED will connect to Arduino A0 pin, white to A1 pin, green to A2, yellow to A3 and blue to A4. Connect LED to Arduino Board
  • 9. Connect LED to Arduino Board
  • 11. First we will write the program. The program will read the input and power on the LED for the respective pins in the Arduino. So here we are using 5 pins in the Arduino board – A0, A1, A2, A3, A4 which are connected and control to 5 leds. Write program for Arduino Controller
  • 12. int REDLED = A0; int WHITELED = A1; int GREENLED = A2; int YELLOWLED = A3; int BLUELED = A4; char input; We are declaring the constants which for the Arduino pins will be used later in the program. The variable input will be used to store the value from the user operation. This is used to turn the led on and off as per the user interaction.
  • 13. void setup() { Serial.begin(9600); pinMode(REDLED, OUTPUT); pinMode(WHITELED, OUTPUT); pinMode(GREENLED, OUTPUT); pinMode(YELLOWLED, OUTPUT); pinMode(BLUELED, OUTPUT); Serial.println(">> START<<"); }
  • 14. Serial.begin(9600) This opens serial port, sets data rate to 9600 bps. You can see the data rate in the Arduino app, press Ctrl+Shift+M or Tools>Serial Monitor
  • 15. • pinMode(REDLED, OUTPUT); • pinMode(WHITELED, OUTPUT); • pinMode(GREENLED, OUTPUT); • pinMode(YELLOWLED, OUTPUT); • pinMode(BLUELED, OUTPUT); Here we are registering the pins for output to the LEDs from Arduino.
  • 16. void loop() { if (Serial.available() > 0) { input = Serial.read(); Serial.println(input); -- remaining code in next slide -- } } In these code, we are reading the input which will be supplied by the user. According to the input we will control the LED lights.
  • 17. if (input == 'A') { Serial.println("ON"); digitalWrite(REDLED, HIGH); delay(500); } else if (input == 'a') { Serial.println("OFF"); digitalWrite(REDLED, LOW); delay(500); } else if(input == 'B') { Serial.println("ON"); digitalWrite(WHITELED, HIGH); delay(500); } else if (input == 'b') { Serial.println("OFF"); digitalWrite(WHITELED, LOW); delay(500); }
  • 18. else if (input == 'C') { Serial.println("ON"); digitalWrite(YELLOWLED, HIGH); delay(500); } else if (input == 'c') { Serial.println("OFF"); digitalWrite(YELLOWLED, LOW); delay(500); } else if(input == 'D') { Serial.println("ON"); digitalWrite(GREENLED, HIGH); delay(500); } else if (input == 'd') { Serial.println("OFF"); digitalWrite(GREENLED, LOW); delay(500); }
  • 19. else if (input == 'E') { Serial.println("ON"); digitalWrite(BLUELED, HIGH); delay(500); } else if (input == 'e') { Serial.println("OFF"); digitalWrite(BLUELED, LOW); delay(500); } else { Serial.println("NO INPUT"); Serial.println(input); }
  • 21. Once the code is finished, connect Arduino to your laptop. Now Upload the application. Once done, start testing the app. Press ctrl+shift+M. This will open the Serial monitor. Enter your input character – A. When you provide A and send, it will turn the red led on. To turn other lights on, you can try any characters from A – E. To turn them off, you pass character in small letters i.e. any character from a – e Let’s test it
  • 23. There are many Bluetooth modules for Arduino available in the market. However as discussed in the previous slide, we will choose one from either HC-05 or HM-10 as per your device type. If you use iPhone to communicate, you choose HM-10 else HC-05 is enough for only Android. The Bluetooth module has 6 pins. However we will use only 4 pins as: VCC – This should be connected to 5v pin in the Arduino GND – This should be connected to any GND pin in the Arduino TXD – This should be connected to RD←0 pin in the Arduino RXD – This should be connected to RD→1 pin in the Arduino Connect Bluetooth module to Arduino
  • 24.
  • 26. NO extra code for Bluetooth Yes you read it correctly. There is absolutely NO extra code for Bluetooth. The same program will work to communicate from phone to Arduino.
  • 28. Turn on/off LED lights from your phone In your phone, go to Settings > Bluetooth. When you scan for devices, your Bluetooth module should be listed under available devices. You should find it as HC-05. Pair the device. For the password, you type 1234 for pairing. • Once the device is paired, you can download an Android application. I am using Arduino Bluetooth Control app.
  • 29. Once you install the app, now open it. Before you operate, you need to connect the device first. (I have renamed the buttons) Turn on/off LED lights from your phone
  • 30. There will be buttons, each button is configured to send a letter to the Bluetooth device. It starts from A (A for on, a for off) for Device 1 button, B (B for on, b for off) for Device 2, …. and so on. Now you should be able to operate the lights through the buttons. That’s all. In my next slide, instead of LED lights we will connect to bulb and fans used at our smart home. Turn on/off LED lights from your phone