Random Byte Generator

Currently (and for the next few weeks), I don’t have access to my gears… So to occupy myself a bit I try to design new modules.
For one of them, I need a random source of bits, and I found this circuit (upper part):

Did any of you ever tried this one (or has a better alternative)? It’s quite difficult to simulate randomness…
Also, what are your thoughts on the oscillator circuit? I tried to simulate it too, but no success. I don’t know if it’s from the circuit itself or because the simulator just can’t…

4 Likes

My first thought is to use a noise generator and sample from it, then run through a ADC. How complex did your pseudo-randomness need to be?

You can go about this by algorithm or with physical processes.

Knowing more why you need this might help in recommending a method.

3 Likes


image

Just one example, but it should be simple to generate noise since a lot of times it happens when we dont want it.

Importantly though, you want white noise since for better random numbers you dont want a bias.

I dont think the transistor type is too important here, so use what you got i think:

At least when you run this through your ADC you dont have to wrry much about aliasing or signal to noise ratio!

Whats the bit depth you are after? (thread said a byte, but im just checking)

4 Likes

Oh I hadn’t thought about that! But it seems that I would get a biased value, no? (I really don’t know, true random is hard!)

I don’t have much space left, so the circuit should have a small footprint. But yeah actually, just a clocked ADC and no need for the sample and hold, that could fit!

I’m designing a logic gate version of that: https://r0d0t.tumblr.com/post/45022928402, a “Random Jazz Machine”, so I need random bits to select the notes and patterns (full schematic (from me) here: https://github.com/telec16/modular-synth/blob/master/RJG/schematic.pdf).

3 Likes

Not really, unless you want to go the quantum randomness level (like a Geiger Counter), this will probably suffice.

When you add the clock and adc this shouldnt add much.

This design is a hardware random number generator, it uses stochastic processes that are unpredictable, and generally considered random.

Other ways include using a transducer to convert physical phenomena into an electrical signal (like a sensor), then using an amplifier to raise the amplitude of those fluctuations to a measurable level. You could prolly do this with a moisture sensor or LDR and it would work fine.

The only time i would recommend a software solution is if its easier (already using a microcontroller) or if you need to be able to use seeds (looks like the link you provided does implement seeds, so you wont be able to do that here).

3 Likes

But if the noise level is not to scale with the input of the ADC, I will have a noticeable bias, no? I need to check that…

Yep, that’s what I thought will writing.

Which one?

I don’t think this idea could fit my needs, it seems to vary too slowly/to be too easy to bias…

For sure that would be easier, but I aim at a non-microcontroller solution !

3 Likes

This is actually funny because this is sorta related to the breakdown voltage discussions with the super simple oscillator.

SEE ALL THE THREADS OF ALL THE ISSUES:

TLDR; if one transistor doesnt avalanche, try another.

See this for more info:

2 Likes

Or, you could go the @nervous_squirrel route:

:rofl:

6 Likes

Ahah! Yep that would be true random! With a slightly bigger footprint though :stuck_out_tongue:

5 Likes

For a smaller footprint use plutonium

7 Likes

You could use the innards of a smoke detector to give you some radioactive decay. I’m not mad enough to want to do that though. I’d look for a decent PRNG implemented on AVR (the 8-bit chip they use for Arduino.) It should be easily good enough for synth. The well named ATtiny85 chip has 8 legs and can run on a low voltage source and will spit out randomish numbers until the crack of doom.

6 Likes

What could go wrong?

3 Likes

Ah yes, for sure it would be simpler to use a microcontroller, but where is the fun in that? (“my favorite programming language is solder!”)

5 Likes

That would be better, even, as the radioactive waves would randomly trigger the logic gates of the circuit!

3 Likes

After making this module I found out that David Cockerell and Peter Zinovieff had pretty much done the same thing sometime around 1965. They were generating random voltages for musical purposes using a geiger counter and a glowing radioactive wristwatch!

5 Likes

Yeah, heard the story on your episode of Esoteric Modulation. Great one, BTW!

3 Likes

Just use a laser and a LDR with traffic in-between.

3 Likes

That’s great that you heard that - fantastic!

2 Likes

this is getting pretty hard core ! radiation , laser beams and playing with traffic . wait till we start jumping out of planes and dancing on the rims of volcanoes .

2 Likes

You really want to go giving this crew ideas like that?

4 Likes