Arduino and Nodemcu two way communication, Control and Monitoring

(Last Updated On: July 17, 2019)

Arduino Nodemcu

Description:

Arduino Nodemcu two way communication – In this Tutorial, you will learn how to do two way communication between Arduino and blynk through Nodemcu esp8266 wifi module. At the end of this tutorial, you will be able to monitor multiple analog sensors and you will also be able to control multiple loads. In this project, no multiplexers will be used. All the sensors and loads will be connected with the Arduino in a normal way while the Nodemcu esp8266 wifi module will be used as the bridge only. Let’s get started


The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
Nodemcu esp8266 wifi module: Best price: https://amzn.to/2NAvmiB
12v 10A SPDT relay: https://amzn.to/2MThQBK
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

This project is basically based on the Serial communication between the Arduino and nodemcu esp8266 wifi module. As you know in Nodemcu esp8266 wifi module we have only one Analog pin and have less number of Input/Output pins, to increase the number of Analog pins and digital pins the best choice is to connect the Nodemcu module with the Arduino Uno or Mega.


Circuit Diagram:

Arduino Nodemcu

Let’s have a look at the complete circuit diagram. This schematic is designed in cadsoft eagle 9.1.0 version. If you want to learn how to make schematics and PCB’s then watch my tutorial Click Here”.

The power supply is already explained in my previous tutorials, you can use this power supply to power the Arduino by connecting its output with the Vin pin of the Arduino. But I will connect a 12v adaptor directly with Arduino and  I will power up the Nodemcu esp8266 using the Arduino’s 5v and ground. As you can see the Arduino’s 5v is connected with vin pin of the Nodemcu and the ground is connected with ground. All the grounds are connected. A variable resistor is connected with A0 pin of the Arduino, an LDR is connected in series with a 10k resistor, which makes a voltage divider and is connected with A1 pin of the Arduino. The tx and Rx pin’s of the Nodemcu are connected with pin2 and pin3 of the Arduino. So the Nodemcu will communicate serially with Arduino Uno through pin2 and pin3. Pin2 is Rx and pin3 is tx, which will be defined in the programming using the software serial library.


For controlling these relays we will need relay drivers, the relay drivers simply consists of the 2n2222 NPN transistors, 10k ohm resistors, and diodes. As you can see a 10k resistor is connected with the base of 2n2222 NPN transistor as it’s a bjt “bipolar junction transistor” a current controlled device, that’s why we need a current limiting resistor. We usually use a 10k resistor. The emitter of the 2n2222 NPN transistor is connected with the ground while the collector is connected with one side of the relay coil, while the other side of the relay coil is connected with 12v. This relay can be energized and de-energized using this transistor.  As you can see this relay consists of 5 pins, two coil pins, common, normally closed and normally open. These three pins have no physical connection with the coil pins.

Arduino Nodemcu

So this is the relay module, you can also use the readymade relay module.


Arduino Nodemcu

these are 10k resistors connected with the base of 2n2222 NPN transistors,

Arduino Nodemcu

these are the 1n4007 diodes connected across the relay coil pins,

Arduino Nodemcu

these are 12v SPDT type relays and these are the terminal blocks. I have soldered some jumper wires so that this relay module can be easily interfaced with other circuits. This relay module consists of 7 relays but I will be using 2 relays. Connect 2 relays with pin number13…and …pin number12 of the Arduino Uno or mega And connect the relay module ground with the ground of Arduino.

Blynk Application:

For the step by step blynk application designing watch Video tutorial Click Here”.

This is how the blynk application looks like.

Arduino Nodemcu

Arduino and Nodemcu Programming:

Arduino Programming:


Nodemcu Programming:

Watch Video Tutorial:

 

Other Nodemcu and Arduino Related Projects:

YouTube Views and Subscribers count using Nodemcu ESP8266 & Arduino

 

IOT 3 Phase Transformer Load monitoring using Arduino and Nodemcu

 

IOT Water Quality monitoring using Arduino,pH Sensor,Nodemcu ESP8266

 

Nodemcu ESP8266 IOT Power Lines Mains frequency monitoring 50Hz

 

IOT light dimmer using Arduino and Nodemcu esp8266 wifi module

 

Nodemcu and BMP180 “temperature, pressure & Altitude” internet of things project “iot”

 

Arduino IOT Project: Nodemcu ESP8266 wifi Robot Car “L298N motor driver + Blynk + Joystick”

 

Nodemcu GPS Tracker using Arduino Nodemcu esp8266 and Blynk

 

Multiple analog sensors monitor using Nodemcu esp8266

 

 

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply