Muhammad fathony Hijrayanto
Published © GPL3+

Prototype Smart garage

An lot Smart Garage and getting notification on Bylnk app

IntermediateFull instructions provided5 hours114
Prototype Smart garage

Things used in this project

Hardware components

SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1
LED (generic)
LED (generic)
×2
Micro-USB to USB Cable (Generic)
Micro-USB to USB Cable (Generic)
×1
NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
ESP8266 ESP-01
Espressif ESP8266 ESP-01
×1
Infrared Module (Generic)
×1

Software apps and online services

Blynk
Blynk
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Tape, Double Sided
Tape, Double Sided

Story

Read more

Schematics

skecth_bima_bb_BWLoS0vBsf.png

Code

Blynk-iot.ino

C/C++
// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "TMPLC4ZrPuR8"
#define BLYNK_DEVICE_NAME "relay"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_WROVER_BOARD
//#define USE_TTGO_T7
//#define USE_ESP32C3_DEV_MODULE
#define USE_ESP32S2_DEV_KIT

#include "BlynkEdgent.h"

BLYNK_WRITE(V1){
  if (param.asInt() == HIGH) {
    digitalWrite(13, LOW);
    }
    else {
      digitalWrite(13, HIGH);
      }
  }

void setup()
{
  Serial.begin(115200);
  delay(100);
  pinMode(13, OUTPUT);
  BlynkEdgent.begin();
}

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

BLYNKesp8266.ino

C/C++
// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "TMPL6cKmLXLTw"
#define BLYNK_DEVICE_NAME "M FATHONY HIJRAYANTO"
#define BLYNK_AUTH_TOKEN "dWtxfWctrNTwndimVRC3J_IfTJgk3CNh"

#define BLYNK_WIFI_SSID "Bima Bejiel"
#define BLYNK_WIFI_PASS "bimasakti"
#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_SPARKFUN_BLYNK_BOARD
#define USE_NODE_MCU_BOARD
//#define USE_WITTY_CLOUD_BOARD
//#define USE_WEMOS_D1_MINI

#include "BlynkEdgent.h"
#include <Servo.h>

static const int servoPin1 = 16;
static const int irPin = 14;

Servo myservo1;                        

void setup()
{
  Serial.begin(115200);
  delay(100);
  pinMode(13, OUTPUT);
  myservo1.attach(servoPin1);
  pinMode(irPin, INPUT);
  BlynkEdgent.begin();
}

void loop() {
  BlynkEdgent.run();

  int val = digitalRead(irPin);

  if (val == 0){
    Blynk.virtualWrite(V0, 0);
     Blynk.virtualWrite(V2, 1);
  } else if (val == 1){
    Blynk.virtualWrite(V0, 1);
     Blynk.virtualWrite(V2, 0);
  }
}

BLYNK_WRITE(V1){
  if (param.asInt() == HIGH) {
    digitalWrite(13, HIGH);
      myservo1.write(120);
    } else {
      digitalWrite(13, LOW);
        myservo1.write(0);
    }
  }

Credits

Muhammad fathony Hijrayanto
1 project • 0 followers
Creative comunication and inovative technology

Comments