Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Noise generator circuit

Status
Not open for further replies.

BobW

Active Member
I've been thinking about building a hardware based true random number generator. For that, I'll need some kind of analog noise source that can then be digitized. Most of circuits that I've looked at use either a zener diode in avalanche mode or a bipolar transistor in avalanche mode. These appear to be more efficient with a higher supply voltage. I'd prefer to keep the supply voltage at 5 volts. Perhaps a 3.3 volt zener followed by lots of gain stages. But, I've been wondering about other possible noise sources. Does anyone have any ideas for a compact low voltage source of random noise?

One of the ideas I've had, although I'm sure it's not practical, is to use the ionization chamber from a smoke detector. I have one sitting in my junk box. Has anyone ever played with one of these?
 
I designed a true random number generator about 10 years ago. This was made from an LM324 quad op amp configured with ac gain (put a capacitor in the 'RI' leg of the feedback network. This amplifies the noise, but not the offset voltage. The input to the first op amp stage was a resistive divider putting the input voltage at about Vcc/4 (well within the common mode range of the LM324 input stage)

I found I did not need a Zener as the input noise of the LM324 was sooo hideous, but you can use that to your advantage here

I cannot recall the amount of gain of each stage (about 10?), but I then fed this into a PIC's ADC and measured the voltage at regular intervals. I wanted a random number from 00 to 99, so did a read for the tens and a read for the units.

I logged about 1000 numbers and found the numbers to be completely random..

You need to make sure the LM324 output does not hit the rails or you will get a disproportionate amount of '1's. From memory, I only logged results between about 1V and 4V and scaled the reading in software to emulate it being between 0 and 10.
 
Hy Bob,

As most of the common, well proven, and cheap noise generators use a Zener diode of around 7.5V, you could use a low power inverter to generate a 12V supply or so, to allow you to generate a constant zener current. From then on the circuits could use 5V or 3V3.

The inverter could be a sine wave class A type at a frequency at least ten times the noise bandwidth required to make filtering simple.

spec
 
Last edited:
I'll need some kind of analog noise source that can then be digitized.
What sample rate will you use for the digitising? Even pink (or other weighted) noise, or pseudo-random noise might give a sufficiently random set of samples if sampled infrequently or irregularly.
 
Simon, I may look at using a noisy op amp. There are quite a few that work on 5 volts. So that could be a good way to do it. However, feeding it into a PIC ADC wouldn't give me enough resolution. Although I could concatenate multiple samples.

Spec: My biggest concern about stepping up the voltage is the risk of getting power supply artifacts in the random signal. Last night I was doing some experimenting with a zener diode source, and after much amplification, I could see periodic spikes on the scope trace. It wasn't generated in my power supply, because it's a linear supply. So, it was some kind of external interference generated, and picked up in the gain stages. So, I can see that it will be critical to have everything well shielded and decoupled.

Alec_t: I haven't really decided on a sample rate. The faster the better, I guess, but it would obviously depend on the bandwidth of the noise source. This is mostly for fun at the moment, but could be useful for a current computer programming project. If I could generate a 40 bit random number in under 1 ms, that would be ideal.

My original idea was to amplify the random noise source and pass it through a comparator to generate a random pulse train which is then clocked into a shift register at a fixed clock rate. Then I would use von Neumann de-biasing which would cut the original bit rate in half.
 
Spec: My biggest concern about stepping up the voltage is the risk of getting power supply artifacts in the random signal. Last night I was doing some experimenting with a zener diode source, and after much amplification, I could see periodic spikes on the scope trace. It wasn't generated in my power supply, because it's a linear supply. So, it was some kind of external interference generated, and picked up in the gain stages. So, I can see that it will be critical to have everything well shielded and decoupled.

Bob,

Yes, that was my concern but a low power supply shouldn't cause too much bother. As you obviously well know, the noise has to be truly random so you have to be careful about the noise source you choose. My feeling is that a Zener noise current has been so firmly established as a good noise source that it may be more fruitful to concentrate on a voltage multiplier so that a Zener diode could be used.

Good layout, decoupling, and screening from magnetic and capacitive coupling would be essential. The choice of passive components would also be critical.

Would batteries be out of the question? The circuit could be designed so that the battery would last a long time, using 4 x CR123 type say.

This is just a thought, but arn't LEDs fairly noisy?

Here is some information from Maxim on a white noise generator that runs off +- 2.5V supply lines and uses opamp noise, but one without much excess LF noise. http://www.maximintegrated.com/en/app-notes/index.mvp/id/4527
http://datasheets.maximintegrated.com/en/ds/MAX4238-MAX4239.pdf
**broken link removed**

And another opamp approach which may be of interest: http://www.techlib.com/area_50/whitenoise.htm

spec

Additional info:
(1) http://www.maximintegrated.com/en/app-notes/index.mvp/id/3469
(2) http://www.xilinx.com/support/documentation/application_notes/xapp052.pdf
(Any long LFSR counter generates a long pseudo-random
sequence of zeros and ones. The sequence is not exactly
random since it repeats eventually, and it also follows a
mathematically predictable sequence. But for most practi-
cal purposes it can be considered random.)
(3) http://www.noisewave.com/faq.pdf
(4) http://holdenc.altervista.org/avalanche/
 
Last edited:
It all depends, if you want a random number generator that uses all the numbers in a sequence, you need to put them all in a random order list and pick them off one at a time.
Alternatively you can use the timing from a person pushing a switch.
 
I tried a few experiments last night with no success. It's strange that when you don't want noise, it seems to be everywhere, and when you're trying to generate it, everything is completely clean. My problem at the moment is finding amplifying devices that work at 5 volts. I don't seem to have much on hand at the moment, and will have to order some parts.
 
It all depends, if you want a random number generator that uses all the numbers in a sequence, you need to put them all in a random order list and pick them off one at a time.
Alternatively you can use the timing from a person pushing a switch.
Hy Colin,

While what you said may be intuitive it is not strictly correct. The whole area of random number generation has been well documented- see 'additional information' (2) in post #6 above for example.

spec
 
It's strange that when you don't want noise, it seems to be everywhere, and when you're trying to generate it, everything is completely clean.

The principle is also true for amplifiers: invariably they will oscillate, but if you want an oscillator invariably they will be rock solid.:arghh:

spec
 
Last edited:
"While what you said may be intuitive it is not strictly correct. "
I don't know what you are talking about.
I produce a gaming machine and need to deliver all the numbers in a sequence as the jackpot is a particular number.
The only way to guarantee 1,000 individual numbers on a ticket is to use a list.
A dice project using the player reaction time for 1 to 6 and out of 500 plays the results were biased.
The only answer was to have a random table.
 
There is a fundamental difference between what is generally referred to as a true random number generator which has an equal probability of generating any number (including one that has been previously generated), and a random sorting algorithm which randomly sorts a finite table of existing numbers. They both have their uses. What I want to build is the former type.
 
Compact and low voltage - While your use of the phrase "true random number" probably implies that you do not want to use a digital technique like a LFSR, consider this (and note that it comes from someone with my license plate). A PIC implementing a 32- or 48- or whatever-bit LFSR in software will be so close to mathematically pure as to be immeasurable, and consists of one 8 pin SO part and a bypass cap. Can't get much smaller than that, and the output is already in the digital format of your choice.

Or (from a Tom Clancy book), point a directional antenna at the sun and use/record that.

ak
 
I have been using a pseudo random number generator for my project, and it works very well. I've been doing a Monte Carlo simulation, with over 500 million pseudo random numbers generated so far. However, I'd like to expand the project to make use of all four cores in my computer's CPU, and possibly even create a network of Raspberry Pi's all running the simulation in parallel. In order to do this, it's important that the random number sequences used in the parallel processors don't overlap. One way to do this is to use a true random number generator, so that there is no fixed sequence. The other way is to use a type of pseudo random number generator that can be seeded in a deterministic way such that sequence overlap is avoided. These types of RNG's are not cryptographically secure because of this characteristic, but are ideal for parallel Monte Carlo. I expect that for practical reasons I'll continue using a pseudo random number generator, but for curiosity's sake, I'd still like to experiment building a true random number generator. I did manage to locate a schematic for a noise generator that uses a band gap reference diode and some cascaded amplifiers, all running on a 3 volt supply:
https://www.physics.wisc.edu/~lmaurer/projects/minirng/minirng.html
So, this one looks like a good starting point.
 
I've been thinking about building a hardware based true random number generator. For that, I'll need some kind of analog noise source that can then be digitized. Most of circuits that I've looked at use either a zener diode in avalanche mode or a bipolar transistor in avalanche mode. These appear to be more efficient with a higher supply voltage. I'd prefer to keep the supply voltage at 5 volts. Perhaps a 3.3 volt zener followed by lots of gain stages. But, I've been wondering about other possible noise sources. Does anyone have any ideas for a compact low voltage source of random noise?

One of the ideas I've had, although I'm sure it's not practical, is to use the ionization chamber from a smoke detector. I have one sitting in my junk box. Has anyone ever played with one of these?
NEED A BETTER DESIGN SPEC
- besides Vdc , you should spec. BW of noise, all will have LF and HF limits unless biased for DC gain with a critical temp compensation ,then specify; the measurement interval , resolution , and test criteria.

if just looking for coin flipper binary, thats easy. if looking for ADC values, its harder with common missing codes
 
...if just looking for coin flipper binary, thats easy. if looking for ADC values, its harder with common missing codes
See post #15

The eventual output of the RNG should be a double precision number in the range 0<=n<1.
So, I need to collect enough bits from a bit stream to assemble the mantissa of a double precision number. I think that's about 48 bits.
 
See post #15

The eventual output of the RNG should be a double precision number in the range 0<=n<1.
So, I need to collect enough bits from a bit stream to assemble the mantissa of a double precision number. I think that's about 48 bits.

Even with a good Sigma Delta ADC you might get a lot of missing codes in 48 bits and no algorithm to decode.

I think, there are two methods to analyze random.
. 1) Equal power spectrum without any dominant or deterministic frequency
. 2) random code selection until every code is used ( like card shuffling with N decks ) then repeat with a different random seed sequence but same even distribution of numbers sequenced.

