Visualizzazione post con etichetta RemoteXY. Mostra tutti i post
Visualizzazione post con etichetta RemoteXY. Mostra tutti i post

domenica 19 novembre 2017

Christmas Lights with WS2811 strip and RemoteXY app










Few days ago a friend of mine described me a project he was doing with his son and a led strip and Arduino.

As always small projects with lights or sounds are very interesting for young kids as they stimulate their fantasy and capture their attention.

Based on that I have decided to buy the same  RGB Led Strip WS2811 12mm  5V  from Amazon:






Led Strip

The led strip is made of 50 led RGB WS2811 which are individually addressable. The strip is solid and built with good quality and made for external use.

As Christmas Holidays period is approaching I think this is the perfect project to develop with my daughter: Lights for a Christmas tree which is programmable from a mobile app.



Mobile App

The mobile app is based on RemoteXY  service and it is quite simple.  It provides a vertical switch with 10 different button options.

Each button is associated to a different light effect implemented on the strip.

The full RemoteXY project is available here

In addition I have shared the entire source code on my GitHub 
















Circuit

The figure below shows the connection of the different components






As you can see the led strip has been represented by a single WS2811 led.
In place of the battery pack I have used a mobile phone charge (5V 1 A)

Note:
if you have a more powerful charger (like 2A) please use it as it will get to lower temperature of operations 


It is very important to note that the negative (-) wire from the charger is connected to the GND pin of nodeMCU in order to allow the proper behavior of the led strip.

The data line of the strip is connected on pin D4 by a 470 Ohm resistor.

I have also added a 1000 uF capacitor between the power wires of the strip. 
The capacitor is not strictly mandatory but highly suggested in order to avoid possible tension spike at the input of the strip.


Implementation

Below some picture of my implementation







For the sake of simplicity I have mounted the nodeMCU on a breadboard. A strip board would be good as well.










Above the detail of the connection of the data line pin of the strip.






Here some details of the connection between the charger (black wires on the left) and the strip wires (white and red on right). As you can see the cap is plug and the blue wire is connected between the nodeMCU GND pin and the negative (-) power wire.





Test

Below you can see the led strip on the wall of my studio ready for testing.
According to Italian tradition I cannot have the xmas tree before December 8th :) so I need to wait few more weeks to install the led strip on the tree :)







Here the video showing all the 10 different lighting effect implemented in this project.






Obviously you can implement your own lighting effects and the limit is only your fantasy.
If you want share your effects so it can help other people.


Luci di Natale con striscia led WS2811 e App Mobile RemoteXY










Alcuni giorni fa' un mio carissimo amico mi ha parlato di un gioco carino che stava facendo con suo figlio con una striscia led programmabile ed Arduino.

Come sempre i progetti con luci e suoni sono adattissimi ai piu' piccoli in quanto catturano la loro attenzione e stimolano la loro fantasia. 

Allora ho deciso anche io di comprare la stessa Striscia RGB Led WS2811 12mm a 5V da Amazon:






Striscia Led

La striscia led e' composta da 50 led RGB WS2811 e quindi indirizzabili singolarmente. La striscia e' realizzata bene ed ogni Led e' protetto per uso esterno.

In questo periodo pre Natalizio e' il progetto perfetto da fare con mia figlia: realizzare delle luci di Natale per il nostro albero che siano programmabili tramite un'app mobile.




App Mobile

L'app mobile e' realizzata con RemoteXY  ed e' molto semplice.  Fornisce un selettore verticale con 10 possibili scelte.
Ogni scelta corrisponde ad un effetto luminoso differente.

Il progetto RemoteXY e' disponibile qui

Inoltre ho condiviso tutto il codice disponibile sul mio GitHub 
















Circuito

Nella figura sotto lo schema delle connessioni





Come potete vedere la striscia led e' rappresentata da un solo led WS2811.
Per il pacco batterie io ho utilizzato un caricatore per cellulare da 5V 1A.

Nota:
Se avete a disposizione un caricatore che puo' erogare piu' corrente utilizzatelo in modo da evitare possibili surriscaldamenti.


E' importante notare come il meno (-) dell'alimentazione vada collegato con il pin GND del nodeMCU in modo da far funzionare correttamente la striscia.

La linea dati della striscia e' collegata al pin D4 tramite un resistore da 470 Ohm. 

Ho anche aggiunto un condensatore da 1000 uF tra i fili di alimentazione della striscia. 
Il condensatore non e' strettamente obbligatorio ma consigliato per evitare sbalzi di tensione ai capi della striscia.


Realizzazione

Sotto le foto della mia realizzazione 







Per praticita' ho montato il nodeMCU su una breadboard. Una scheda millefori andrebbe bene ugualmente.












