Inhoudsopgave:

Nodemcu Esp8266 + PIR + Blynk - Ajarnpa
Nodemcu Esp8266 + PIR + Blynk - Ajarnpa

Video: Nodemcu Esp8266 + PIR + Blynk - Ajarnpa

Video: Nodemcu Esp8266 + PIR + Blynk - Ajarnpa
Video: Датчик движения (PIR) + РЕЛЕ + ESP 8266 + BLYNK (дистанцинное управление освещением) часть 1 2024, Juni-
Anonim
Nodemcu Esp8266 + PIR + Blynk
Nodemcu Esp8266 + PIR + Blynk

Nodemcu Esp8266 + PIR + Blynk

LABSTI - FIA - USMP

Stap 1: Materialen

-Nodemcu esp8266

- Sensor PIR

- Aplicativo móvil Blynk

Stap 2: Diseno

Diseno
Diseno
Diseno
Diseno

Stap 3: Configuratie Del Arduino IDE

Configuratie Del Arduino IDE
Configuratie Del Arduino IDE

El "Upload Speed" van de configuratie van NodeMCU voor ser igual "baudio" van monitor serie.

Stap 4: Configuratie Del Blynk

Configuratie Del Blynk
Configuratie Del Blynk
Configuratie Del Blynk
Configuratie Del Blynk
Configuratie Del Blynk
Configuratie Del Blynk

Vereisten:

- Download het aplicativo móvil "Blynk"

Pasos:

  1. Kies voor "+ New Project", voor een nieuw project.
  2. Seleccionar el dispositivo (ESP8266), aggregaat un nombre y seleccionar el botón "Create".
  3. Ingresar al proyecto reciedo y seleccionar la opción "(+)".
  4. Selecteer de optie "Button", voor een nieuwe botón en el proyecto.
  5. Configureer de boton die is gemaakt:- Ingresar un nombre al botón.- Ingresar al "OUTPUT" y seleccionar "V0". - Cambiar la opción "Modus" een "Switch".
  6. Selecteer de optie "Melding".
  7. Configurator las notificaciones. Déjar por predeterminado.
  8. Ingresar a la opción de "tuerca" para validar el dispositivo.
  9. Verificar el "Auth Token" sea el mismo que se ingreso en el código.

El Auth Token is een bewijs van een nieuw proyecto la cual lo recibiremos por nuestro correo electric asociado.

Stap 5: Programmeren

#erbij betrekken

#define BLYNK_PRINT Serie

#erbij betrekken

char auth = "Tu Auth-token"; // Auth Token del app móvil Blynk

/* Credenciales de WiFi */

char ssid = "Tu rood"; // nombre de la red wifi char pass = "Tu contraseña"; // contraseña de la rode wifi

/* HC-SR501 Bewegingsmelder */

#define pirPin 5 // Invoer voor HC-S501 int pirValue; int pinWaarde;

BLYNK_WRITE(V0)

{ pinValue = param.asInt(); }

ongeldige setup()

{ Serieel.begin(115200); vertraging(10); Blynk.begin(auth, ssid, pass); pinMode(pirPin, INPUT); }

lege lus()

{if (pinValue == HOOG) { getPirValue(); } Blynk.run(); }

ongeldig getPirValue (ongeldig)

{ pirValue = digitalRead (pirPin); if (pirValue) { Serial.println ("Beweging gedetecteerd"); Blynk.notify("Beweging gedetecteerd"); } }