alekvodnjan
Junior Member level 2
- Joined
- Jun 19, 2012
- Messages
- 22
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,516
Hello guys!
I need one advice. I'll be very very thankfull if you have it :-D
I'm doing ADC with PIC16F877A of an AC signal that is comming from inductive proximity sensor.
-First of all I have made an voltage divider to get +-12 V DC from 24 V DC adapter (needed for supplying OPAmps).
-With Wien oscillator I have got an AC signal with peak amplitude 5 V and frequency 5kHz (needed for supplying inductive sensor).
-Then with second half of Wheatstone bridge I get ballance between sensor and that bridge. Now I have differential AC voltage that goes from 0-50 mV.
-I have amplified this voltage 50 times with instrumentation amplifier. Now I have voltage changing from 0 to 2.5 V AC.
-With summing amplifier I added 2.5 V DC because microcontroler can't measure negative voltage. Signal of 2.5 V AC now swings around 2.5 V DC. Minimum peak of amplitude is 0 V and maximum 5 V. This is perfect because PIC's ADC is doing conversion between 0 and 5 V. I'm only interested in max amplitude so I made program in mikroC that's doing that. Max amplitude is changing between 2.5 and 5 V and I'm reading this change. Works very well in Proteus simulation.
Conclusion: I have an 0-2.5 V AC signal with 2.5 DC offset that now must go to PIC's ADC.
I have made a real circuit and measured values with oscilloscope and everything works fine. At the end of summing OP amp I get voltage that I want (I have measured this before connecting to PIC).
Here is schematic:
**broken link removed**
But the problem begins when I connect output signal to PIC's ADC. When I measure input to PIC with multimeter I get only constant DC signal of -3.5 V that is not changing like before did and I don1t have changing AC signal! I move sensor but nothing happens.
Of course, I have measured this between Input and Virtual GND. Every time I start AD conversion with push button I also get, at the output to LCD, constant value that is not changing.
Now I'm thinking. PIC is doing coversion between Vcc that is 5 V and GND. But my input signal is between opamp output and VIRTUAL GND!
I tried to simulate this in Proteus and I was right ('till now I've always simulated everything attached to GND and not to Virtual GND). I can't do ADC if my signal that I'm bringing to PIC is tied to VIRTUAL GND and PIC itself to GND. When I make connection in proteus between VIRTUAL GND and GND everything works fine.
But in real circuit I can't do that! One forum member told me that the main problem is that the virtual ground isn't designed to source or sink DC current. Loading it with the processor supply current would cause severe inbalance and this make sense.
What should I do now? How can I do ADC of an signal that is between output of my summing OP amp and VIRTUAL GND? Maybe I can add another circuit beetwen output and ADC that brings all to GND ? I really don't know so please help!!!
Thanks!
Alek Grabrović
I need one advice. I'll be very very thankfull if you have it :-D
I'm doing ADC with PIC16F877A of an AC signal that is comming from inductive proximity sensor.
-First of all I have made an voltage divider to get +-12 V DC from 24 V DC adapter (needed for supplying OPAmps).
-With Wien oscillator I have got an AC signal with peak amplitude 5 V and frequency 5kHz (needed for supplying inductive sensor).
-Then with second half of Wheatstone bridge I get ballance between sensor and that bridge. Now I have differential AC voltage that goes from 0-50 mV.
-I have amplified this voltage 50 times with instrumentation amplifier. Now I have voltage changing from 0 to 2.5 V AC.
-With summing amplifier I added 2.5 V DC because microcontroler can't measure negative voltage. Signal of 2.5 V AC now swings around 2.5 V DC. Minimum peak of amplitude is 0 V and maximum 5 V. This is perfect because PIC's ADC is doing conversion between 0 and 5 V. I'm only interested in max amplitude so I made program in mikroC that's doing that. Max amplitude is changing between 2.5 and 5 V and I'm reading this change. Works very well in Proteus simulation.
Conclusion: I have an 0-2.5 V AC signal with 2.5 DC offset that now must go to PIC's ADC.
I have made a real circuit and measured values with oscilloscope and everything works fine. At the end of summing OP amp I get voltage that I want (I have measured this before connecting to PIC).
Here is schematic:
**broken link removed**
But the problem begins when I connect output signal to PIC's ADC. When I measure input to PIC with multimeter I get only constant DC signal of -3.5 V that is not changing like before did and I don1t have changing AC signal! I move sensor but nothing happens.
Of course, I have measured this between Input and Virtual GND. Every time I start AD conversion with push button I also get, at the output to LCD, constant value that is not changing.
Now I'm thinking. PIC is doing coversion between Vcc that is 5 V and GND. But my input signal is between opamp output and VIRTUAL GND!
I tried to simulate this in Proteus and I was right ('till now I've always simulated everything attached to GND and not to Virtual GND). I can't do ADC if my signal that I'm bringing to PIC is tied to VIRTUAL GND and PIC itself to GND. When I make connection in proteus between VIRTUAL GND and GND everything works fine.
But in real circuit I can't do that! One forum member told me that the main problem is that the virtual ground isn't designed to source or sink DC current. Loading it with the processor supply current would cause severe inbalance and this make sense.
What should I do now? How can I do ADC of an signal that is between output of my summing OP amp and VIRTUAL GND? Maybe I can add another circuit beetwen output and ADC that brings all to GND ? I really don't know so please help!!!
Thanks!
Alek Grabrović