Hardware Required
- USB Cable - 1
- NodeMCU ESP8266 Cp2102 Wireless Module - 1
- 5v 1 Channel Relay Module - 1
- Bread Board 840 Point - 1
- Jumper Wire (male to female) - 40 pcs
- Single Stand Wire - 1
- Bulb Holder And Plug - 1 (not included)
- Bulb - 1 (not included)
Introduction
In this project, we have used the Relay module with NodeMCU which will turn On/Off the Bulb using an application.
HARDWARE REQUIRED
- USB Cable - 1
- NodeMCU ESP8266 Cp2102 Wireless Module - 1
- 5v 1 Channel Relay Module - 1
- Bread Board 840 Point - 1
- Jumper Wire (male to female) - 40 pcs
- Single Stand Wire - 1
- Bulb Holder And Plug - 1 (not included)
- Bulb - 1 (not included)
SOFTWARE REQUIRED
Arduino IDE 1.8.5 (programmable platform for Arduino)
Click To Download :https://www.arduino.cc/en/Main/Software
SPECIFICATIONS
5v 1 Channel Relay Module
- Number of I/O Channels: 1
- Type: Digital
- Control signal: TTL level
- Max. Allowable Voltage: 250VAC/110VDC
- Max. Allowable Power Force: From C(800VAC/240W), From A(1200VA/300W)
NodeMCU ESP8266 Cp1202 Wireless Module
ESP8266EX offers a complete and self-contained Wi-Fi networking solution; it can be used to host the application or to offload Wi-Fi networking functions from another application processor. When ESP8266EX hosts the application, it boots up directly from an external flash. In has integrated cache to improve the performance of the system in such applications.
- NodeMCU ESP-12E dev board can be connected to 5Vusing micro USB connector or VIN pin available on board.
- The I/O pins of ESP8266 communicate or input/output max 3.3V only. I.e. the pins are NOT 5V tolerant inputs.
- In case you have to interface with 5V I/O pins, you need to use level conversion system (either built yourself using resistor voltage divider or using ready to use level converters.
ESP8266 NodeMcu Installation
STEP- 1 Installing Arduino Core for NodeMCU ESP-12E Using Arduino Boards Manager
As shown in the image, Copy the .json link with the latest stable release of NodeMCU package from
https://github.com/esp8266/Arduino#installing-with-boards-manager
The link should look something like this-
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Step 2: Insert Link for .json NodeMCU Package Files into Arduino IDE
Paste the copied link and insert it in Arduino IDE using following sequence-
File -> Menu -> Preferences
Paste copied the link into the area shown in the black box in the above image. Close and restart the Arduino IDE.
Step 3: Tools - Boards Manager
Tools -> Boards manager and search for ESP8266 and install the libraries/files given under heading ESP8266 by ESP community.
Restart the Arduino IDE once again.
Troubleshooting:
If you get an error as shown in image below:
Just go back to Preferences, as shown in the step-2 image.
- Here, you can see the location (Marked with red box) C:UsersREES52.COMAppDataLocalArduino15preferences.txt
- Go to this location and delete all JSON Packages from Arduino15 folder. Now, Back to Board Manager and search for ESP8266 you will surely find.
Step 4: Selecting NodeMCU Board in Arduino IDE
Go to Tools -> Boards (scroll down the list of boards) - Select NodeMCU 1.0 (ESP-12EModule).
Select the Port number at which you have connected NodeMCU. Rest of the settings can be left to default values.
CIRCUIT CONNECTION
- Attach NodeMCU on Breadboard.
- Connect VCC of Relay with Pin 3.3V of NodeMCU.
- Connect GND of Relay with GND of NodeMCU
- Connect Pin Signal of Relay with Pin D7 (GPIO 13) of NodeMCU
- Connect one terminal of Bulb (Blue Wire) with Pin NC (Normally Close) of Relay.
- Connect one terminal of Adapter with Pin C (Common) of Relay.
- Connect the other terminal of Bulb (Red Wire) with another terminal of Adapter.
CODE
https://drive.google.com/open?id=1W0rNXebx3ZJno9fdYVo-RVhoNnVLrdzz
WORKING
Welcome to the NodeMCU Based Project which consists of the Relay module and Bulb. The basic working principle of the circuit is being described here. We can turn Bulb ON/OFF using a Relay module and Blynk Application. After all, connections are done inappropriate manner, then upload the code and open the Serial monitor. Now, copy and paste the given IP on Browser of Phone/System. Now, you can access the application.