Home Automation example

I made an example of the Home Automation using Wemos D1 + Blynk. The house has three rooms and a garage door and can be remotely controlled by Android or iOS. Wemos and Android (or iOS) are connected to server via local wifi.

Project video:

Used hardware:

  • Wooden house model
  • Wemos D1
  • 5V power bank
  • 5V yellow LED (3x 10cm)
  • 5V servo motor
  • Jumpers + cables
  • Glue

Used software:

  • Blynk
  • Arduino IDE to program Wemos D1

Project code:
Thanks to great Blynk app, there si no need to program any light control to Wemos. For light control I used D0, D1 and D3 pins. For the garage door I used virtual pin V0 because I needed to set the proper limits of servo.

//#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <Servo.h>

char auth[] = "#######";
char ssid[] = "#######";
char pass[] = "#######";

Servo servogaraza;

BLYNK_WRITE(V0){
  int pozicija = param.asInt();
  if (pozicija == 0){
     servogaraza.write(120); //top point
    Serial.println("Open");
  }
  else if (pozicija == 1){
    servogaraza.write(32); //low point
    Serial.println("Close");
 }
 Serial.println(pozicija);
}

void setup(){
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);
  servogaraza.attach(D4);
}

void loop(){
  Blynk.run();
}

Thank you Blynk for the great app and support!

8 Likes

This is possibly one of the best demo’s of Blynk I’ve seen (and it’s really cute too :D). I think I’ll convince my wife to have her Dollhouse powered by Blynk, hehe :wink:

3 Likes

Hello Lichtsignal, I am glad you like it. If you would like to use the same 3D puzzle of the house, you can download it from here and make a 3D lasercut.

1 Like

Thanks for Sharing

1 Like