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 conditioning for ADC input

Status
Not open for further replies.
Hi,

Often people dont want to have to add extra transformers to their projects. This is when we look for other solutions.

For example, if the original PIC board is already line isolated (e.g. wall wart) then another solution is to use a second low end PIC with offline non isolated power supply (cheap as you can get) and use that to sample the current or voltage, then send the data digitally through an opto coupler to the original PIC chip which reads the data every so often. This also means the original chip bandwidth is preserved for doing the more regular tasks while the second chip does all the fast sampling.
A typical low end PIC is the 12F675 which has 10 bit AD converter.
 
Well I think the original spec is for true power.. Although I will suggest measuring apparent power since I got the capture module to measure the frequency.. It could mean extra points!! :cool:
Thanks Ian.. I may take you up on that adapter you're offering. I think im meeting my advisor tomorrow so I will let you guys know how things pan out!
 
Hi,

It doesnt matter how you sample (transformers, second PIC chip, etc.), as long as you sample both current and voltage and then do the math. Of course you should also test it with several known loads when your done building up the circuits.
 
Yeah don't worry I will be calibrating the thing when I get a hardware version running.
I'm having a problem with xc8 and receiving multiple values with the usart. Does anyone know a reliable way to parse a comma seperated string into a set of integers? Ive tried using strtok() but im quite sure its bugged :/
 
Hey guys.. I dont know if i should revive an old thread or not. I'm having a problem with the adc and battery voltage.
One of the design goals is not to use a regulator. As you can see from the picture, the voltage coming into the pic is independent of the voltage supplying the chip (0 - 4v).
If the chip is supplied with 5v, its fine but as soon as the battery starts to drain, the adc input will be greater than VDD and could cause damage.

capture-png.88986


Is there any way I can voltage shift the adc input (preferably linearly) by using an op amp or some other arrangement and using the VDD as a reference?
 

Attachments

  • Capture.PNG
    Capture.PNG
    11.4 KB · Views: 337
You can scale your input to 0-4V instead of 0-5V by altering your burden resistor.

However, PIC measures the voltage relative to its reference. If you use VDD as an ADC reference and it varies between 4 and 5.5V, your measurements will be off. You need some sort of stable reference for ADC.
 
Nigel.. Ive tried suggesting a pic more functionality like with two Vref pins but they're at least 14 pin devices and anything above 8 pins a no go.
Can this built in voltage reference be higher than the pics Vdd voltage though?
 
Turns out I cant have the reference higher than VDD.. Although setting the reference to 4.096V should provide me with enough linearity with a 5.5V to a 4.1V range.
Maybe 2.1V if noise isnt an issue :/
Thanks guys!
 
I would suggest 2.048 over 4.096. The built-in voltage reference is only about 10% accurate, so you won't get any precision by moving to larger scale.
 
Can this built in voltage reference be higher than the pics Vdd voltage though?

No - but there's absolutely no point in it being so.

If your incoming voltage is too high, simply use an attenuator to reduce it.

As NorthGuy suggests, use a 2.048V reference, and simply attenuate the ADC input to suit.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top