PDA

View Full Version : connecting opamp o/p to ADC of atmega



praghu_cool
01-09-2008, 09:56 AM
hi all .,
am facing a very serious problem please help me .,
am using IR LED and IR photodiode pair to measure distance ., to avoid effect of ambient light am transmitting the IR rays at 150Hz(built around 555) and at receiver end I am using a active high-pass filter of cut-off frequency 106Hz built around the opamp LM324 with some gain and every thing is working properly , am getting volate range 0 to 1.8V , so am using ADC of atmega32 with internal reference voltage of 2.56V and external capacitor of(22micro f) on Vreff pin ., and the ADC value is displayed on LCD dispaly

when the voltage from opamp is 1.65V ADC should be around 90 but am not getting it and not even a constant value , the ADC vaue is changing between 255 and 0 . not even a single constant value ... ,
so When i connected a analog DC voltage from voltage divider it is showing constant and correct value ..,
i couldn't figure out the problem ..,

i have gone through the previous posts and as Docel sir said i have connected a 10k pot from ADC pin to ground and varried it but till then theres no result ..,

please help me out ..,

thanks in advance ...,

praghu_cool
01-09-2008, 12:42 PM
hi all ,
i have understood this might me my problem .,
my transmitter is at 150Hz and at receiver am using a high pass filter of cut-off frequency 106Hz.,
so the o/p voltage from opamp has frequency ranging from 106Hz to 150Hz so my ADC values may be fluctuating , but How i can measure voltage at that frequency suing ADC ..?
please help me ...

ice
01-10-2008, 07:56 AM
That doesn't make sense. Did you hook the output from the output to a scope?

praghu_cool
01-10-2008, 06:52 PM
yes i have observed the O/p on the scope , the o/p voltage is fluctuating at 150Hz frequency ..?

ppppking04
01-10-2008, 11:01 PM
If you are using a high pass filter, and your input is a square wave, your output must be a square wave as well. Since you have observed the waveform on a CRO, you should have observed that.

Now, as you are directly giving this square wave to the ADC input, you won't be getting a constant value. (Your ADC sampling rate will obviously be much higher than 150Hz) Also, you might be getting varying values because your wave might not be perfect.

Check if this is indeed the case. The way to avoid this is using a peak detector. Read up about it. This might help.... http://www.me.iitb.ac.in/~adeshmukh/sensors.php

Also, think about the choice of your input frequency. Don't you think its a bit too low, if you want to filter out dc and 50Hz noise?

praghu_cool
01-11-2008, 01:52 PM
thanks ppppking04 ..,
Ya the o/p is a square wave ..,
ofcourse the 150Hz is bit low but i think its sufficient and i need some help in designing a Peak detector ..,
where can we find very good information on that