Author Topic: LM324 Noise Source  (Read 4231 times)

0 Members and 1 Guest are viewing this topic.

Offline DabbotTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: au
LM324 Noise Source
« on: September 17, 2019, 12:03:33 pm »
Here is something I came up with while searching for a circuit to feed random into an ADC.

It works by using the LM324 / LM2902 to amplify its own garbage.

The schematic is attached. The "ground" is offset low to account for the +V headroom required when running at its minimum supply spec.

Pros:
- Works down to 3 volts, drawing the better part of a milliamp.
- Decent signal. About 1.2v to 1.4v. YMMV across variants.

Cons:
- The spectrum of the noise is horrid, because it's an LM324. But I don't have access to anything beyond an entry level scope with FFT to comment any further than that.
- More components than your typical BJT zener noise source.

There could be oscillations that I'm not seeing, among other problems. If anyone has the time and gear to give this circuit a try and comment on it, much appreciated!

Edit: Version 2 schematic and scope shot attached.
Edit: Version 3 schematic and scope shot attached.
« Last Edit: October 04, 2019, 12:28:44 pm by Dabbot »
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: LM324 Noise Source
« Reply #1 on: September 17, 2019, 12:12:00 pm »
If anyone has the time and gear to give this circuit a try and comment on it, much appreciated!

Why don't you show FFT screen so we can comment w/o building circuit? ;)
 

Offline DabbotTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: au
Re: LM324 Noise Source
« Reply #2 on: September 17, 2019, 12:27:46 pm »
If anyone has the time and gear to give this circuit a try and comment on it, much appreciated!

Why don't you show FFT screen so we can comment w/o building circuit? ;)

Attached.  ;D
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15157
  • Country: de
Re: LM324 Noise Source
« Reply #3 on: September 17, 2019, 12:40:27 pm »
My first thought was that the coupling caps would give a rather high lower frequency limit. However this can be a good idea as it would suppress 50 Hz hum and 1/f noise.
The LM324 cross over distortion together with low frequency noise / hum could give some noise modulation.

I would consider a different, more modern OP, maybe MCP6004 or some LMV324 or similar.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: LM324 Noise Source
« Reply #4 on: September 17, 2019, 12:42:22 pm »
Thanx for FFT. Yes, it looks like opamp noise spectrum, so circuit indeed works as expected. BTW lm324 is awfully "noisy" opamp.

[edit] Further reading: https://www.analog.com/en/analog-dialogue/articles/understanding-and-eliminating-1-f-noise.html

ADA4622-2 noise plot:

« Last Edit: September 17, 2019, 01:00:26 pm by ogden »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: LM324 Noise Source
« Reply #5 on: September 17, 2019, 01:03:48 pm »
Increase the resistor values for more noise.

You could probably do this with the LM358, just by using an even higher noise gain.
 

Offline DabbotTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: au
Re: LM324 Noise Source
« Reply #6 on: September 17, 2019, 01:18:14 pm »
Increase the resistor values for more noise.

You could probably do this with the LM358, just by using an even higher noise gain.

I'll give it a try, but I'll want to maintain the gain, and don't want to introduce too much offset, as I'm running it near its minimum supply spec.
Some options: 1.5K and 56K, 2.2K and 82K
« Last Edit: September 17, 2019, 01:21:32 pm by Dabbot »
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15157
  • Country: de
Re: LM324 Noise Source
« Reply #7 on: September 17, 2019, 01:31:51 pm »
I don't know the scope, but from what it looks like the FFT range extends quite a bit to very high frequencies, like 500 kHz full scale.  So the drop of to higher frequency is more like the BW limit of the OP and not the 1/f noise.

With just an LM358 the bandwidth would be lower, even when avoiding the virtual ground buffer. It depends on the speed of the ADC used if this is a problem.  The DC gain is still at 1 for each stage, so no problem there. The noise is still mainly from the OP, not the resistors. It would take something like 100 K at the non inverting input to get a significant noise contribution from the resistor.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: LM324 Noise Source
« Reply #8 on: September 17, 2019, 01:34:30 pm »
Increase the resistor values for more noise.