Sopra il dettaglio della connessione del pin dati della striscia led.





Sopra il dettaglio dei collegamenti tra i fili del caricatore per cellulare (neri a sinistra) e i fili (bianco e rosso) di alimentazione della striscia. Come potete vedere e' presente il condensatore e il filo blu che proviene dal pin GND del nodeMCU.

Io ho utilizzato un mammut ma altre soluzioni sono possibili in caso ne siate sprovvisti.








Test

Sotto potete vedere le luci appese alla parete del mio studio pronte per essere testate.
Ovviamente dopo 8 Dicembre le montero' sull'albero ma per il momento non e' possibile. :)






Qui il video che dimostra i 10 effetti luminosi implementati in questo progetto.





Chiaramente potete sbizzarrirvi con la fantasia ed implementare altri effetti luminosi. 
Se lo fate condivideteli qui sul blog cosi' ne potranno beneficiare tutti




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










mercoledì 25 ottobre 2017

Remote Control a nodeMCU with RemoteXY - Led Control









In this post I describe a simple and intuitive way to remotely control a nodeMCU through a mobile application from iOS and Android devices.

More in detail I will show how to remotely pilot a led through the  RemoteXY application


RemoteXY

RemoteXY includes: 

  • a Web application to easily design and build a graphical interface and to generate the necessary source code for the controlling board (ESP8266, Arduino, ...)
  • a Mobile app for iOS and Android to remotely control over Bluetooth or WiFi the remote board


In order to create a complete application with RemoteXY it is necessary to follow 4 simple steps::

Step #1 : Graphical Interface

Building a graphical interface with a simple drag&drop editor available here








Step #2: Source Code Configuration

Configure and generate the sketch source code to be uploaded on the control board  (ESP8266, Arduino)




Step #3: Upload Sketch

Compile and upload of the generated sketch on the control board (ESP8266,Arduino) through the Arduino IDE (or other supported IDE)

Step #4: Download Mobile App

Download the mobile app and install it on your client device (iOS, Android)














Configuration

After the design of the graphical interface it is necessary to configure the tool in order to generate the proper source code.





There are 4 different aspects to configure:

  • Connection
Four (4) type of connections are supported


Note: the iOS app only supports Bluetooth Low Energy aka BLE

  • Device (the control board)

The following platforms are supported


  • Communication Module
The following communication modules, to be paired with the control board, are supported:



Here some example of supported scenarios: Arduino Uno with Bluetooth HC-05 module, Arduino with ESP8266 or  nodeMCU with ESP8266


  • IDE environment
Three (3) different development environment are supported:








LED control with nodeMCU

Let's now implement a simple use case: remotely control a LED through a mobile app and nodeMCU


GUI

Use the online editor to design a simple user interface by adding a label and a switch as depicted below






Now selecting the switch (ON/OFF) it is possible to configure some simple parameters in the  Element section



For the sake of simplicity let's stick to the default parameters


Configuration

Now let's configure the code generator in the following way






This way we are telling to RemoteXY that we want to use a nodeMCU board as controller and the on-board ESP8266 as communication module and that our programming environment is Arduino.

The Connection is set to WiFi Access Point (AP) hence we are telling to RemoteXY that we want our nodeMCU to behave as a WiFi Access Point.


In such case it is necessary to configure the Module Interface section by specifying the SSID which will be broadcasted by the nodeMCU AP.

Let's also specify the TCP port on which the nodeMCU server will be listening for incoming connections.


Again for sake of simplicity let's check Open point meaning that we want an open WiFi network with no authentication.







Source Code

Now press the following button




RemoteXY will redirect us to a new page in which the generated source code is available for the user.
The source code and the RemoteXY library are available for download as zip files.





Let's now download the RemoteXY library and install it on Arduino IDE through the proper menu.
The download the source code






As we can see in the generated code some information from the previous config phase are present:
  • SSID of AP WiFI
  • Listening port

The RemoteXY_CONF[] section contains a description of the graphic interface. It will be transfer to the requesting mobile app once a connection with the nodeMCU is established.



Circuits

Now let's build the simple circuit depicted below by connecting a LED on the D4 pin of nodeMCU. Let's not forget the 100-220 Ohm limiting resistor.






Testing

Now let's compile the code and upload the binary to nodeMCU through the Arduino IDE.






Now on your mobile device (smartphone o tablet) join the new WiFi network called LedWiFi





It is now time to run the RemoteXY app on mobile and then click on the top tight + sign






Now select the WiFi point option










Now press the Connect button and the app will connect to the nodeMCU and it will download the GUI description







Now you are all set to remotely control the LED wired to the nodeMCU control board















Controllo Remoto di NodeMCU con RemoteXY - Accensione Led










