Tekko BDSimSimulatorProjects

এনার্জি মনিটর: LCD তে V, I ও power (ACS712)Energy monitor: real V, I and power on an LCD (ACS712)

▶ ফ্রি চালিয়ে দেখো / Run it free Parts অর্ডার করো (WhatsApp)

সার্কিট ডায়াগ্রাম · Circuit diagram

Energy monitor: real V, I and power on an LCD (ACS712) circuit diagram — Arduino Uno, DC adapter + jack (12 V), Voltage sensor (0–25 V), LCD 16x2 with I2C, Current sensor (ACS712), Light bulb, Jumper wires

যা যা লাগবে · Parts you need

তার লাগানো · Wiring

DC adapter + jack (12 V) +→Voltage sensor (0–25 V) VCC
DC adapter + jack (12 V) -→Voltage sensor (0–25 V) GND
DC adapter + jack (12 V) -→Arduino Uno GND
Voltage sensor (0–25 V) S→Arduino Uno A1
DC adapter + jack (12 V) +→Light bulb a
Light bulb b→Current sensor (ACS712) IP+
Current sensor (ACS712) IP-→DC adapter + jack (12 V) -
Current sensor (ACS712) VCC→Arduino Uno 5V
Current sensor (ACS712) GND→Arduino Uno GND
Current sensor (ACS712) OUT→Arduino Uno A0

Code (Arduino C++)

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Energy monitor: the voltage sensor divides the supply by 5 (A1), and the ACS712
// sits IN SERIES with the lamp — its output is 2.5 V at zero current and moves
// 185 mV per amp (the 5 A model). Power = V x I. Change the adapter voltage and
// watch all three numbers move.
LiquidCrystal_I2C lcd(0x27, 16, 2);
const float ACS_SENS = 0.185;    // V per A for the 5 A model (20 A = 0.100, 30 A = 0.066)

void setup() {
  lcd.init();
  lcd.backlight();
  Serial.begin(9600);
}

void loop() {
  float volts = analogRead(A1) * (5.0 / 1023.0) * 5.0;             // sensor divides by 5
  float amps  = (analogRead(A0) * (5.0 / 1023.0) - 2.5) / ACS_SENS;
  if (amps < 0) amps = -amps;                                      // DC: direction does not matter
  float watts = volts * amps;
  lcd.setCursor(0, 0);
  lcd.print(volts, 1); lcd.print("V  "); lcd.print(amps, 2); lcd.print("A ");
  lcd.setCursor(0, 1);
  lcd.print(watts, 1); lcd.print(" W          ");
  Serial.print("V="); Serial.print(volts, 1);
  Serial.print(" I="); Serial.print(amps, 3);
  Serial.print(" P="); Serial.print(watts, 2); Serial.println(" W");
  delay(500);
}

আরো project · More projects