Check out my 2 YOUTUBE channels for more:
- Mrzaizai2k - AI (NEW)
- Mrzaizai2k (old)
LED Control with Android app via Wifi to NodeMCU and Arduino Uno then send data back to the app.
YOUTUBE LINK: IOT with Arduino Uno, NodeMCU, MIT app _ Mrzaizai2k
My Arduino code, circut diagram & apk. file (MIT App): https://drive.google.com/open?id=1pGBlIQ7Rhmqb2475-qOyBZvDtrR75e32
References:
- How To Build Custom Android App for your Arduino Project using MIT App Inventor: https://www.youtube.com/watch?time_continue=69&v=o-YVvxYiSuk&feature=emb_logo
- MIT App Inventor: http://appinventor.mit.edu/
- How to make SoftwareSerial Communication between Arduino Uno and NodeMCU: https://www.youtube.com/watch?v=BfUtpScdQ9Y
- Dự án xe điều khiển từ xa qua Internet với iNut Cảm biến kết nối với wifi trong nhà hoặc USB Wifi 3G: http://arduino.vn/tutorial/5781-du-xe-dieu-khien-tu-xa-qua-internet-voi-inut-cam-bien-ket-noi-voi-wifi-trong-nha-hoac
- MIT APP INVENTOR 2 -nodemcu wifi car control app: https://www.youtube.com/watch?v=nVYCTKWcq24&t=25s
- NodeMCU Server | Control via WebBrowser | RoboShala Hindi: https://www.youtube.com/watch?v=rs2CwV8ilPI&t=12s
- Ledon_Uno 1.1 Overview 1.2 How It Works
- Ledonwifi 2.1 Overview 2.2 How It Works
The Ledon_Uno
Arduino sketch integrates an ultrasonic sensor (HC-SR04) and an LED controlled by an Arduino Uno. It communicates with a NodeMCU (ESP8266) via SoftwareSerial. The ultrasonic sensor measures distance, and the LED is controlled based on commands received from Ledonwifi
.
-
Setup:
- The HC-SR04 ultrasonic sensor is connected to pins 8 (trig) and 7 (echo).
- An LED is connected to pin 12.
- Communication between Arduino Uno and NodeMCU is established using SoftwareSerial on pins 3 (RX) and 2 (TX).
- OpenAI API credentials are set up.
-
Distance Measurement:
- The
distance()
function measures the distance using the HC-SR04 sensor and returns the result in centimeters.
- The
-
Communication with NodeMCU:
- The Arduino Uno sends the distance data to NodeMCU via SoftwareSerial.
- NodeMCU processes the data and controls the LED based on specific commands.
-
Data Transmission:
- The Arduino Uno continuously measures and sends the distance data to NodeMCU.
- NodeMCU toggles the LED on or off based on commands received from
Ledonwifi
.
The Ledonwifi
Arduino sketch runs on a NodeMCU (ESP8266) and serves as a web server. It receives commands via HTTP requests to control the LED on Ledon_Uno
and obtain distance information.
-
Setup:
- NodeMCU is connected to a Wi-Fi network.
- A web server is set up on NodeMCU.
-
LED Control:
- Commands like "LEDon" and "LEDoff" are received via HTTP requests.
- The corresponding functions (
LEDon()
andLEDoff()
) are executed to control the LED onLedon_Uno
.
-
Distance Information:
- The "distance" command is processed to obtain distance data from
Ledon_Uno
. - The data is sent back to the client (browser) that made the HTTP request.
- The "distance" command is processed to obtain distance data from
-
HTTP Server Handling:
- The server continuously listens for client connections and responds to requests.
Note: Ensure that the Wi-Fi credentials in Ledonwifi
match your network settings, and the OpenAI API key in Ledon_Uno
is secure and not publicly shared.