In questo post descrivo un modo semplice ed intuitivo per controllare un nodeMCU da un applicazione mobile per iOS ed Android.

In dettaglio faccio vedere come pilotare un led da remoto tramite l'applicazione RemoteXY


RemoteXY

RemoteXY e' composto da

  • un applicazione Web che permette di disegnare un interfaccia grafica e di generare il codice da far girare sulla scheda di controllo (ESP8266, Arduino, ...)
  • un applicazione mobile per iOS e Android che permette di controllare da remoto tramite bluetooth, wifi la scheda di controllo


Per creare un'applicazione completa con RemoteXY bisogna eseguire 4 semplici passi:

Passo #1 : Interfaccia Grafica

Disegnare l'interfaccia grafica con una comodo editor drag&drop disponibile qui







Passo #2: Configurazione Codice Sorgente

Configurare e generare il codice sorgente da caricare sul modulo di controllo (ESP8266, Arduino)




Passo #3: Upload Sketch

Compilare e caricare il codice sulla scheda di controllo (ESP8266,Arduino) tramite l'IDE Arduino (o tramite gli altri IDE supportati)

Passo #4: Download App mobile

Scaricare l'applicazione mobile ed installarla sul dispositivo client (iOS, Android)














Configurazione

Dopo aver disegnato l'interfaccia grafica della propria applicazione e' necessario configurare il tool per generare il codice in maniera corretta




Ci sono 4 aspetti da configurare:

  • La Connessione (Connection)
Sono supportate 4 tipi diversi di connessioni

Nota: l'applicazione per iOS supporta solo Bluetooth a bassa energia (BLE)

  • Il Device (la scheda di controllo)

Sono supportate le seguenti piattaforme


  • Il Modulo di Comunicazione usato
Sono supportati i seguenti moduli di comunicazione da accoppiare con le piattaforme supportate


Quindi per esempio e' supportato Arduino Uno con Bluetooth HC-05, oppure Arduino con ESP8266, oppure nodeMCU con ESP8266


  • L'IDE che si utilizza
Sono supportati 3 diversi ambienti di sviluppo







Accensione LED con nodeMCU

Vediamo ora un semplice esempio di come controllare lo stato di un LED tramite una semplice applicazione mobile e nodeMCU

GUI

Disegniamo tramite l'editor online una semplicissima interfaccia con una label e con uno switch





Ora cliccando sullo switch (ON/OFF) e' possibile configurare alcuni semplici parametri ad esso correlati nella sezione Element



Per semplicita' lasciamo i valori di default che vanno benissimo

Configurazione

Configuriamo il codice nel seguente modo






In questo modo stiamo dicendo a RemoteXY che vogliamo usare una scheda nodeMCU con ESP8266 per controllare il nostro led e che la vogliamo programmare con l'IDE Arduino. 

La connessione e' di tipi Wi-Fi access point e quindi stiamo dicendo a RemoteXY che vogliamo che il nostro nodeMCU si comporti come un WiFi Access Point

Quindi e' necessario anche configurare la sezione Module Interface inserendo lo SSID  della rete WiFi che verra' implementata da nodeMCU

Specifichiamo anche la porta su cui il nostro server,1 che gira su nodeMCU, rimarra' in ascolto.

Infine per semplicita' impostiamo il tutto come un Open point cioe' senza autenticazione e senza password







Codice

Premendo ora il pulsante




siamo rediretti ad una pagina in cui e' visualizzato il codice per nodeMCU e dove e' possibile scaricare il codice come file zip e anche la libreria RemoteXY in formato zip





A questo punto scarichiamo la libreria ed installiamola nell'IDE Arduino tramite l'apposito menu'.
Poi scarichiamo il codice




Come possiamo vedere nel codice generato ci sono le informazioni che abbiamo inserito in fase di configurazione:
  • SSID del AP WiFI
  • Porta del server

La sezione RemoteXY_CONF[] contiene una descrizione dell'interfaccia grafica che verra' inviata all'applicazione mobile una volta stabilita la connessione tra device mobile ed il nodeMCU



Circuito

Ora creiamo il semplicissimo circuito andando ad connettere un LED sul pin D4 del nodeMCU tramite una resistenza da 100-220 Ohm





Test

Ora compiliamo e carichiamo lo sketch sul nodeMCU tramite l'IDE Arduino





Ora tramite il vostro dispositivo mobile (smartphone o tablet) collegatevi alla nuova rete WiFi chiamata LedWiFi




A questo punto lanciate l'app RemoteXY e cliccate sul segno + in alto a destra. 





Poi selezionate l'opzione WiFi point










Ora premete su Connect e l'applicazione si connettera' al vostro nodeMCU e scarichera' la definizione dell'interfaccia







Ora potete pilotare il led dal vostro telefono/tablet