Arduino IOT Project: Monitor Multiple analog sensors using Nodemcu ESP8266 and blynk
HTML-код
- Опубликовано: 20 июл 2024
- Download circuit diagram and Programming:
www.electroniclinic.com/monit...
Subscribe to my New RUclips Channel, if you want to watch my videos in Hindi/Urdu
/ @letsgetstartedd
nodemcu board and library setup:
• Nodemcu esp8266 wifi M...
Nodemcu power supply making:
• Electronics Tutorial: ...
learn how to make a schematic and PCB:
• how to make a schemati...
Relay driver circuit design calculation:
• Electronics Tutorial: ...
Project Description:
*****************************
My previous tutorial was based on how to monitor an analog sensor using only Nodemcu esp8266 and Blynk application. The disadvantage of using the only Nodemcu is that you can monitor only one analog sensor, as in Nodemcu we have only one analog pin A0. There are situations when we need to monitor multiple analog sensors. But the question is how we can monitor multiple analog sensors as Nodemcu has only one analog pin A0. Well, my friends at this point we have two options.
1. We can use a multiplexer with Nodemcu esp8266 wifi module and connect multiple analog sensors.
2. We can use Arduino Uno or mega with Nodemcu esp8266 wifi module and connect multiple sensors.
******************
Purchase links for Components with best prices.
Arduino Nano USB-C Type ( recommended):
amzn.to/4ahGLdk
ESP32 WiFi + Bluetooth Module for iOT Projects (recommended), more IO pins, improved speed, and supports a Lipo Battery:
amzn.to/3v40DkE
Potentiometer:
amzn.to/2PehJHH
Nodemcu ESP8266 WiFi Module:
amzn.to/3sx24l4
LM7805 Voltage Regulator:
amzn.to/3tZx0uH
470uf capacitor:
amzn.to/3m5Nj6r
330-ohm resistor:
amzn.to/3w8PA5i
DC Female Power Jack:
amzn.to/31qcZ4b
Female Headers:
amzn.to/2QFLQYN
Male Headers:
amzn.to/3lZvt5d
LEDs:
amzn.to/3dsRt4D
Other Must-Have Tools and Components:
Arduino Uno, Nano, Mega, Micro "All types of Arduino Boards":
amzn.to/3fk5OTi
Top Arduino Sensors:
amzn.to/3vZbnfM
Super Starter kit for Beginners
amzn.to/3cq56C5
Top Oscilloscopes
amzn.to/3ctF3d8
Variable Supply:
amzn.to/2PEAqE7
Digital Multimeter:
amzn.to/2QGRPg1
Top Soldering iron kits: "best"
amzn.to/39nqDtb
Top Portable drill machines:
amzn.to/3suQMh7
Jumper Wires:
amzn.to/2NYPEDA
3D printers:
amzn.to/3ruG1dt
CNC Machines:
amzn.to/3cuZWVv
Electronics Accessories:
amzn.to/3sueV7z
Hardware Tools:
amzn.to/3m9UhaN
DISCLAIMER: This video and description contain affiliate links, which means that if you click on one of the product links, I will receive a small commission. This helps support the channel and allows me to continue to make videos like this. Thank you for your support!
****************
Follow me on Facebook:
/ 190031841821771 - Наука
Problem is fixed my dear. I do not have words to thank you. stay blessed
You are welcome. Don't forget to subscribe to my channel. support my channel by sharing videos.
In the future, if you have any questions regarding any project, feel free to contact.
@@ElectroniClinic dear ..i need ur help..
@@ElectroniClinic murshidraja1997@gmail.com
9910700796
Excellent video with all the necessary explanations. thanks bro
Very clear explanation/tutorial about serial connection and blynk usage ; thanks!!
thank you so much, it works perfectly after having some research on given information
Very nice.Thank you so much for your tutorial.
I hope you are the right one for me to solve my problem. I'm working in a project which is related with your project.
my project is. IOT based home automation and energy consumption. I've used esp8266 nodemcu and Blynk apps for home automation and it's complete but when I'm trying to measure electricity then I've noticed i need 2 analog pin for done the project and then i'll get the CT value and voltage transformer value. Now I'm finding the solution how to connect nodemcu and arduino uno because I already have this device. Thank you so much. I've subscribed your channel.
Enjoying your tutorials thanks
today i am uploading a latest version of this project.
What if my sensor value comes in via i2c. Do I just associated the get value int to the virtual pin Eg. Int (tofsensor, V4); ?
thankyou for this video that made me inspired to make the project. i would like to read 3 sensor use analog pin on arduino, and 1 rotary encoder that use a digital pin. but there is still error "sensorvalue1" doesn't declared on this scoope. please correct me if i'm wrong
#define BLYNK_PRINT Serial
#include
#include
#include
#include
char auth[] = "b9e96593f13741478cabc776aab24da2";
;
char ssid[] = "SW";
char pass[] = "santaiwae";
SimpleTimer timer;
String myString;
char rdata;
int firstVal, secondVal,thirdVal, fourthval;
void myTimerEvent()
{
Blynk.virtualWrite(V1, millis() / 1000);
}
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
timer.setInterval(1000L,sensorvalue1);
timer.setInterval(1000L,sensorvalue2);
timer.setInterval(1000L,sensorvalue3);
timer.setInterval(1000L,sensorvalue4);
}
void loop()
{
if (Serial.available() == 0 )
{
Blynk.run();
timer.run();
}
if (Serial.available() > 0 )
{
rdata = Serial.read();
myString = myString+ rdata;
// Serial.print(rdata);
if( rdata == '
')
{
String l = getValue(myString, ',', 0);
String m = getValue(myString, ',', 1);
String n = getValue(myString, ',', 2);
String o = getValue(myString, ',', 3);
firstVal = l.toInt();
secondVal = m.toInt();
thirdVal = n.toInt();
fourthVal = o.toInt();
myString = "";
}
}
}
void sensorvalue1();
{
int sdata = firstVal;
Blynk.virtualWrite(V2, sdata);
}
void sensorvalue2();
{
int sdata = secondVal;
Blynk.virtualWrite(V3, sdata);
}
void sensorvalue3();
{
int sdata = thirdVal;
Blynk.virtualWrite(V4, sdata);
}
void sensorvalue4();
{
int sdata = fourthVal;
Blynk.virtualWrite(V5, sdata);
}
String getValue(String data, char separator, int index)
{
int found = 0;
int strIndex[] = { 0, -1 };
int maxIndex = data.length() - 1;
for (int i = 0; i
big thanks to you, you help me so much, thanks
U r welcome my dear
Hi. I'm getting the value on the blynk app only once after uploading the code. After that it is showing zero once again. However in the serial monitor the values can be viewed. Any idea why this happens?
Edit: I found the solution. Apparently there was no print Serial command in the NodeMCU coding so it was hard resetting regularly
thanks for your tutorial, i'm beginner in IoT, i want to make a project that use a 4 analog sensor (MQ-6 and rotary encoder) i want to use your second option to connect node mcu and arduino uno to solve the. but i'm still confused when i want to interfacing the 4 analog sensor in one superchart (Blynk App) there's one pin analog option (adc 0). what should i do?
thankyou for ur attention, god bless you
warm regadrs from Bali, Indonesia
Don't worry if you have one analog pin.... watch my tutorials in which i used arduino with nodemcu..you can connect your sensors with arduino and then send data serially to nodemcu.. this way you can connect many analog sensors and you won't need any multiplexer... you can also use mega with nodemcu.. i have very unique tutorials on this ...
watch those tutorials... and let me know if you have any questions..
Nice work as always,
Please share link of monitor and control tutorial....
Hi i want to ask, u use one connection diagram for two coding ? One to uno one to nodemcu?
I love your videos but I want to know how to mix two of these programs
- nodemcu programming
- sensors program
How do I mix these as all of your videos always explain them differently?
Hy , i want to ask you if you have a video oder if i can connect Arduino nano (i will install wifi esp8266 ) with UV sensor ML8511 and after to see on Blynk all details about this ????
Can we connect 6 sensors through arduino to node mcu can control blynk app
To connect node mcu of tx and rx pins I think only 2 sensors
Can you make project with two arduino and esp01 using serial communication. It will be really helpful
user defined function getvalue not taking value. what should do
Which board ur choosen while uploading it to nodemcu
It is not really in parallel if you think about it. Use the photon-pixel coupling method, it is a new approach in science for reading an unlimited number of sensors in parallel. It can be done with an Arduino and an arduino cam.
Thanks for the info. Will check it out
Thank you for the tutorial. The code is working correctly but my voltage sensor value is only displaying an integer value, I need a decimal value too. What shall I do? For example value is 2.87, it shows only 2 in blynk (but in serial monitor there is 2.87)
Could you please send me the complete code
while compiling the nide mcu code it throw an error I don't know why plz help.
If I use esp01 what the difference in program?
We want an example of how to change the value of the phone, for example change the timeout for lighting a diode.
Nice.nodemcu has 1 analog pin.your video solve multiple analog pin
Excellent work as usual... Instead of using Esp8266 and arduino, is it not better to use single Esp32.? As esp32 offers multiple analog and digital pins..
I am wondering on similar project as discussed in your video.i faced problems in serial communication between arduino and Esp8266. When ever i have burn code the serial communication pins need to be removed and again plugged in...
After all i shifted my whole project to Esp32. There i faced problems with voltages.. Some of sensors needs 5v to operate and there is not any 5v Vout pin available on esp32 and also faced problems in scaling and i don't get desired outcome..
use 3.3 to 5v bidirectional converter
@@ElectroniClinic is there any provision to keep sensors like dht11, pressure and some gas sensor
hey! I can't find the code can you please help me with it?
Hi I need a help I am making a project of using node MCU and Arduino Uno to detect Toxic gases in the drainage of CO, Methane and H2 .and gives alert by buzzer it level of toxic gases increases then the servo motor turns and spread the chemicals
Please send the source code and circuit diagram
good day sir,i just want to know if the android phone is connected to the wifi or is it using data?
btw im a filipino and considiring making a similar project,im just not use to the icon that the smartphone is using,the icon about the connection i cant understand if it is connected to wifi or using cellular data,
you can connect this to wifi or use data.
hi can I use the code and edit or add a few lines of code, then to use as my sales product?
yes
@@ElectroniClinic thank you
Hey can you please tell how to send sensor value from arduino to firebase using node mcu
within two days i will upload a video on this. i am already working on this. subscribe my channel. you will get the notification.
Hello sir, how to send sensor data to blynk, but on the LCD the sensor data has appeared. how about serial communication
Watch my tutorial on iot lcd. Check playlist
can you help me buld a program with aurdino
Hi Respectable Sir,
I am using nodemcu 12e(Lolin Ch340g), tried alot to upload your code written for nodemcu but there is error" Error compilling for board NodeMCU 1.0 (ESP 12E-module)". I tried with different baud rates but still there is an error.
I tried other simple coding for nodemcu they are working fine and uploading without any error.
kindly sort out my matter. Regards
if you are getting the compiling error it means you are not using the correct libraries or you are not using the updated version of the Arduino IDE. watch my getting started tutorials on the Nodemcu Module.
this project is working perfectly and has no errors.
check your libraries.
Libraries are all there. I am using external power supply as you suggested. But i am sure it may not be the reason that I am using CH340g version of nodemcu
@@kingshahzad78 Khurram Shahzad I am not clear with the question but it seems like you are missing a driver for your board...let me tell u a solution...click here in the given link and ind the driver for CH340G...
github.com/nodemcu/nodemcu-devkit/tree/master/Drivers
Hi i'm a beginner in IOT, i am working on my final year project which is sending data from three sensors and i am using nodemcu, i tried connecting it with arduino but it doesnt seem to work? Please help
watch my recent videos
Buddy I need your help, can you please provide the connection for pressure sensor, dht 11 sensors, GPS together. Please help bro,
hello i wanna ask about the code... should we combine those 2 code into 1 and then upload it or upload the code one by one?
once code is for the Arduino and the other one is for the nodemcu.
Hello Sir, how can we read multiple sensor (6 sensors ) from arduino and send it to thingspeak via nodemcu. Thank You
Yes you can
@@ElectroniClinic Can you please share a code for that, please
Sir, please send me the code for reading temperature&humidity (dht11), pressure sensor,gas sensor, LDR, ultrasonic sensor using Arduino UNO and sending to nodemcu and displaying on blynk app. Please help me as soon as possible sir.
sir in my project there are 4 analog sensors, now how to send these data from nodeMCU to a cloud server(ubidots), what should i make changes in given program for nodemcu ? please help me in this problem please
just a few changes, define more variables. and use more virtual pins on blynk side. First make the basic one then modify the code.
@@ElectroniClinic but I want upload data on cloud server not on blynk app then what to do ?
Sir aap ka savi video bohot acha hay...kuch sikhne ko milta hay aap k savi video mey,, but mayne aap ko ek chez manga thha wo aap ne denge bol kar vi nehi diya mujhey...
kia kaha tha aap ne ?
aap phir se yaad dila do. actually sath mei aur kaam itne hote hain ke bhool jata hun.
@@ElectroniClinic sir aap ko self arduino uno ka pcb file dene ke liye bola tha..or aap ne mujhe mail id mange the..
debs9804@gmail.com
ohhh haan abhi yaad aya. abhi send kerta hun. 2 mints.
ho gaya send, check karo apna email.
@@ElectroniClinic Thank U Sir.😀😀
Hi, could you please help me, i can't Find the library (sipletimer.h) can you please tell where can I download it? thanks in advance
Available on my website
Okay this is for int, how do I send float data?
Convert this into string
@@ElectroniClinic I tried the same code but changing your "toInt" to my "toFloat" but the "toFloat" function is not recognized. Can you help me with certain links or maybe just a short video of sending float data, no need to be from a sensor, just set a random float data and send to nodemcu. That would be very helpful :)
watch my tutorial on car accident monitoring system using gps and gsm... in that tutorial i have explained how to conver a float into string...watch that tutorial.
Hi Fahad, if i have to transmit more value ( more than 10 values to NodeMCU from Mega board ), can you please share some hints on this.
you can use the same method.
@@ElectroniClinic I tried but 11th 12 and 13th values in the string is not getting received
then make two messages. first send one message and then the 2nd message. use the same method.
each string can consists of 3 or 4 sensors values.
@@ElectroniClinic at receiver side how to get multiple strings this is the code which I am using to get the values.
void loop()
{
(Serial.available() == 0 )
{
Blynk.run();
timer.run(); // Initiates BlynkTimer
}
if (Serial.available() > 0 )
{
rdata = Serial.read();
myString = myString+ rdata;
delay(1000);
//Serial.print(rdata);
if( rdata == '
')
{
String l = getValue(myString, ',', 0);
String m = getValue(myString, ',', 1);... This continues till 13
How I receive multiple values from Nodemcu in android studio app please guide me
watch my video on android app designing
sir, my i ask, why you dont use just 1 microcontroller, such as node mcu only
Sir,if i want to send sensor data to webpage then what should I do?
watch my tutorial on firebase. you can send values to the google firebase database.
another option is you can create your own database using mysql and upload your sensors data on a website.
Getting the error:espcomm_upload_mem failed. How to resolve it? Please help me.
update your nodemcu board and install the libraries.
@@ElectroniClinic
now it is showing Error compiling for board nodemcu1. 0
Hey bro can you do a similar video but to upload the data to firebase instead of blynk?
I have many videos on firebase, kindly check playlist.
Bro, How to send multiple values one by one from Arduino to nodemcu and then to cloud...??
you can watch my latest videos on different iot Cloud platforms.
Hi sir. I just want to ask, why in the nodemcu coding you used sdata, but in arduino coding you use sdata1, sdata2, and sdata3? Also, My device on blynk is offline. I use LM35 as sensor.
These are just the variable names.
Change ur router name and password and also use ur authentication code.
@@ElectroniClinic okay, I fixed it. The device is online now. But it read 0.......
@@ElectroniClinic I can change it to any variable right? What if in arduino coding, i set temp as my variable, do i have to change the sdata to temp as well on the nodemcu coding? I want to avoid using sdata1 because it cannot calculate the temp formula in celcius...
You can use any variable names.
sir make combining program 2 sensors in blynk apps with node mcu only
pleaseee ;)
Did you make it?
@@nuclearblast5688 yes i have done wkwkw
@@muhammadprawirayuda3510 Oh bagus. But I don't know how to add pir sensor code to my existing project code..
with sensor ?
@@muhammadprawirayuda3510 yes I'm doing IOT based pet feeder.. it has 1 ultrasonic sensor and I'm planning to add pir motion sensor as well.. but I don't know how to combine the program together.
third option connect multiple node mcu
I have been thing about this to connect more nodemcu modules with one app
Electronic Clinic may I ask for your help...I am for a month try to connect 2 or more node mcu to the same broker using MQTT protocol...but I got nothing..I just want to my 3 nod mcu communicate between each other using MQTT protocol..through any broker like adafrit for example
@@ElectroniClinic May I ask for your help if it is possible...for a month I am working on connecting 2 or more node mcu to the same broker like adafrut for example or any broker using MQTT protocol. but I got nothing..may be you could help me ..thanks
Multiple nodemcu tutorial is upload. Check
Why your website is not working?????????
The website will be online in a few hours.
*I have one very important Doubt!!* --> U have used 7805 regulator and providede the 5 volt line to the arduino as well as to the ESP8266, but the esp8233 can't handle a digital signal of 5 volts, it's designed for 3.3volt signal,
so Why u have directly connected the RX and the TX pins of arduino that operates at 5 volts and directly connected them with the esp8266, why???
in this way the ESP8266 will damage, isn't it true???
I did it just to explain the idea, in reality, you will have to use a 5v to 3.3v converter and vice versa.
@@ElectroniClinic Ok thanks 🙏
Need help
Bro can u provide code..?
you can download the code from my website electroniclinic.com
@@ElectroniClinic bro, I need ur help bro,How can I approach.. ?plzz bro, It's urgent small help.. 😞😞... I refered so many videos, websites but no use, finally u give me a hope plzz bro...
I am using Arduino Iot cloud, I watched ur video for serial communication from Arduino to nodemcu, serial communication is working, u wrote nodemcu.print(cdata) ;this line directly print in nodemcu serial monitor,, how to assign that data to cloud variable..
can I get your email?