Description About the Project:

An Internet of Things (IoT) based solar energy meter is a sophisticated device designed to monitor and manage the generation and utilization of solar power in a connected and intelligent manner. This device integrates IoT technology with solar energy monitoring to provide real-time data, remote accessibility, and efficient control over solar power systems.

Key components and features of an IoT-based irrigation system may include:

Power Generation Monitoring: The meter is equipped with sensors to measure the amount of solar energy generated by photovoltaic panels. These sensors capture data on sunlight intensity, temperature, and other relevant parameters affecting solar panel efficiency.

Data Acquisition : Utilizes embedded systems and microcontrollers to collect and process data from the solar panels. This data includes energy production, voltage, current, and other essential metrics.

Mobile Application: Users can control and monitor the Energy Meter through a dedicated mobile application. This application provides a user-friendly interface to view real-time data and receive notifications.

Requirements:

  1. ESP32 LEARNING BOARD V1.0
  2. ACS 721 Current Sensor
  3. Voltage Sensor
  4. 12V ADAPTOR
  5. I2C LCD(Inbuilt in Board)

Connection Layout:

I2C LCD(Inbuilt)

LCDESP32 BOARD
1SDAGPIO21
2SCLGPIO22
3VCCVin
4GNDGND
ACS 721 Current sSensor

SensorESP32 BOARD
1OUTSNS2-D4
2VCC+3V3
3GNDGND
Voltage Sonsor

SENSORESP32 BOARD
1A0SNS1-D5
2VCC+3V3
3GNDGND

Connection diagram:

[Fig1] Circuit diagram.

Procedure:

Step1: Firstly we require all these component connected as per circuit diagram (referred to Fig1).

Step2: The it is require to download and install the Arduino IDE 2.2.1 or above version (link Given Below).

Link: https://www.arduino.cc/en/software

Note: Choose the appropriate version of this software as per your system configuration.

** The Arduino IDE (Integrated Development Environment) is a user-friendly software platform for programming Arduino microcontrollers. Designed for simplicity, it enables users to write, compile, and upload code to Arduino boards seamlessly. With a straightforward interface, the IDE caters to beginners and experienced developers alike, offering a versatile environment for creating interactive electronic projects. It supports C and C++ programming languages, providing a wide range of libraries for various sensors and modules. The Arduino IDE plays a pivotal role in the open-source Arduino ecosystem, fostering innovation and making hardware programming accessible to enthusiasts and professionals in the fields of electronics and IoT.**

Step3: Add Esp32 Board to Arduino IDE that helps us to Program our ESP32 Learning Board with the IDE.

*you can follow the tutorial from Random Nerd to add the ESP32 Board with IDE

Link: https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions

Courtesy: https://randomnerdtutorials.co *

** The ESP32 is a versatile and powerful microcontroller board widely used in IoT and electronics projects. Developed by Espressif Systems, it features a dual-core processor, Wi-Fi, Bluetooth, and a rich set of peripherals. With its ample processing power and connectivity options, the ESP32 excels in applications ranging from home automation to industrial IoT. The board supports the Arduino IDE and is well-documented, making it accessible for both beginners and experienced developers. Its low power consumption and cost-effectiveness contribute to its popularity, while the integrated capabilities, such as real-time clock and cryptographic functions, enhance its suitability for a broad spectrum of projects.**

Step4: Download and Install CP210x USB to UART Driver to establish the coomnication between ESP32 and System(link given below).

Link: https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers

Step5:Go to https://blynk.io and create account or Log in (if already created).

Start doing the following:

Go to Developer Zone AND create a new template and name the project as “SMART SOLAR ENERGY METER” ,Choose hardware as ESP32, connection type as”WIFI”. (shown in fig 2.)

[FIG. 2]

Go to developer zone ->Datastream

Create 3 data streams of type virtual pins with following specifications

  1. Voltage

Pin: V0

Datatype: DOUBLE

Min: 0

Max: 25

Default value: 0

  1. Current

Pin: V1

Datatype: DOUBLE

Min: 0

Max: 25

Default value: 0

  1. Power

Pin: V2

Datatype: DOUBLE

Min: 0

Max: 100

Default value: 0

Now move to Tab WEB DASHBOARD and drag and drop 3 Gauge as shown in fig3.

[FIG. 3]

