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.

[SOLVED] [MOVED]ADC 0808 Vref(-) problem

Status
Not open for further replies.

Sajjadkhan

Full Member level 5
Joined
Sep 25, 2010
Messages
307
Helped
17
Reputation
34
Reaction score
16
Trophy points
1,298
Location
Rawalpindi,Pakistan
Activity points
4,199
I want to measure voltage up to 51V (with 0.1V accuracy). Up to 25.5V can be easily measured as 0.1V/bit.

Using a voltage divider which gives 5v on 51V. here is what i want to do.

Vref (-) = 0v, vref(+)=2.5V ---> the adc can measure up to 25.5v.

When analog voltage reaches to 25.5V (i.e. adc value = 255 dec)my 8052 will switches Vref(-)=2.5 and Vref(+)=5.Now if adc output is 0 then it means the previous 25.5 was the answer but if the output of the adc is suppose 15 decimal then voltage is 25.5 + 1.5 =27V.

Problem is with Vref(-). I used a PNP transistor, emitter connected to 5v supply and collector is connect to POT upper leg, mid leg is fed to voltage follower and 3rd leg is grounded. The base of the PNP is connected to a resistor which is then connected to Mikro Controller. The POT is tuned so that when there is 0V on PNP base then there will be 2.5V at the POT mid leg and so as voltage follower op-amp. and when 5 v on the base then 0V on op-amp.

The circuit alone works fine but when connected to Vref(-) then there is always 0.66-0.7V on Vref(-). What causes the problem?


Here is the schematic, just made. The 12 V supply is unregulated but 5v is regulated using lm317 and capacitor filter was also used at theoutput. when controller pin is set to 1 i.e 5v the op-amp gives 0v and when controller pin is set to 0v then 2.5 V. Circuit is good when not connected to Vref(-). I don't think 0.7V exist in this area except emitter-base region.

The possibility i m thinking is since its a ladder network i.e. 256 resistors and op-amp has its own low out-put impedance so its like a small resistor is added at the bottom dude to which potential drop is occurring. what u think?

And if its so then there is no solution to my problem then. i can use a npn transistor i.e. its collector connected to Vref(-) but no transistor is perfectly saturated so this idea also fails. Can't use relay since i have to check value after every 1 sec and that would be noisy.

All values in the fig are exact.




---------- Post added at 06:16 ---------- Previous post was at 05:11 ----------

I just got an idea, a possibility. that to give 2.5V at Vref - i use the existing circuit and for grounding i use a mosfet which has lowest drain to source impedance. The error would be too less. Any thoughts?
 

Guys sorry that i have lost my schematic some where in my PC but still got the PCB layout and its easy to understand. The small chip near the ADC 0808 is LM358.

Things i have noticed:
When the Vref(-) pin is left open i.e when i pulled out LM358 from the jacket, there is 0V on it. I connected 33 Ohm resistor to it and ground it and still 0V on that pin. Then i attached LM358 Back again and 0.6V still there. Further i cut PCB track between Pin 7 of LM358 and Pin 16 of ADC (The Red colored track). I checked the voltage on Pin7 then, there was 0V on Pin7....LM358 is working fine. ....What can it be?

The file will open in Proteus 7 or later version.
 

Attachments

  • BOARD1.rar
    13.1 KB · Views: 72
  • BOARD1.jpg
    BOARD1.jpg
    840.7 KB · Views: 98
Last edited:

I have solved the problem. The POT tunes the voltage to 2.5 and when 0v is required the Mosfet is turned on making it ground. The mosfet Rds ON is from 1.2 Ohm to 12 Ohm typically so at 12 ohms the error will be less than 2mV,which is acceptable in my case.



Problem Solved. Thanks for not helping me.
 

how do u convert the adc value to analogue value.
 

I mean how to convert ADC readings to match the format to be displayed in LCD.For instance if i want to read voltage between 0 and 360v or 0 and 60v
 

1st you should know how much bits you got in ur ADC. for instance say we have a 10 bit ADC. then 2^10 = 1024 values we have to work with.

if you are supplying your ADC 5V than 5/1024 = 4.88 mV per bit. Its difficult to handle this number in ucontroller. i recommend to set your supply = 5.12 V so that 5.12/1024 =5mV exactly per bit.

Having said so you have to consider a number greater than 360 which comes in 2's power e.g. 2^8 =256 is smaller so 2^9= 512 is ok.now you have to select you voltage division network so that at 512V you have 5.12 V at your ADC pin. So choosing R1 = 99 K and R2 = 1K will give you 5.12V at ADC PIN.Now suppose you apply 360V to this network then you have [1 / 99+1] * 360V = 3.6 V. Since we have 5mV/bit then for 3.6V we have 3.6 / 5mV = 720 bits. Since 1024 is 2times of 512 so you divide 720/2 =360. this value you have in you ADC no simply print it.

Try this for 60V. take 2^6 =64 here.
 

Thanks Sajjadkhan
you avoided decimal points in your calculations,but if pic carries out calculation and there is decimal, will show error mwssage?
 

Thanks Sajjadkhan
you avoided decimal points in your calculations,but if pic carries out calculation and there is decimal, will show error mwssage?

if your V reference is other than 5.12 then your step size will be in decimal. The pic will not give any error but you will have error in your values. e.g u expect 300V to be displayed but you may get 310V.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top