+ Post New Thread
Results 1 to 16 of 16
  1. #1
    Full Member level 2
    Points: 1,384, Level: 8

    Join Date
    Sep 2014
    Posts
    134
    Helped
    0 / 0
    Points
    1,384
    Level
    8

    OP amp output oscillating

    Dear All,

    Here's my circuit
    Click image for larger version. 

Name:	voltage_amp_comp.JPG 
Views:	25 
Size:	24.7 KB 
ID:	150735

    When input voltage gets to 47mV LM358P OP AMP U1:A strengthens that voltage by 48 times and OP AMP U1:B compares it against reference voltage 2.18V and turns on output to PIC digital input. I get around 3.75V to the pic input pin. According to PIC12F683 datasheet min 2.0V needed to recognize it as HIGH state. So that is ok and it actually works just fine on breadboard.

    However I decided to change the OP AMP to LM2902N and end up in troubles. Around 47mV +-~3mV if connected to pic input it starts to oscillate. If it is not connected anywhere it will not oscillate. Around 43mV it is low and around 50mV it is high stable. I have tried positive feedback resistor in U1:B but that didn't help. Please help me to understand why this type of OP AMP is not working and how could this be fixed?

    Thank you in advance

  2. #2
    Advanced Member level 2
    Points: 3,432, Level: 13

    Join Date
    Nov 2013
    Posts
    515
    Helped
    111 / 111
    Points
    3,432
    Level
    13

    Re: OP amp output oscillating

    Maybe you have higher noise? Are you sure it is oscillation, not supply/ground coupled signal or something else?
    Could you tell something about the waveform you experienced (freq,amplitude,shape)?
    "Try SCE to AUX." /John Aaron/



  3. #3
    Full Member level 2
    Points: 1,384, Level: 8

    Join Date
    Sep 2014
    Posts
    134
    Helped
    0 / 0
    Points
    1,384
    Level
    8

    Re: OP amp output oscillating

    It is noisy as well and oscillating.
    Here is the oscillating:
    Click image for larger version. 

Name:	OPAMP_Oscillating_signal.png 
Views:	6 
Size:	50.7 KB 
ID:	150738

    Here is the noise:
    Click image for larger version. 

Name:	Noise.png 
Views:	6 
Size:	27.1 KB 
ID:	150739



    •   AltAdvertisment

        
       

  4. #4
    Super Moderator
    Points: 250,799, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    43,661
    Helped
    13280 / 13280
    Points
    250,799
    Level
    100

    Re: OP amp output oscillating

    The 4 MHz "noise" can't be generated by a slow OP, it must be sourced from the µC or other circuit parts. Seeing so large interference signals raises doubts about proper circuit layout, particularly appropriate ground connections.

    A you sure that the input voltage, Vref and supply voltage are sufficiently stable? How's the reference and input voltage generated?


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  5. #5
    Advanced Member level 2
    Points: 3,432, Level: 13

    Join Date
    Nov 2013
    Posts
    515
    Helped
    111 / 111
    Points
    3,432
    Level
    13

    Re: OP amp output oscillating

    Yes, I also think it is not self-oscillation, if the ground connections are good probably with some filtering on the reference/supply you can eliminate this.
    By the datasheet of the LM2902N it has 15dB less supply noise rejection in worst case compared to LM358, maybe this caused a difference.
    "Try SCE to AUX." /John Aaron/


    1 members found this post helpful.

  6. #6
    Full Member level 2
    Points: 1,384, Level: 8

    Join Date
    Sep 2014
    Posts
    134
    Helped
    0 / 0
    Points
    1,384
    Level
    8

    Re: OP amp output oscillating

    4MHz is the crystal frequency as well. It could be that crappy breadboard or jumper wires. I've already found few not conducting jumper wires..

    Voltages are created by Lab power which can go to millivolt range.
    Last edited by Veketti; 12th January 2019 at 18:34.



    •   AltAdvertisment

        
       

  7. #7
    Advanced Member level 5
    Points: 38,027, Level: 47

    Join Date
    Mar 2008
    Location
    USA
    Posts
    6,143
    Helped
    1784 / 1784
    Points
    38,027
    Level
    47

    Re: OP amp output oscillating

    If it's truly oscillating then it ought to do the same
    powered from batteries and the input grounded at
    the jack (?), no externalities.

    Any differences you see, ought to point to something.


    1 members found this post helpful.

  8. #8
    Full Member level 2
    Points: 1,384, Level: 8

    Join Date
    Sep 2014
    Posts
    134
    Helped
    0 / 0
    Points
    1,384
    Level
    8

    Re: OP amp output oscillating

    I isolated the microcontroller and put only BC547 transistor which controls 30mA led. Still oscillating. It is the signal from the amplifying U1:A which is noisy. As I had extra OP amp available I used one as a Sallen-Key low pass filter between amplifier and comparator (pin 1-5) and tried to filter the oscillation out. Went as low as 1hZ, 10uF and 15kohm values on that Sallen-Key but still there is few hertz on-off in the hysteresis area. Now it is only 3mv that oscillation area as well. Are those resistor values 1k and 47k in right range for it to work properly? But I have tried 10 higher and lower as well. 100ohm and 4.7k were better though..



  9. #9
    Advanced Member level 2
    Points: 3,432, Level: 13

    Join Date
    Nov 2013
    Posts
    515
    Helped
    111 / 111
    Points
    3,432
    Level
    13

    Re: OP amp output oscillating

    Did you try to add a capacitor paralel with R3 to filter the input signal?
    Oscillation frequency shouldn't change with adding a filter I think, interesting...
    I would also try to add a filter capacitor with R4 instead of adding a Sallen-Key stage.
    "Try SCE to AUX." /John Aaron/



  10. #10
    Super Moderator
    Points: 68,704, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,021
    Helped
    3209 / 3209
    Points
    68,704
    Level
    63

    Re: OP amp output oscillating

    Hi,

    * Do you have a solid GND plane for reliable GND?
    * are there ceramics capacitors at each IC´s supply pin with low impedance connection to GND to stabilize VCC?
    * is it a breadboard circuit?
    * can we see a photo of your circuit or - even better - the PCB layout?

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  11. #11
    Full Member level 2
    Points: 1,384, Level: 8

    Join Date
    Sep 2014
    Posts
    134
    Helped
    0 / 0
    Points
    1,384
    Level
    8

    Re: OP amp output oscillating

    Tried cap parallel to R3, no help. I added also cap to the ic supply pin, after taking this picture. Sorry, picture is huge for better visibility.
    Click image for larger version. 

