LM324 Noise Source - Page 1
Forum section: electronics / beginners

author: Dabbot
author_rank: Regular Contributor
timestamp: September 17, 2019, 12:03:33 pm
content: 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.

author: ogden
author_rank: Super Contributor
timestamp: September 17, 2019, 12:12:00 pm
content: Quote from: Dabbot on September 17, 2019, 12:03:33 pmWhy don't you show FFT screen so we can comment w/o building circuit?

author: Dabbot
author_rank: Regular Contributor
timestamp: September 17, 2019, 12:27:46 pm
content: Quote from: ogden on September 17, 2019, 12:12:00 pmAttached.

author: Kleinstein
author_rank: Super Contributor
timestamp: September 17, 2019, 12:40:27 pm
content: 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.

author: ogden
author_rank: Super Contributor
timestamp: September 17, 2019, 12:42:22 pm
content: Thanx for FFT. Yes, it looks like opamp noise spectrum, so circuit indeed works as expected. BTW lm324 is awfully "noisy" opamp. Further reading:https://www.analog.com/en/analog-dialogue/articles/understanding-and-eliminating-1-f-noise.htmlADA4622-2 noise plot:

author: Zero999
author_rank: Super Contributor
timestamp: September 17, 2019, 01:03:48 pm
content: Increase the resistor values for more noise.You could probably do this with the LM358, just by using an even higher noise gain.

author: Dabbot
author_rank: Regular Contributor
timestamp: September 17, 2019, 01:18:14 pm
content: Quote from: Zero999 on September 17, 2019, 01:03:48 pmI'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

author: Kleinstein
author_rank: Super Contributor
timestamp: September 17, 2019, 01:31:51 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: September 17, 2019, 01:34:30 pm
content: Quote from: Dabbot on September 17, 2019, 01:18:14 pmThe 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

author: ogden
author_rank: Super Contributor
timestamp: September 17, 2019, 01:42:48 pm
content: Quote from: Kleinstein on September 17, 2019, 01:31:51 pmI 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.Quote from: Zero999 on September 17, 2019, 01:03:48 pmDon'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).

author: Kleinstein
author_rank: Super Contributor
timestamp: September 17, 2019, 02:03:17 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: September 17, 2019, 03:13:18 pm
content: Quote from: ogden on September 17, 2019, 01:42:48 pmI'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?

author: ogden
author_rank: Super Contributor
timestamp: September 17, 2019, 03:22:56 pm
content: Quote from: Kleinstein on September 17, 2019, 02:03:17 pmThing is that marker already is in the center, showing 5.9 KHz frequency.  Yes, I agree that this kind of noise source potentially can be used for RNG application.

author: Dabbot
author_rank: Regular Contributor
timestamp: September 17, 2019, 08:55:54 pm
content: Quote from: ogden on September 17, 2019, 03:22:56 pmThat'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.

author: Dabbot
author_rank: Regular Contributor
timestamp: September 17, 2019, 09:04:54 pm
content: Quote from: Zero999 on September 17, 2019, 03:13:18 pmThe 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.

author: Zero999
author_rank: Super Contributor
timestamp: September 17, 2019, 09:57:24 pm
content: It has the same part count, if you include R7 & R8, which probably aren't needed. Try omitting them and see what happens.

author: ogden
author_rank: Super Contributor
timestamp: September 17, 2019, 11:05:43 pm
content: Quote from: Dabbot on September 17, 2019, 08:55:54 pmFrequency measurement shall be confused while measuring *noise*. That's whole point of noiseIt'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.

author: Dabbot
author_rank: Regular Contributor
timestamp: September 18, 2019, 08:59:35 am
content: Quote from: Zero999 on September 17, 2019, 03:13:18 pm...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.

author: Zero999
author_rank: Super Contributor
timestamp: September 18, 2019, 11:04:28 am
content: 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.

author: Dabbot
author_rank: Regular Contributor
timestamp: September 18, 2019, 11:25:29 am
content: 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.

author: ogden
author_rank: Super Contributor
timestamp: September 18, 2019, 11:34:24 am
content: Quote from: Zero999 on September 18, 2019, 11:04:28 amWe 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).Quote from: Dabbot on September 18, 2019, 08:59:35 amWell done! Any chance to increase output capacitor value? At least to 1uF or even 10uF.

author: Dabbot
author_rank: Regular Contributor
timestamp: September 18, 2019, 11:53:55 am
content: Quote from: ogden on September 18, 2019, 11:34:24 amWhoops. 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.Edit: I just tried various output cap values. There's no observable difference.

author: Zero999
author_rank: Super Contributor
timestamp: September 19, 2019, 12:45:24 pm
content: Quote from: Dabbot on September 18, 2019, 11:25:29 amThat 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.

author: Dabbot
author_rank: Regular Contributor
timestamp: September 20, 2019, 12:28:02 pm
content: 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.

author: Dabbot
author_rank: Regular Contributor
timestamp: October 04, 2019, 01:02:39 pm
content: 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.