You could probably do this with the LM358, just by using an even higher noise gain.

I'll give it a try, but I'll want to maintain the gain, and don't want to introduce too much offset, as I'm running it near its minimum supply spec.
Some options: 1.5K and 56K, 2.2K and 82K
The offset can be minimised by keeping the DC gain unity. The noise gain can be as high as you like, without affecting the offset voltage.

See the following thread for more information on noise gain.
https://www.eevblog.com/forum/beginners/op-amp-spec-noise-gain-configuration/msg2401983/#msg2401983
« Last Edit: September 17, 2019, 01:36:27 pm by Zero999 »
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: LM324 Noise Source
« Reply #9 on: September 17, 2019, 01:42:48 pm »
I don't know the scope, but from what it looks like the FFT range extends quite a bit to very high frequencies, like 500 kHz full scale.  So the drop of to higher frequency is more like the BW limit of the OP and not the 1/f noise.

I don't know that scope as well, frequency span of FFT shown is mystery to me, yet I believe that marker stands in the middle which is 5.9 KHz. Meaning it is 1/f noise we see.

Increase the resistor values for more noise.

Don't bother. Pk-pk amplitude of existing noise is 1.4V already, no need to increase it further. As noise is "colored" towards low frequencies, this "noise generator" does not have any meaningful value other than learning tool - opamp noise demonstrator. If you are looking for noise source, you better build it out of zener and broadband amplifier (not for gods sake LM324).
« Last Edit: September 17, 2019, 01:46:55 pm by ogden »
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 15157
  • Country: de
Re: LM324 Noise Source
« Reply #10 on: September 17, 2019, 02:03:17 pm »
A sampling rate of 1 Ms/s suggests an upper limit of 500 kHz. This would mean 50 kHz per div.

One should be able to more the maker away from the left edge to somewhere in the center to get a more meaningful number to estimate the scale. Otherwise one could check the scale with a known signal (e.g. 1 kHz cal signal for the probes).

Even if colored noise, it could still be useful to create something like true random number, e.g. with a µC reading the noise with an ADC.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: LM324 Noise Source
« Reply #11 on: September 17, 2019, 03:13:18 pm »
Increase the resistor values for more noise.

Don't bother. Pk-pk amplitude of existing noise is 1.4V already, no need to increase it further. As noise is "colored" towards low frequencies, this "noise generator" does not have any meaningful value other than learning tool - opamp noise demonstrator. If you are looking for noise source, you better build it out of zener and broadband amplifier (not for gods sake LM324).
I'm talking about simplifying things by using the LM358, rather than the LM324, so more gain would be required, with only two stages, rather than three.

Something like this will do. It has a similar lower cut-off and noise gain to the original poster's circuit, but it's crammed into two stages, each with a noise gain of 1+820/3.3, rather than three stages with a noise gain of 40, so the upper cut-off frequency will be lower. R7 & R8 are there to match the bias currents at the inputs. They can be omitted but the DC output voltage will increase by about 75mV and will be less stable, over the temperature range. C3 helps to prevent noise from the supply being coupled to the circuit's output.


Is the spectrum really that important if all the original poster needs is to seed a random number generator?
 
The following users thanked this post: ogden

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: LM324 Noise Source
« Reply #12 on: September 17, 2019, 03:22:56 pm »
A sampling rate of 1 Ms/s suggests an upper limit of 500 kHz. This would mean 50 kHz per div.

One should be able to more the maker away from the left edge to somewhere in the center

Thing is that marker already is in the center, showing 5.9 KHz frequency. [edit] Yes, I agree that this kind of noise source potentially can be used for RNG application.
« Last Edit: September 17, 2019, 10:55:14 pm by ogden »
 

