Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

voltage to PWM or voltage to frequency

Status
Not open for further replies.

gehan_s

Member
hey all,

i am in a situation where i have to measure the AC main voltage using a PIC. i am planning to attenuate and shift the AC voltage to a 0 to 5V, 50Hz signal. to couple this signal to the microcontroller i was planning to use a linear optocoupler. but i cannot do that anymore as they are pricy, hard to find here and concerns about the linearity range.

so i am thinking about converting the 0 to 5V, 50Hz signal to a PWM signal where the pulse width changes according to the sin wave amplitude and then couple it using a normal optocoupler, LPF and then give it to the A-D of the PIC.
OR
use a VCO --> optocoupler --> frequency to voltage converter --> A-D of PIC.

are these methods feasible and how accurate will they be ?????

thanks in advance !!!!!!!!
 
Hi,

You can look into dual opto coupler connections first if you wish, to see how it is done. Here you use two more standard couplers to get a more or less linear range.

A transformer is probably the simplest. I assume you need isolation. A small transformer that puts out say 6v and you can then work with that to condition it for the PIC AD input.

Using an opto coupler LED as an amplitude comparator (which is what you are suggesting) is definitely not a good idea. That's because the LED characteristic changes too much. Using a zener in series with the LED would improve the comparator action accuracy, but i dont think it would be good enough for a decent reliable measurement. You could of course build a circuit just for this using a true comparator, but then again there are things about the sine that could change that will upset the reading completely...in other words you can not assume a perfect sine all the time and the shape may vary too much.

So the best bet is to use a transformer, and since this is low current you could use a very cheap wall wart. A little signal conditioning and some filtering and you can measure that with the PIC AD input no problem.

Frequency to voltage conversion isnt that accurate either and varies as the capacitor changes over temperature.

How much accuracy are you looking for here?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top