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

    Join Date
    Sep 2014
    Posts
    133
    Helped
    0 / 0
    Points
    1,380
    Level
    8

    OP amp output oscillating

    Dear All,

    Here's my circuit
    Click image for larger version. 

Name:	voltage_amp_comp.JPG 
Views:	22 
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,417, Level: 13

    Join Date
    Nov 2013
    Posts
    512
    Helped
    111 / 111
    Points
    3,417
    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,380, Level: 8

    Join Date
    Sep 2014
    Posts
    133
    Helped
    0 / 0
    Points
    1,380
    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,686, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    43,647
    Helped
    13274 / 13274
    Points
    250,686
    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.

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

    Join Date
    Nov 2013
    Posts
    512
    Helped
    111 / 111
    Points
    3,417
    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.

    •   AltAdvertisment

        
       

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

    Join Date
    Sep 2014
    Posts
    133
    Helped
    0 / 0
    Points
    1,380
    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,015, Level: 47

    Join Date
    Mar 2008
    Location
    USA
    Posts
    6,142
    Helped
    1783 / 1783
    Points
    38,015
    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,380, Level: 8

    Join Date
    Sep 2014
    Posts
    133
    Helped
    0 / 0
    Points
    1,380
    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,417, Level: 13

    Join Date
    Nov 2013
    Posts
    512
    Helped
    111 / 111
    Points
    3,417
    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,549, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,002
    Helped
    3206 / 3206
    Points
    68,549
    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,380, Level: 8

    Join Date
    Sep 2014
    Posts
    133
    Helped
    0 / 0
    Points
    1,380
    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:	10 
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,549, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,002
    Helped
    3206 / 3206
    Points
    68,549
    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.

    •   AltAdvertisment

        
       

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

    Join Date
    Sep 2014
    Posts
    133
    Helped
    0 / 0
    Points
    1,380
    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,836, Level: 22
    d123's Avatar
    Join Date
    Jun 2015
    Posts
    1,577
    Helped
    362 / 362
    Points
    8,836
    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.



--[[ ]]--