Project showcase
Serial Communication between NodeMCU and Arduino

Serial Communication between NodeMCU and Arduino © GPL3+

Serial Communication between ESP2866-12 (NODE-MCU) and Arduino to increase the number of analog pins as my primary work.

  • 14,444 views
  • 3 comments
  • 17 respects

Components and supplies

Apps and online services

Ide web
Arduino IDE
Arduino IDE with ESP board manager.
adafruit.io

About this project

This project is all about serial communication between ESP8266-12(NODE-MCU) and Arduino. As we know ESP-12 have one analog pin where we can connect our analog sensor, But what else if we need more than one analog pin to connect more analog sensor and again if you want to send data to server like adafruit.io or your own server.

A video tutorial to follow, Hope it helps.

Serial communication between Node MCU and Arduino

Code

Arduino_Code.inoC/C++
#include <dht.h>
dht DHT;
int temp,humi;
#define DHT11_PIN A0
String str;
void setup(){
 Serial.begin(115200);
 Serial1.begin(115200);
 Serial.print(char(169)); // Copyright Symbol
 Serial.println(" Myengineeringstuffs.com");
 delay(2000);
}
void loop()
{
  DHT.read11(DHT11_PIN);
  humi=DHT.humidity;
  temp=DHT.temperature;
  Serial.print("H: ");
  Serial.print(humi); 
  Serial.print("% ");
  Serial.print(" T: ");
  Serial.print(temp); 
  Serial.print(char(176));
  Serial.println("C");
  str =String('H')+String(humi)+String('T')+String(temp);
  Serial1.println(str);
  delay(5000);
}
Node-MCU-Side.inoC/C++
void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
}

void loop() { // run over and over
  if (Serial.available()) {
    Serial.write(Serial.read());
  }
}

Schematics

Arduino and Node MCU circuit
arduino-nodemcu_gRDU1UZVkU.fzz
Arduino and Node MCU circuit
arduino-nodemcu_OjnaKz5IO1.fzz

Comments

Similar projects you might like

LoPy - Arduino Serial Communication

by Rob Braggaar

  • 3,571 views
  • 1 comment
  • 10 respects

Arduino - Serial Communication Visual Studio

Project tutorial by whitebank

  • 16,291 views
  • 5 comments
  • 16 respects

Spark (3.3v) to Arduino (5v) Serial Communication

Project tutorial by Garrett Bartley

  • 5,423 views
  • 0 comments
  • 13 respects

Communication Between Arduino UNO

by Giovanni Gentile

  • 2,530 views
  • 1 comment
  • 4 respects
Add projectSign up / Login