Now Select gauge 1 and name it as Voltage and choose datastream type as Voltage.

Then Select gauge 2 and name it as Current and choose datastream type as Current.

Then Select gauge 3 and name it as Power and choose datastream type as Power.

Now Save the changes.

Now go to devices->New devices.->from Templates

Select template as Smart Solar Energy Meter and device name as Smart irrigation system

Then a window pop up copy BLYNK_AUTH_TOKEN from there it is required in code at step 7.

Step6: Install Blynk IOT app in your smart phone.

Link: https://play.google.com/store/apps/details?id=cloud.blynk

Sign in with the same email as in web dashboard.

Select developer option symbol and select template SMART IRRIGATION SYSTEM.

Add 3 GAUGE from Width with Similar configuration in step 5.(Same as done in web dashboard)(reffered to fig 4)

Select each gauge and the switch and choose the respective datastream as done in web dashboard.

In Button select mode as switch(additional from web dashboard).

Step7: Program your IDE with the following code:

//Including all Libraries

#include<Wire.h>

#define BLYNK_PRINT Serial

#include <WiFi.h>

#include <WiFiClient.h>

#include <BlynkSimpleEsp32.h>

//defining dth sensor

#define VoltageSensor 5    //dth data pin

#define CurrentSensor 4 //defining soil moisture sensor pin

//Credeitials and Authentication password

char auth[] = “bC0WwU7R-UgpzB_rytcLjrIORHT0KJZl”;  //Enter your Blynk Auth token

char ssid[] = “ONEPLUS”;  //Enter your WIFI SSID

char pass[] = “adit1234”;

BlynkTimer timer;//Creating object forBlynk Timer

//Defining Void Setup

void setup() {

  pinMode(VoltageSensor,INPUT);

  pinMode(CurrentSensor,INPUT);

  Blynk.begin(auth, ssid, pass, “blynk.cloud”, 80);

  timer.setInterval(100L,update);

}

//creating function to calculate moisture,humidity and Temperature

void update(){

  float c,v,p;

  int adc = analogRead(CurrentSensor);

  float adcv=(adc*3.3)/4096;

  c=(adcv-1.65)/0.185;

  if (c < 0.16) {

    c = 0;

  }

                                 // measured voltage (3.3V = max. 16.5V, 5V = max 25V)

  float vOut;

  const float factor = 5.128;               // reduction factor of the Voltage Sensor shield

  const float vCC = 3.3;  

  int voltageSensorVal = analogRead(VoltageSensor);    // read the current sensor value (0 – 1023)

  vOut = (voltageSensorVal / 1024) * vCC;             // convert the value to the real voltage on the analog pin

  v =  vOut * factor;                               // convert the voltage on the source by multiplying with the factor

  p=c*v;

  Blynk.virtualWrite(V0,v);

  Blynk.virtualWrite(V1,c);

  Blynk.virtualWrite(V2,p);

}

void loop() {

  Blynk.run();//Run the Blynk library

  timer.run();//Run the Blynk timer

  // put your main code here, to run repeatedly:

}

Include the following libraries in your libraries:

LiquidCrystal_I2C , BlynkSimpleEsp32 and DHT

Links:https://github.com/blynkkk/blynk-library/releases/tag/v1.3.2

To include download zip file of these libraries open Arduino IDE then Under Sketch Tab go to Include Library->Add zip library then browse to the downloaded files one by one.

Following changes needs to be done in code:

1.Replace auth[] with BLYNK_AUTH_TOKEN copied in step 5.

2.Replace ssid[] with your WiFi ID.

3.Replace pass[] with your WiFi password.

Step7: Upload the codeafter selecting Correct port and board.

Board Name: ESP32 DEV MODULE

Port: Reffer to system device manager

Enjoy your project by controlling Smart Solar Energy Meter with Mobile Application and Web Dashboard.

Benefits and Application:

Security Measures: Implements robust security protocols to protect the integrity and confidentiality of the data being transmitted. This is crucial, especially when dealing with sensitive information related to energy production and consumption.

Remote Monitoring and Control: Users can monitor Energy Meter from anywhere with an internet connection, providing convenience and flexibility.

Things To Try by Self:

We can add on other sensor like ph sensor and PIR motion sensor and air quality sensor to keep track on ph ,Animal Invasion and fire.