You are on page 1of 9

Home automation (software implementation)

Draw the circuit on proteus select com1 for compim


Open blynk online
Select new template and create new template

Go to data stream select new data stream and then digital pin
Then give the name as led and select pin 13 select create

Again select new data stream and give name as fan and select pin 12
Then go to web dashboard

And place 2 switches

Go to setting to switch 1 and give title led and select 13 and give title fan and select 12 for 2 switch
And then select save
Then go to home and template id ,name and auth token will appear there

Open blynk example (google)


Select ardino board then serial or usb connection and then Enter the template id ,name and auth token obtained when new
project name led was made in blynk
Open Arduino ide and paste the above code over there and compile it

Now paste the hex file into ardino in proteus


Open virtual serial port driver and pair com 1 and com 2

Then open ardino folder go to libraries open blynk then scripts then blynk-ser

Below window will appear

#define BLYNK_TEMPLATE_ID "TMPL6uKVpvOHj"


#define BLYNK_TEMPLATE_NAME "led"
#define BLYNK_AUTH_TOKEN "PbnWwRoIwcqpcTQOYBOtkhd-v5x1ApZe"
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT SwSerial
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX

#include <BlynkSimpleStream.h>
void setup()
{
// Debug console
SwSerial.begin(115200);
// Blynk will work through Serial
// Do not read or write this serial manually in your sketch
Serial.begin(9600);
Blynk.begin(Serial, BLYNK_AUTH_TOKEN);
}
void loop()
{
Blynk.run();
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
}

You might also like