Continue to Site

How to measure 0-30V with ADC that has 5V maximum input ?

Status
Not open for further replies.

Newbie level 4
I use PIC16F877 which has on chip 10 bit ADC.I have the problem when I use ADC measuring voltage 0-30V.
I have tried to use voltage divider but not work.

My circuit
https://tinypic.com/ixcgaq.jpg

Re: How to measure 0-30V with ADC that has 5V maximum input

may you can use potential devider (voltage devider), it is 2 resistance in series, and the voltage drop across the 2 resistors will reduced with the ratio between the 2 values. if u want more details, just tell me

hope that help u
bye
Ahmed

i am sorry, i didn't see ur circuit,
i suggest to add a buffer (opamp with unity gain befor ur ADC
this may solve the problem
bye

ahmed

Re: How to measure 0-30V with ADC that has 5V maximum input

Voltage divider will work fine if you insert a voltage follower/buffer ( http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/opampvar2.html ) between voltage divider and the ADC input ..
If you would like to supply it of 5V, you will need to use a rail-to-rail opamp ( **broken link removed** ) ..
Regards,
IanP

Re: How to measure 0-30V with ADC that has 5V maximum input

I have added voltage follower to the my circuit but still not work
The objective of my circuit is digital volt meter that can measure 0-30Vdc
and show on LCD.

If I connect voltage 0-5Vdc direct to ADC input it work fine.

My new circuit
https://tinypic.com/ixdncx.jpg

I think voltage follower not nessesary for your circuit.
because of input impedance of ADC (uC) is high.
I think it is because of you dont define that pin as input!
in the other word you must define ADC pin as input.

Re: How to measure 0-30V with ADC that has 5V maximum input

I have added voltage follower to the my circuit but still not work

Are you sure that you don't have AN0 as output ? What is on output if you set "1" in your program ? Still 80mV ?

Vasek

Re: How to measure 0-30V with ADC that has 5V maximum input

Hi Giftbox, can you test the LM358 separate to see if is working properly?
It is probably blown by ESD or short circuit or the power polarity connected
reverse. Your circuit is correct. Another thing to keep in mind is that LM324 and LM358
will never output 5Volts with a 5Volt supply due to their output design that subtracts aprox. 1Volt from the max. VCC voltage.
It should be okay up to 4 volts. In this case you have to change the 2K res to around 1k54 I let you do the calculation.
So when your input voltage is 30Volts the divider should output 4Volts. then you have to scale your ADC accordingly.
The simplest is to use a rail to rail single supply opamp, check with National Semiconductors.

Re: How to measure 0-30V with ADC that has 5V maximum input

hi
ur circuit seems good. but i think u may try to add pullup resistance to ur port pin.
i did have a problem like this but with a comparator. and when i added a pullhigh resistance to the op amp output it works will and the problem dissapears. whos know??

don't forget to define ur pin as input

hope this help u and solve ur problem

best regards
AHMED
salam

Re: How to measure 0-30V with ADC that has 5V maximum input

Hi every one …

Using the op amp to reference an ADC is only needed in 2 cases:

1- When the input signal is low level relative to ADC sensing range

Example the signal under test is from 0 to 200 mv while your selected ADC has a range from 0 to 10 v then; an OP AMP is needed as a DC amplifier.

2- if your input is varying over a narrow gap

For example : your input signal are varying form a min of 2v to a max of 2.2 v then , you will need an op amp to scale the op form 0 when it’s at 2v up to full ADC scale at 2.2v

In your case a potential divider should do the job correctly... If not, check resistor values and/or your code.

thank you ...

Re: How to measure 0-30V with ADC that has 5V maximum input

I use PIC16F877 which has on chip 10 bit ADC.I have the problem when I use ADC measuring voltage 0-30V.
I have tried to use voltage divider but not work.

My circuit
h**p://tinypic.com/ixcgaq.jpg

Hi,
Try to disconnect the PIC input and then measure the voltage over the 2k resistor. I am also a bit uncertain about your connection, is the ground symbol the same as 0V(Vss)? Have you connected the 30V negative to 0V? A single floating +30V doesn't give you any voltage over the resistors!

TOK

Re: How to measure 0-30V with ADC that has 5V maximum input

The maximum output voltage from LM324 and LM358 is only Vcc - 1.5 V. Considering no gain is required on the op-amp, the maximum input voltage is only 3.5 V if Vcc is 5V. Higher input will be clipped off.

Status
Not open for further replies.