2 is better for disk and memory access random testing with rolling code seeds using SALT and other seed scrambling methods so that spectrum may change randomly but every address and content is uniformly accessed in the shortest time using dozens of patterns to test for crosstalk, noise margin and soft error rate testing. I have used many methods for finding memory defect mapping using many sophisticated tools, when I had an unlimited budget.

IMHO! Two Fish algorithm is best for encryption and PRSG noise for Security.

It was the best choice in my mind for AES2000 but I think it came 2nd because 1st choice had a found only they, (NSA) had the computing power to decode it with millions of parallel cores. 2 Fish or Two Fish had the smaller code, ran faster and used less power, has more entropy (a key metric) but was never broken.... was developed by security guru, Bruce Shneirer and has open source code for many popular CPUs.
 
Last edited:
you can easily generate a pseudo random generator of maximal length sequence with a long shift register and choose any length , n for 2^n maximal length. e.g. 2^47 length sequence using only 2 elements to feedback with XNOR or XOR*
47,42 .

try it.

then you simply use SALT to create a random seed using only 8 bits. i.e. SALT is another scrambled start pattern.

*NOTE if you invert input either all 0 or 1's can never be used to start.
 
Last edited:
you can easily generate a pseudo random generator of maximal length sequence with a long shift register and choose any length , n for 2^n maximal length. e.g. 2^47 length sequence using only 2 elements to feedback with XNOR or XOR*
47,42 .

try it.

then you simply use SALT to create a random seed using only 8 bits. i.e. SALT is another scrambled start pattern.

*NOTE if you invert input either all 0 or 1's can never be used to start.

Tony,

I think the classic shift register with XOR feedback is described in post #6, additional information (2). I only mention this because I have used this approach stacks of times and would be interested to know if there are any aspects that I am not aware of. I certainly don't know some of the fancy maths involved, but I used to have the bible on the subject and damned if I can't find it or even a reference to it. We also had an expert mathematician in this field at work who sorted any problem areas we had. He also verified our designs and wrote parts of the reports we did so they made sense.

We used software generators, micro generators, TTL generators, and ECL generators, depending on the speed required. It is a fascinating area- to me anyway. :)

spec
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top