Offline DabbotTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: au
Re: LM324 Noise Source
« Reply #13 on: September 17, 2019, 08:55:54 pm »
A sampling rate of 1 Ms/s suggests an upper limit of 500 kHz. This would mean 50 kHz per div.

One should be able to more the maker away from the left edge to somewhere in the center

Thing is that marker already is in the center, showing 5.9 KHz frequency (attach). [edit] Yes, I agree that this kind of noise source potentially can be used for RNG application.

That's just the scope's inbuilt frequency measurement being very confused. It's all over the place while running. Sorry, I should have turned that measurement off.
The FFT is 0 to 100KHz, with 50KHz center.
 

Offline DabbotTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: au
Re: LM324 Noise Source
« Reply #14 on: September 17, 2019, 09:04:54 pm »
Increase the resistor values for more noise.

Don't bother. Pk-pk amplitude of existing noise is 1.4V already, no need to increase it further. As noise is "colored" towards low frequencies, this "noise generator" does not have any meaningful value other than learning tool - opamp noise demonstrator. If you are looking for noise source, you better build it out of zener and broadband amplifier (not for gods sake LM324).
I'm talking about simplifying things by using the LM358, rather than the LM324, so more gain would be required, with only two stages, rather than three.

Something like this will do. It has a similar lower cut-off and noise gain to the original poster's circuit, but it's crammed into two stages, each with a noise gain of 1+820/3.3, rather than three stages with a noise gain of 40, so the upper cut-off frequency will be lower. R7 & R8 are there to match the bias currents at the inputs. They can be omitted but the DC output voltage will increase by about 75mV and will be less stable, over the temperature range. C3 helps to prevent noise from the supply being coupled to the circuit's output.
(Attachment Link)

Is the spectrum really that important if all the original poster needs is to seed a random number generator?

The discrete component count is actually the same as my original circuit. None the less, I'll build this and give it a spin this afternoon.  :)
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: LM324 Noise Source
« Reply #15 on: September 17, 2019, 09:57:24 pm »
It has the same part count, if you include R7 & R8, which probably aren't needed. Try omitting them and see what happens.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: LM324 Noise Source
« Reply #16 on: September 17, 2019, 11:05:43 pm »
That's just the scope's inbuilt frequency measurement being very confused. It's all over the place while running. Sorry, I should have turned that measurement off.
The FFT is 0 to 100KHz, with 50KHz center.

Frequency measurement shall be confused while measuring *noise*. That's whole point of noise :D It's my fault, I missed 50KHz display for "FFT channel" measurement @cursor because of unusual placement. Anyway - if frequency span displayed is 0 - 100KHz, then drop of noise amplitude we see is not due to BW limit, i'ts corner/knee between 1/f and broadband noise.
 

Offline DabbotTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: au
Re: LM324 Noise Source
« Reply #17 on: September 18, 2019, 08:59:35 am »
Increase the resistor values for more noise.

Don't bother. Pk-pk amplitude of existing noise is 1.4V already, no need to increase it further. As noise is "colored" towards low frequencies, this "noise generator" does not have any meaningful value other than learning tool - opamp noise demonstrator. If you are looking for noise source, you better build it out of zener and broadband amplifier (not for gods sake LM324).
I'm talking about simplifying things by using the LM358, rather than the LM324, so more gain would be required, with only two stages, rather than three.

Something like this will do. It has a similar lower cut-off and noise gain to the original poster's circuit, but it's crammed into two stages, each with a noise gain of 1+820/3.3, rather than three stages with a noise gain of 40, so the upper cut-off frequency will be lower. R7 & R8 are there to match the bias currents at the inputs. They can be omitted but the DC output voltage will increase by about 75mV and will be less stable, over the temperature range. C3 helps to prevent noise from the supply being coupled to the circuit's output.
(Attachment Link)

Is the spectrum really that important if all the original poster needs is to seed a random number generator?

...and the results are in!

