Visualizzazione post con etichetta relay module. Mostra tutti i post
Visualizzazione post con etichetta relay module. Mostra tutti i post

giovedì 16 novembre 2017

Remote Control a 2 Channel Relay board with RemoteXY











A recurring question on some Arduino and ESP groups on Facebook goes like: "how to remotely control a relay?"

In this post I show a simple and quick way to remotely control a 2 Relay module through a mobile app using the RemoteXY service.

Pre-requisite to this post is a previous I have written : "Remote Control NodeMCU with RemoteXY" in which I introduce the development of mobile apps to control nodeMCU projects.


The Circuit





As shown in the above figure, the 2 Channel Relay module has 4 pins:

  • GND
  • IN1
  • IN2
  • Vcc

Those pins need to be wired in the following way:

  • Module: GND --> nodeMCU:GND
  • Module: IN1 --> nodeMCU:D4
  • Module: IN2 --> nodeMCU:D5
  • Module: Vcc --> nodeMCU:Vin

Note:

Those wire connections assume that the nodeMCU is powered with 5V.
In such situation on the module Vin pin there will be 5V which is the right voltage to provide to the Relay module.

If you power you nodeMCU with a different voltage, please make sure you adapt the voltage available on Vin to be exactly 5V.



Graphic Interface






Build this simple graphic interface by using 3 labels and 2 switch in the RemoteXY editor.

The switch si should be named:
  • switch_1
  • switch_2

Now in the configuration panel, bottom right, let's configure each switch in a way that they connect to pin D4 and D5 on the nodeMCU














Configuration 

Let's configure RemoteXy in this way





Don't forget to specify your WiFi name and password






Source Code


Here the link  of the shared RemoteXY project. Once on RemoteXY you can download the source code to upload on your nodeMCU


Testing


Below a short video showing the behavior of the application











Controllo Remoto di un modulo Relay a 2 canali con RemoteXY











Una domanda ricorrente sui gruppi Arduino e ESP di Facebook e': "come controllo un rele' da remoto?"

In questo post faccio vedere un modo semplice e veloce per controllare un modulo a 2 Rele' tramite un applicazione mobile sfruttando un servizio chiamato RemoteXY.

Questo post si basa sui concetti descritti in un mio post precedente: "Controllo Remoto di NodeMCU con RemoteXY - Accensione Led" in cui ho introdotto lo sviluppo di una semplice app per controllo remoto di un nodeMCU.


Circuito Elettrico





Come si vede in figura il modulo Relay a 2 canali espone 4 pin


  • GND
  • IN1
  • IN2
  • Vcc

Questi pin vanno collegati nel seguente modo:

  • Modulo: GND --> nodeMCU:GND
  • Modulo: IN1 --> nodeMCU:D4
  • Modulo: IN2 --> nodeMCU:D5
  • Modulo: Vcc --> nodeMCU:Vin

Nota:

Questi collegamenti assumono che il nodeMCU sia alimentato a 5 V.
Cio' significa che sul pin Vin ci saranno 5V adatti ad alimentare il modulo Releay.

Se alimentate il vostro nodeMCU con una tensione differente assicuratevi di adattare la tensione in modo che sul pin Vcc del modulo Releay ci siano 5 V








Interfaccia Grafica





Realizzate questa semplice interfaccia grafica dall'editor di RemoteXY usando 3 label e 2 switch.

Gli switch si devono chiamare:
  • switch_1
  • switch_2

Ora nel pannello di configurazione in basso a destra, configurate ognuno degli switch in modo da collegarli ai pin D4 e D5 di nodeMCU














Configurazione

Configurate RemoteXY in questo modo




Non dimenticatevi di impostare il nome della vostra rete WiFi e la password di accesso.





Codice


Qui il link del progetto condiviso su RemoteXY da cui potete scaricare il codice da caricare sul vostro nodeMCU


Funzionamento


Qui un video che dimostra il funzionamento dell'applicazione