CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

measure 105vac to 130vac line voltage

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

View user's profile Send private message Send e-mail Yahoo Messenger

measure 105vac to 130vac line voltage
PostPosted: Fri Jul 22, 2005 7:40 am     Reply with quote

I rectify the line voltage, nominally at 120vac to give me a motor bus voltage of approximately 170vdc. Since the line voltage can fluctuate on hot summer days and low power usage days between 105vac to 130vac, then my rectified motor bus voltage can then fluctuate from 148vdc to 184vdc

I also have a transformer which is nominally 12vac which i rectify and put thru a typical LM340 to give me 5v for the PIC.

I need a way to measure the line voltage without having to tap directly into the high voltage line. Is it okay to put a resistor voltage divider from the unregulated DC voltage feeding into the LM340? Perhaps i need a 5v zener to clamp that voltage?

I'm going on the assumption that a fluctuating line voltage would also cause my nominal 12vac to fluctuate, and i can directly measure the A/D voltage from the resistor divider i hook up to the unregulated DC to the LM340.

Is there a better way?
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Fri Jul 22, 2005 7:50 am     Reply with quote

I think ratiometric is the word. The rectified line voltage and the rectified transformer secondary will be ratiometric. If you have a capacitor between the rectifier and the regulator you can create a voltage divider across the capasitor to measure voltage. That would represent line voltage.
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Fri Jul 22, 2005 8:15 am     Reply with quote

Yeah, i normally have a capacitor. In fact, i use a single 220uF electrolytic capacitor from my regulator input to Gnd, just like the PICDEM2-Plus.

I guess i'll have to use resistors sized at least 30K and 10K. This will give me current draw of 450uA at an unregulated 18VDC, and 4.5V across the bottom 10K resistor.

I've always taken the PIC's ADC characteristics for granted. Perhaps i'll have to preserve the 3:1 resistor ratio, but use something like 3k and 1k if it can't read reliably with those previous high resistances.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Fri Jul 22, 2005 8:26 am     Reply with quote

I would use a seperate rectifier off of the 12AC winding to help isolate line voltage changes from DC load changes. Use a diode, a fairly small cap like 10uF, and a resistor divider in the vicinity of 10k to drive the A/D
_________________
The search for better is endless. Instead simply find very good and get the job done.
Guest








PostPosted: Fri Jul 22, 2005 10:33 am     Reply with quote

You would be much better off using an OpAmp input to the PIC. Here is what I would do... Use the 12V after the transformer (since this should be ratiometric, w\ only slight deviations, to the high voltage line). Use an OPAMP with rail to rail inputs. This will allow you to get the correct impedance for the ADC as well as scaling from the opamp. You can make the gain of the op-amp 1/3 or so to further scale the voltage down. Also, make sure to diode clamp the input to the opamp. (If you don't use an opamp, be careful to diode clamp the PIC as it will not be happy with a -12V input).
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Fri Jul 22, 2005 11:46 am     Reply with quote

Anonymous wrote:
You would be much better off using an OpAmp input to the PIC.

I don't see what you would gain by adding an Op Amp. If this were a battery powered application you could save a little bit of power but it doesn't sound like that matters much here. You can get as low an impedance as you could want by choosing the divider resistors. You could use a diode clamp to prevent spikes from damaging the A/D, but any spike on the secondary of the transformer would still trash the voltage regulator. I would rather put a MOV on the transformer to protect all the 12V loads.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group