top of page

How to make a Home Automation System using Blynk2.0 and NodeMCU

Create Automation System using NodeMCU and Blynk2.0 to control Lights and Fans of a room, also monitor environmental parameters on your hand.

Description:

Sure, here’s a step-by-step guide to create a home automation system that controls two devices and displays temperature data from a DHT22 sensor on an LCD using NodeMCU and Blynk:


Step 1: Gather Materials

- NodeMCU (ESP8266)

- DHT22 temperature and humidity sensor

- 16x2 LCD display with I2C module

- Two relays (for controlling devices)

- Breadboard and jumper wires

- Power supply (5V for relays, typically USB for NodeMCU)

- Blynk app installed on your smartphone


Step 2: Set Up Blynk

1. Create a Blynk Account: Download the Blynk app from the App Store or Google Play and create an account.

2. Create a New Project: In the Blynk app, create a new project. Select "NodeMCU" as your device and note down the authentication token sent to your email.

3. Add Widgets:

- Add a button widget for each device you want to control.

- Add a labeled value widget to display temperature data.

- Optionally, add a gauge or graph widget to visualize temperature data.


Step 3: Set Up Hardware

1. Connect the DHT22 Sensor:

- VCC to 3.3V on NodeMCU

- GND to GND on NodeMCU

- Data to digital pin D4 on NodeMCU


2. Connect the LCD Display:

- Connect the I2C module to the LCD.

- SDA to D2 on NodeMCU

- SCL to D1 on NodeMCU

- VCC to 5V on NodeMCU

- GND to GND on NodeMCU


3. Connect the Relays:

- Relay 1 IN pin to D5 on NodeMCU

- Relay 2 IN pin to D6 on NodeMCU

- VCC to 5V

- GND to GND


Step 4: Install Libraries

In your Arduino IDE, install the following libraries:

- Blynk Library: Go to Sketch > Include Library > Manage Libraries, search for "Blynk", and install.

- DHT Sensor Library: Search for "DHT sensor library" and install.

- LiquidCrystal I2C Library: Search for "LiquidCrystal I2C" and install.


Step 5: Write the Code


Step 6: Upload Code to NodeMCU

1. Connect your NodeMCU to your computer via USB.

2. Open the Arduino IDE and select the correct board and port.

3. Upload the code to your NodeMCU.


Step 7: Configure Blynk App

1. Button Widgets: Set one button to V1 and the other to V2 for controlling the relays.

2. Labeled Value Widget: Set to V5 to display the temperature data.


Step 8: Power Up and Test

1. Ensure all connections are secure.

2. Power up your NodeMCU and relays.

3. Open the Blynk app and test the buttons to control your devices.

4. Check the LCD display and Blynk app to see the temperature readings from the DHT22 sensor.

Project Gallery

All Documents :

Download the below code to make your own Home Automation System.

Click Here to Download

Video Tutorial :

Conclusion :

You’ve now built a basic home automation system using NodeMCU and Blynk! This setup allows you to control two devices remotely and monitor temperature data in real-time. Explore additional projects and skills on our website and continue enhancing your IoT expertise with Skill-Hub by EmbeddedBrew. Happy building!

Comments

Share Your ThoughtsBe the first to write a comment.
bottom of page