Panel Cookies
Ardutester AC RMS
11/11/2023 | Views: 4510 | Arduino | by: ELECTRONOOBS      


Can Arduino measure RMS AC voltage of 220V directly from the outlet? Well, not directly, but yes, it could. And no, it won’t be using a bulky transformer, a big full bridge rectifier, a big module like this one with an integrated transformer on it or something similar. We will measure AC RMS values using a small module I’ve just found on the internet. The module might be big, but the chip is using, is very small, and that’s all we need. I’m making this video because I want to add RMS reading of high voltage to my Multimeter, but also keep it safe and very small, because if you remember, the PCB for that project was very small. This should be an interesting tutorial so let’s get started






Part 1 - Schematic


What’s up my friends, welcome back. Arduino could measure analog values on its analog pins from A0 to A5. But the values could go up to only 5V, otherwise the Arduino would get burned. Also, we want RMS, not just a simple Analog read. I want to measure 220V AC directly from the home outlet. That’s why I’ve ordered this other module. I know that the module size is close to the other module. But if I were to use only the components, they are very small. A few resistors and capacitors, a potentiometer and an OPAMP. THe MCP60 02 is a low power amplifier good enough for this purpose.

Arduino mcp6002 AC RMS measure





Part 2 - Code


This module comes with this Arduino library, so download it from below and install it to your Arduino IDE. The code is so simple. Just use this function and indicate on which pin you connect the module, let’s say pin A0. It has to be an analog pin. The other values are for calibration. So connect the module to the Arduino like this. I also add the LCD display so we can see the value. Connect high voltage to the module and Be careful working with the high voltage AC.


#include "MCMVoltSense.h"             // Include MCM Volt Sense Library
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);  //sometimes the LCD adress is not 0x3f. Change to 0x27 if it dosn't work.

MCMmeter meter;                       // Create an instance

void setup() {

  Serial.begin(115200);
  lcd.init();                         //Init the LCD  
  lcd.backlight();                    //Activate backlight       
  meter.VoltageStp(A0, 523.21, 1.7);  // Voltage: input pin, calibration, phase_shift

}

void loop() {

  meter.analogVoltage(40,2000);  // Measure the AC voltage. Arguments = (# of AC cycles, timeout)

  float Vrms = meter.Vrms;       // Save the RMS Voltage into a variable.

  Serial.print("Voltage: ");
  Serial.print(Vrms,2);
  Serial.println(" V");

  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("   RMS  Value   "); 
  lcd.setCursor(0,1);
  lcd.print(Vrms,2);     
  lcd.print(" V"); 

  delay(2000);

}

Part 3 - Calibration


To get the calibration, we need this formula. The real measure value which is 230V, multiplied by the initial calibration in the code which was set to 523. Then, all divided by the value on the LCD, which in my case was 748V. In nmy case the result was 160.98. We get the new calibration value and we add that to the code. So add that value here meter.VoltageStp(A0, 160.98, 1.7);. Now run the code again and there you go. That easy we can measure RMS value of high voltage AC.



Part 4 - Full Tutorial Video

So guys, those are some methods to measure AC voltage with an Arduino. Adding an external ADC of 16 bits would increase the resolution even more. So my next multimeter will also be able to read high voltage AC but I have to be careful.

If my videos help you, consider supporting my work on my PATREON or a donation on my PayPal. Thanks again and see you later guys.





11/11/2023 | Views: 4510 | Arduino | by: ELECTRONOOBS      












Last tutorials

All about Arduino PWM frequencies
RLC Transistor Tester PCB with Arduino
Ferrofluid 3D printed Bluetooth Speaker
10A Bharger/Protection Module
TMC silent driver comparison A4988 stepper driver

ADVERTISERS



Affiliate Disclosure

ADVERTISERS



PCBWAY PCB service





Curso Arduino Online nivel Intermedio