Iot Power Measurement Module: Presented by
Iot Power Measurement Module: Presented by
Iot Power Measurement Module: Presented by
PRESENTED BY
RAFID HAMID ABDULRAZZAQ, ABDULLAH WALAA, & AHMED KAMEL
2ND STAGE (EVENING STUDY)
DR. OMAR YOUSSEF
TABLE OF CONTENTS:
INTRODUCTION……………………………………………2-5
SUPPLIES ………………………………………………………5-6
Switch ………………………10
SCHEMATIC …………………………………………13
RESULTS …………………………14
CODE………………………………………15-17
1
IOT POWER MEASUREMENT MODULE
INTRODUCTION:
long term, with enough clean energy for the ever raising
2
concerns regarding privacy, cyber security, health safety, fire
3
experts that by the year 2020, about 50 billion devices will
4
encouraging them to use less energy to save money. In
affordable solutions.
SUPPLIES:
6. OLED Display
5
10. 22uF electrolytic capacitor
6
Adding the Screw Terminals: First of all, we solder the screw
fluctuations.
7
Arduino for measurement. For measuring the current, using
between the load and the ground. This way the small voltage
approximate gain of 46. The resistor and the OpAmp are not
8
Then using a 7805 voltage regulator I am converting the 7
volts to 5 volts for the Arduino and the OLED and using an
WiFi Module. Why so much for the power supply you ask? The
about 18-20 volts which can be too high for the linear
9
Adding a Switch: added a switch in between the buck
only the measurement and IoT functions will not work. The
headers for the WiFi module just next to where the Arduino
volts and not 5 volts. The Arduino and the WiFi module
10
connect the Tx of ESP to Rx of Arduino as Arduino is 3.3v
compatible.
need 4 connections, two for power supply and 2 for the I2C
with male header to connect the I2C pins and directly solder
11
Final Look: After finally completing all the soldering process
this is what the board looks like! The interesting part is the
12
SCHEMATIC DIAGRAM:
module.
13
RESULTS:
the setup using my 50 Watt solar panel and a 12V 18AH lead
acid battery.
14
ARDUINO CODE:
15
display.display();
EspSerial.begin(9600);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
// Clear the buffer.
display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0);
display.setTextColor(WHITE);
}
void loop()
{
// taking average for stable readings
for(int i=0; i<20;i++)
{
current=current+analogRead(A1);
voltage=voltage+analogRead(A0);
delay(2);
}
current=current/20;
current=(current*0.068); // calibration value will change depending upon the gain of Op Amp
circuit and resistance of the shunt
if(current<0)
current=0;
voltage=voltage/20;
voltage=voltage*2.485; // calibration constant depends upon the voltage divider network
display.setCursor(0, 0);
display.print("Voltage: ");
display.print(voltage);
display.println(" V");
16
display.setCursor(0, 10);
display.print("Current: ");
display.print(current);
display.println(" A");
display.setCursor(0, 20);
display.print("Power: ");
display.print(voltage*current);
display.println(" W");
display.display(); //you have to tell the display to...display
delay(500);
display.clearDisplay();
Blynk.virtualWrite(V5,voltage);
Blynk.virtualWrite(V6,current);
Blynk.virtualWrite(V7,voltage*current);
}
17