Use my phone and NodeMCU ESP8266 to control LEDs

Thread Starter

Hammad Imtiaz

Joined Oct 24, 2016
9
Hi. I would like some help with this project of mine. Basically, I wanted to use an android app to decide when to turn an LED, connected to my ESP8266, on or off via the touch screen. The app itself could be done using android studio, but what confuses me is that once I have the app ready, how do I use the app in tandem with the ESP micro-board? The only thing that comes to my mind is that if I use the app to store a value for the required state (ON or OFF) in a document online and have the ESP access that and read the value and apply the change to the LED.
However, I am a beginner at this so I'm really not sure how that would work practically.
Does anyone have any idea to achieve this? The end goal is to be able to control the lights from a phone app through the internet. Any insight would be greatly appreciated.
 

spinnaker

Joined Oct 29, 2009
7,830
You can do it with Bluetooth. Take a look at the HC05 module. They are available on eBay.

If you want to do it over wifi it becomes more complicated but there are modules for that too.
 
Hi. I would like some help with this project of mine. Basically, I wanted to use an android app to decide when to turn an LED, connected to my ESP8266, on or off via the touch screen. The app itself could be done using android studio, but what confuses me is that once I have the app ready, how do I use the app in tandem with the ESP micro-board? The only thing that comes to my mind is that if I use the app to store a value for the required state (ON or OFF) in a document online and have the ESP access that and read the value and apply the change to the LED.
However, I am a beginner at this so I'm really not sure how that would work practically.
Does anyone have any idea to achieve this? The end goal is to be able to control the lights from a phone app through the internet. Any insight would be greatly appreciated.
The way that this is commonly done is through HTML using a simple browser on your phone and the ESP8266 listening for instructions.

Here is an example that I did 2+ years ago. Here is another example from a project (and a system) by @Robin Mitchell right here on the site.

I don't know enough Android studio to know how to do it (it's on my very long list), but I can't help but think an App could be used as a custom client to connect to the ESP8266 server over an internet connection.

Bluetooth could also work, but of course, you have some obvious distance limitations. Also, unless you used an ESP32 (not an 8266), you would need to add a device such as an HC05 as has been mentioned. The ESP32 has Bluetooth although I have not seen much of anything that actually demonstrates the capability in a useful way - no doubt that will change if/when the capability is fully integrated into the Arduino IDE.

The way I am recommending, however, means you can control the LED from anywhere you are connected to the internet. The ESP8266 has to, of course, also be connected and accessible.
 
Last edited:

be80be

Joined Jul 5, 2008
2,072
It's really not that hard. The easy way is to poll a page on the esp. The esp then lights or turn off.
Nice page Raymond.
It's easy to connect to the esp it looks like wifi or use the esp with your wifi and ddns for around the world live control.
This is the arduino sample figured id give it a try

This is with lua and a app on my phone made wiith that mit app.
 

Thread Starter

Hammad Imtiaz

Joined Oct 24, 2016
9
Thank you for those links guys. I have a request for be80be. Could you please show some images of the functional blocks that you used in the MIT app builder? I'm talking about your second video. What steps did you take to get the app builder to edit the gpio state at the local IP? Similar to this?
upload_2017-12-23_18-29-1.png
For this interface:
upload_2017-12-23_18-30-10.png
ON is button 1 and OFF is button 2.
 

shteii01

Joined Feb 19, 2010
4,644
Thank you for those links guys. I have a request for be80be. Could you please show some images of the functional blocks that you used in the MIT app builder? I'm talking about your second video. What steps did you take to get the app builder to edit the gpio state at the local IP? Similar to this?
View attachment 142320
For this interface:
View attachment 142321
ON is button 1 and OFF is button 2.
lol

bluetooth: http://www.instructables.com/id/Control-LED-Using-MIT-App-Inventor-and-Arduino/

wifi: http://randomnerdtutorials.com/esp8266-controlled-with-android-app-mit-app-inventor/
 
Top