I built the circuit and checked it out on the scope. Lots of oscillations and even some clipping (not shown), but this is not due to the circuit itself, rather the circuit's sensitivity to the environment. It's on a breadboard and the metal base was not grounded. I took another shot of the scope with said base grounded and you can see it all but got rid of the oscillations. As you can see, the amplitude of the noise is lower, but still very usable for my intents and purposes.

I performed the same tests with the breadboard's base on my original circuit and it did not show the same susceptibility.

Edit: Fix typos in attachments.
« Last Edit: October 02, 2019, 11:33:27 am by Dabbot »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: LM324 Noise Source
« Reply #18 on: September 18, 2019, 11:04:28 am »
I'm surprised the output is that much lower.

Did you test it both with R7 & R8 and without? The circuit I posted will be more susceptible to EMI, simply because it uses higher value resistors, than your circuit.
 

Offline DabbotTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: au
Re: LM324 Noise Source
« Reply #19 on: September 18, 2019, 11:25:29 am »
Taking out R7 and R8 causes the output to diminish substantially.

Don't these chips share biasing circuitry? It might explain the smaller amount of noise, given there's less circuitry to generate it.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: LM324 Noise Source
« Reply #20 on: September 18, 2019, 11:34:24 am »
I'm surprised the output is that much lower.

We see that 1/f transition in this case is at much lower frequency. We can conclude that particular opamp have lower noise level, thus lower noise amplitude (at the same gain).

...and the results are in!

Well done! Any chance to increase output capacitor value? At least to 1uF or even 10uF.
 

Offline DabbotTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: au
Re: LM324 Noise Source
« Reply #21 on: September 18, 2019, 11:53:55 am »
Well done! Any chance to increase output capacitor value? At least to 1uF or even 10uF.

Whoops. I forgot to include the output cap. You're looking at the scope directly connected to the output. The scope's channel was AC coupled. :palm:

Edit: I just tried various output cap values. There's no observable difference.
« Last Edit: September 18, 2019, 12:06:58 pm by Dabbot »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: LM324 Noise Source
« Reply #22 on: September 19, 2019, 12:45:24 pm »
Taking out R7 and R8 causes the output to diminish substantially.

Don't these chips share biasing circuitry? It might explain the smaller amount of noise, given there's less circuitry to generate it.
That makes sense. Removing R7 & R7 will reduce the noise because the bias currents of the LM358 are inherently noisy. Unfortunately the input current not specified, so it can't be calculated. For your information it's just Ohm's law INOISE*RIN.

I think using more stages will also increase the noise, because each amplifier adds noise.
 

Offline DabbotTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: au
Re: LM324 Noise Source
« Reply #23 on: September 20, 2019, 12:28:02 pm »
Update time!

I took Zero999's approach of upping the value of the gain resistors, as well as placing resistors on the +ve inputs.

This resulted in more overall noise, and allowed me to decrease the gain and get higher frequencies through. Not that it really matters for my application. I just wanted to experiment.

I also tried to use a completely passive ground so I could use four stages, but this introduced additional instability, even with a decoupling cap.

Updated schematic and scope shot attached.
 
The following users thanked this post: thm_w

Offline DabbotTopic starter

  • Regular Contributor
  • *
  • Posts: 198
  • Country: au
Re: LM324 Noise Source
« Reply #24 on: October 04, 2019, 01:02:39 pm »
Another update!

Recently I got the chance to experiment with this a bit more and managed to make further improvements:

First, I removed the 100K resistors from the latter stages' non-inverting inputs, as these resistors were not contributing in any significant sense.

Second, and the most interesting to me, is that I changed the second amplifier stage to non-inverting. This further flattened out the noise spectrum. I'm unsure exactly why this is.

Third, I AC-coupled the input of the first stage. This, along with the first stage's matched input resistances let me DC-couple its output to the non-inverting second stage, as the DC offset is negligible.

Version 3 schematic and scope shot attached.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf