From where got this formula !

I see this code on this website

https://www.homemade-circuits.com/transformerless-ac-voltmeter-using/#comment-52046

int x;// initialise variable x
float y;//initialise variable y
void setup()
{
pinMode(A0,INPUT); // set pin a0 as input pin
Serial.begin(9600);// begin serial communication between arduino and pc
}
void loop()
{
x=analogRead(A0);// read analog values from pin A0 across capacitor
y=(x*.380156);// converts analog value(x) into input ac supply value using this formula ( explained in woeking section)
Serial.print(" analaog input " ) ; // specify name to the corresponding value to be printed
Serial.print(x) ; // print input analog value on serial monitor
Serial.print(" ac voltage ") ; // specify name to the corresponding value to be printed
Serial.print(y) ; // prints the ac value on Serial monitor
Serial.println();
}

then I do not know from where get calculation of this formula value y=(x*.380156);

It's explained on the web page below the code.

1 Like

According to the website it was determined by "Hit and Trial Method"
Meaning, find a number that looks good and use it.

by the way, I tested code on proteus set amplitude as 311 = 220V then value on serial output is 217.45
I used exactly same schematic of proteus to arduino uno
I connect arduino uno then value on serial output is 345V

You can not safely connect 220V mains to a solderless breadboard.

The author of the article is irresponsible.

You shouldn't be connecting the Arduino GND to the mains neutral.

2 Likes

programmed uno wirelessly

And the winner of the 2023 Darwin Award is....

6 Likes

is there anyone get accurate reading of AC grid voltage without using transformer?

Does it have to be Safe and Simple?

Yes, I am looking for it

Hi,
The potential "Circuit of Death".
image

@Eleckits , what are you aiming on measuring? Mains voltage?
Between what wires?

Are you aware that that circuit can be at full mains potential if wired wrong or there is a component failure.

The authors qualifications;

About Swagatam
I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

All there is is this;
image

It should have just about every paragraph a warning .

As previously stated, irresponsible use of a protoboard and care about life.

If I was you, ditch the project and use a proper transformer isolation circuit like the sane engineers do.

Tom.. :smiley: :+1: :coffee: :australia:

2 Likes

Hi, Tom
tested on proteus then readings correct
I tested circuit diagram & code using UNO board but readings not correct

Bummer, especially if you risk your life making the measurement.

what did you measure and what to you expect to measure?

With limited VA (say: 200 or max 500).

As pointed out DO NOT CONSTRUCT this circuit,
breadboards aren't designed for this voltage and neither is a lot of the components.

The forum doesn't allow such circuits, electrician or not.

P.S. This topic has been flagged for closing.

Thank you.

who tell you that using bread broad?

I don't care whether you using a breadboard or not.

I care very much that you stay alive.

As you must understand the forum can't have such content, lest we get blamed for someone getting injured or killed.

The link you gave in post #1 .
Even if you build it on better material, IT IS STILL LETHAL.

Can you please tell us your electronics, programming, arduino, hardware experience?

DO NOT BUILD THIS PROJECT

Thanks.. Tom... :smiley: :+1: :coffee: :coffee: :coffee: :australia:

1 Like

by the way, I connected uno via bluetooth to get reading then no any contact with pc or hand so it is 1000% safe to deal with main line