Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

[PIC] Circuit Diagram to input an AC voltage of 220V @ 60Hz to PORTA.0 of PIC18F4520

Status
Not open for further replies.

KhaledOsmani

Full Member level 6
Joined
May 4, 2014
Messages
384
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
3,933
Hello

What is the appropriate filter, that must be connected after a single phase full bridge rectifier, on a 220V AC, (before making a voltage divider such that max input voltage would be of 5V), such that in which we can input the voltage level to the PIC, without risking of damaging it.

i.e. what is the capacitance needed, etc...

This is like an idea of AC voltage meter, using PIC18F4520.

Once the diagram is set, and stable and safe to use, we can make an ADC in programming to determine the voltage level, and send its value to a 16*2 LCD.

Thanks
 

Are you trying to measure the AC or RMS voltage from the AC source.
If you want to AC voltage (i.e. you want to be able to follow thew voltage up and down for each cycle which would let you measure, for example, the peak voltage and frequency etc.) then you probably would not want a filter at all.
If you want the RMS voltage then you have a lot of freedom to design the circuit as you want depending on whether the AC voltage is changing (i.e. you are wanting to detect AC fluctuations and what causes those fluctuations), what degree of ripple you can tolerate (which also ties back to the accuracy of the measurement you are trying to make) and so on.
I guess this really comes back to "what are you really trying to measure"?
Susan
 

Simply what a multimeter measures and display on screen:

Steady-state O.C no load voltage

Tell me your opinion in these steps to accomplish this task:

1) branch a step-down 230/12V transformer at the desired terminals to be measured
2) we now have a 12V AC that we connect to a single phase bridge rectifier
3) we now have 12V DC but it is not pure enough to be entered to the PIC
4) connect a shunt capacitor of 100 uF at the 12V DC
5) make a voltage divider so that max output voltage won't bemore than 5V, according to this we choose values of R1 and R2
6) the output of voltage divider is connected in series with a current limiting resistor of 1k
7) AC is now fully rectified, neat and can be connected to PORTA.0

Now according to 0V corresponds to 0V and 5V corresponds to 220V AC I make calculations and ADC process to display measured value on a 16*2 LCD.


I just want to make sure that no damage would hit the PIC when inputting an AC value after rectfying/filtering to it.




Your first question in the reply is vague for me, did you mean AC peak voltage or else RMS?
 

Hi,

If you need isolation between mains and PIC a transformer is a good choice.

Be aware, that a transformer is not an ideal voltage converter, especially the small wattage ones.
Maybe a (small resistive) load at transformer secondary can improve performance. Depends on transformer.

Bridge rectifier is ok. Connect it's negative output to PIC ground.
The rectifier needs about 1.2 of voltage drop to operate. Consider this for desired accuracy.

A single capacitor will measure peak voltage. Mains voltage usually is a bit flat at the top, so it is not pure sine and thus the factor 1.414 will not be exact. Additionally the peak voltage includes all noise, therefore overtones may reduce accuracy.

If you connect a relatively low ohmic resistor at the rectifier output and create a relatively high impedance filter (consider second order low pass) creates an (more) average signal instead of peak signal. Average will be more reliable than peak voltage.
Calibration is needed in either case.

Voltage divider and filter may be combined to reduce part count.

5V corresponds to 220V AC
I don't recommend to use VCC as voltage reference, because VCC is not that precise, not clean and it may drift with load, temperature and time...
You measurement precision depends fully on VCC precision.

If your measurement saturates at 220V input you can not be sure if it is really 230V or even higher.
I recommend to include some headroom. Expand your AC input range at least 20% more than nominal value.

Klaus
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top