Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Arduino AC input sensing by PC817 Opto-Coupler

imranahmed

Advanced Member level 2
Joined
Dec 4, 2011
Messages
691
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
5,669
Please let me know that I want to measure AC mains 220VAC by using PC817. I googled but only I found zero-crossing detector circuit but I want to measure AC Voltage.
I built circuit for measuring AC but I am slightly confuse that is it right approach I used in attached circuit. Please comment your suggestions for more improvement.
 

Attachments


codemaster11

Member level 5
Joined
Sep 2, 2019
Messages
84
Helped
8
Reputation
16
Reaction score
6
Trophy points
8
Activity points
765
what's the value of the voltage at R8 = 20k if input = 308vdc, 2nd the 27k resistor at the pc817
is much greater to turn it on, reduce it to 1k, adjust the divider so that 5vdc appear at R8 it will turn pc817
turn on but still there will be slight variation with 5vdc put a 47uf/50vdc electrolyte capacitor.
 

    imranahmed

    points: 2
    Helpful Answer Positive Rating

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,358
Helped
4,724
Reputation
9,463
Reaction score
4,492
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
122,524
You can do it that way but it requires calibration and the results will likely be different from one PC817 to another.
What you are doing is creating a DC current from the AC supply then converting it into a voltage with the optocoupler. The result will depend on the individual device and temperature, not really useful and not repeatable.

A better strategy is to convert the AC voltage to a digital format then pass the result through the optocoupler.

Brian.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,034
Helped
4,045
Reputation
8,090
Reaction score
3,959
Trophy points
113
Activity points
119,058
Hi,

I´d make it more simple while more precise/linear.

I´d omit C1 and R8.
Then make R7+R4 = 330k
make C2 = 100F

Then I´d expect about 3V output @ 220V sine RMS input. (= average rectified)
(CTR = 50%)

Fur sure it depends on type, batch, temperature, age....


Klaus
--- Updated ---

Btw:

RV1 = 1k is not useful for real life.

Klaus
 

danadakk

Advanced Member level 1
Joined
Mar 26, 2018
Messages
404
Helped
79
Reputation
157
Reaction score
89
Trophy points
28
Activity points
2,046
A simple low cost approach would be to use an ATTINY85 on sense side, measure V with its
A/D and a divider, convert that to pulse width or freq, and send that thru a standard coupler
to receive side. Receive side use a processor to measure freq or pulse width. Again depends
on accuracy you are seeking. There are processors that have +/- .1% Vref on them which is
>> accuracy that the Atmel parts. At greater cost of course.

The bridge could be eliminated, just a single diode , a zener and R for ATTINY85 Vdd.. a cap for
ATTIONY85 Vdd......

Regards, Dana.
 
Last edited:

imranahmed

Advanced Member level 2
Joined
Dec 4, 2011
Messages
691
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
5,669
Hi,

I´d make it more simple while more precise/linear.

I´d omit C1 and R8.
Then make R7+R4 = 330k
make C2 = 100F

Then I´d expect about 3V output @ 220V sine RMS input. (= average rectified)
(CTR = 50%)

Fur sure it depends on type, batch, temperature, age....


Klaus
--- Updated ---

Btw:

RV1 = 1k is not useful for real life.

Klaus
Please will make as per your suggestions because of easy solution please confirm me for your design will it work?
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,034
Helped
4,045
Reputation
8,090
Reaction score
3,959
Trophy points
113
Activity points
119,058
Hi,

It's just an example. Do the simulation on your own.
It's your design, your job...

Klaus
 

imranahmed

Advanced Member level 2
Joined
Dec 4, 2011
Messages
691
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
5,669
Please let me know why 100k resistors got heat up but touchable current through both resistor is 1.5mA and voltage across each resistor is 140 V in real circuit not simulation.
V = sqrt(PR) = sqrt(1 x 100000) = 316.22V maximum safe operating voltage for 100k1 watt resistor.
I = sqrt(P/R) = sqrt(1 / 100000) = 3.162mA maximum safe operating current for 100k 1 watt resistor.
 

Attachments


danadakk

Advanced Member level 1
Joined
Mar 26, 2018
Messages
404
Helped
79
Reputation
157
Reaction score
89
Trophy points
28
Activity points
2,046
P = I^2xR = .225W
P = R^2 / R = 19600 / 100000 = .196W

In both cases I assumed your I and V were RMS values.....

So they are << 1W, should not be hot.


Regards, Dana.
 

Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top