Receive data In nodemcu 8266 from Arduino Uno

I want to do a project where Arduino UNO will receive data from three sensors and Uno will send the data to NodeMCU 8266, and NodeMCU 8266 will connect to Blynk. I am very beginner in Arduino World. Please suggest to me how I can do it. You can also provide me with some tutorials/Posts and your beautiful comment. Thank You.

What sensors?
What have you tried so far?
I think you'll find help more forthcoming if you make an attempt and post results for correction.

1. Connect UNO and Node using Software UART (SUART) Port as per Fig-1 and leave the hardware UART P0rts aside for debugging purposes.


Figure-1:

2. To test the functionality of the connection of Fig-1, upload the following sketches into UNO (Sender) and Node (Receiver). Check that A appears on SM2 at 1-sec interval.

Sketch of UNO

#include<SoftwareSerial.h>
SoftwareSerial SUART(5, 6);//SRX = 5, STX = 6

void setup()
{
  Serial.begin(9600);
  SUART.begin(9600);
}

void loop()
{
  SUART.println('A');
  delay(1000);
}

Sketch for Node:

#include<SoftwareSerial.h>
SoftwareSerial SUART(D2, D1);//SRX = D2, STX = D1

void setup()
{
  Serial.begin(9600);
  SUART.begin(9600);
}

void loop()
{
  byte n = SUART.available();
  if (n != 0)
  {
    char y = SUART.read();
    Serial.print(y);
  }
}
1 Like

While you can have the sensors connected to a Uno and have the Uno talking to the ESP8266, why not have the sensors connected directly to the ESP8266? What you can do with a Uno you can do with the ESP8266 provided you have sufficient pins for the sensors. Once you install the ESP8266 library in your IDE, you will find plenty of examples under File->Examples. Make sure you select the ESP8266 board first.

There is an instructable here which might be a useful starting point for working with Blynk:

2 Likes

Waste of a UNO - which is inconvenient anyway. Why would you not simply connect the sensors to the NodeMCU?

Far easier and more efficient approach, as @BitSeeker points out.

1 Like

If the OP is a Learner and not a Developer, then connecting two Arduinos will offer him the opportunity of acquiring more knowledge and skills in Arduino Programming.

You might think you want to do that, but actually you don't. As a beginner, you won't realise how difficult that can get. You have to write 2 sketches, debug them, get communications working between them, debug that... There is an easier way, as several have already mentioned. Choose your sensors carefully and the smaller number of pins on the esp8266 won't be a problem.

I would recommend a wemos D1 mini rather than nodeMCU. It might appear to have fewer pins, but actually it has the same number of useful pins, the other pins on the nodeMCU are simply not useful. The D1 mini will take up much less space on your breadboard while you are building your prototype circuit.

1 Like

Please, give the type numbers or links of your above three sensors.

It certainly will, but deliberately doing things "the hard way", whilst I understand it is popular in the military, is not always effective. :roll_eyes:

1 Like
  1. Ph sensor
  2. DS18B20 Digital Temperature sensor
  3. TDS Meter

Right!

The OP may --

  1. Connect one sensor with Node and see the result on SM.
  2. Connect second sensor with Node and see result on SM.
  3. Connect third sensor with Node and see result on SM.
  4. Connect Node and UNO using SUART Port.
  5. Send signal of sensor-1 from Node to UNO.
  6. At UNO side collect sensor-1 signal from UART Port and show on SM.

If it is possible to include all these three sensors in NodeMCU esp8266, would you please suggest the pin setup for these? If I can avoid UNO, there is no problem. Thank You

Ph is analog or digital? Give the type number.
TDS is analog or digital? Give the the number.

As @Paul_B has suggested, use only the Node and check the functionalities of all the sensors one by one.

Only when you provide the Web links to each of the sensors.

OK, the DS18B20 is not a problem, it is a common part. But the others are not.

1 Like
  1. PH sensor
    Analog pH Sensor / Meter Kit For Arduino Robotics Bangladesh

  2. DS18B20 Digital Temperature sensor
    Waterproof DS18B20 Digital Thermal Probe or Sensor Robotics Bangladesh

  3. TDS Meter
    TDS Meter V1.0 Module Water Quality Sensor for Arduino Robotics Bangladesh

You have two analog sensors - Ph and TDS. Node has only one ADC channel. So, leave aside the Node and use UNO which has 6 ADC channels.

But, you need Node to talk with Blynk; so, ultimately back to square; you need setup of Fig-1 of post #4.

1 Like

@alaminrifat
Do you have the Blynk part nailed down - or is that part on your to-do list?

I would recommend an ads1115 or ads1015 module or similar to give the esp8266 some more analog inputs. This should avoid the need to use the Uno. However, the libraries for the pH and TDS sensors may not be compatible with the ads1115/1015 library, I am not sure. EDIT: a quick review of example code used with these sensors indicates no library is used, so there should be no problems using the ads1115/1015 library.

in todo list