Name:	op-amp.jpg 
Views:	11 
Size:	601.5 KB 
ID:	150776

    0.049V starts oscillating. 0.054V stable. I checked this small input voltage from lab power by oscilloscope and it is stable.



  12. #12
    Super Moderator
    Points: 68,704, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,021
    Helped
    3209 / 3209
    Points
    68,704
    Level
    63

    Re: OP amp output oscillating

    Hi,

    I assume you did not use all 4 opamps ... and you left some (unused) inputs floating.
    A no-go.

    Besides this I don't think a breadboard is useful for this application.

    I see no GND concept.
    Just connecting some components does not work.
    Better use a simulation tool like Ltspice, it doesn't care about wiring.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

  13. #13
    Full Member level 2
    Points: 1,384, Level: 8

    Join Date
    Sep 2014
    Posts
    134
    Helped
    0 / 0
    Points
    1,384
    Level
    8

    Re: OP amp output oscillating

    I terminated the not used op amp, but it didn't make any differences. Could it be then so that on breadboard this is not possible to make work?



  14. #14
    Advanced Member level 5
    Points: 8,859, Level: 22
    d123's Avatar
    Join Date
    Jun 2015
    Posts
    1,577
    Helped
    363 / 363
    Points
    8,859
    Level
    22

    Re: OP amp output oscillating

    Hi,

    I'd guess Klaus's most recent reply is worth considering re breadboards. Apart, and I guess irrelevant here - on breadboards (and finished PCB designs) I always add 0.1uF, 0.1uF, 1uF or 0.1uF, 1uF, 10uF at the (bread)board supply pins and at least 0.1uF and 1uF (+ maybe a 10nF sometimes) on all IC supply pins. Perhaps OTT to some but it works well.

    Does putting the MCU/PIC/the IC that has the 4MHz signal on another breadboard make any difference? I guess it won't.


    1 members found this post helpful.

  15. #15
    Full Member level 2
    Points: 1,384, Level: 8

    Join Date
    Sep 2014
    Posts
    134
    Helped
    0 / 0
    Points
    1,384
    Level
    8

    Re: OP amp output oscillating

    Thank you all for helping me. This might be just bit off topic, hopefully ok. Bear with me please. I decided to ditch the idea of LM2902 & relays etc. as it was possible to achieve what I was looking for with much simpler design. I'm still using OP AMP this time LM258 so I'm afraid of the oscillation happening again in real pcb. So I'm asking your kind help to check this pcb design is there any issues which might cause OP amp to not work correctly? Or other detrimental design flaw?
    I have followed rules: Chrystal as close to micro as possible, IC caps as close to power pin as possible, Ground plane.

    It is double sided pcb. In the picture, top image is top copper.

    Click image for larger version. 

Name:	circuitry.jpg 
Views:	3 
Size:	143.2 KB 
ID:	150839



    •   AltAdvertisment

        
       

  16. #16
    Super Moderator
    Points: 250,799, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    43,661
    Helped
    13280 / 13280
    Points
    250,799
    Level
    100

    Re: OP amp output oscillating

    There's absolutely no reason to expect OP oscillations in this circuit.

    Depending on the nature of the input signal fed to the circuit, you probably want some low pass filtering in front of the amplifier.

    I wonder however why you are using an external crystal, FRC oscillator should be fine for this application.



--[[ ]]--