# Thread: connecting opamp o/p to ADC of atmega

1. ## connecting opamp o/p to ADC of atmega

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 ..,

thanks in advance ...,

2. 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 ..?

3. That doesn't make sense. Did you hook the output from the output to a scope?

4. yes i have observed the O/p on the scope , the o/p voltage is fluctuating at 150Hz frequency ..?

5. 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?

6. 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

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•