Is Arduino processor fast enough for analogue input from Random event generated by zener diode?

Explain the algorithm by which you will convert "white noise" into a 1 or 0.

which contains audible range of frequency between 20hz to 20,00 hz

Be aware that by definition, "white noise" contains a uniform distribution of frequencies, meaning that signals with all frequencies between 20 Hz and 20 kHz will be present in a sample.

I suppose one way of achieving this is to take a sample at regular intervals, let's say every millisecond and determine if the wave is rising or falling. That will give a stream of bits 0 or 1.

I want to clarify your point.
I use Arduino Uno, and it can handles 115200 bauds (If I remembered correct).
Meaning my Arduino can process 115200 bits per second.
I am not too certain about if this "bauds" can also be read as how frequent it samples input signal, but if thats the case, it can be understood as how fine it samples.

Now, let me consider what you are mentioning about bandwidth.
So depends on what range of bandwidth I am interested in, the processing speed varies?

ah! that is indeed brilliant way to achieve!
So in this case I am sampling the final signal which is a total sum of voltage output in each given intervals!

Thank you very much for your insight!

Thank you for your reply!

I see, the definition of White noise is very specific indeed.
So if my noise source is not covering all of the frequency between 20-20kHz that isn't a white noise.

I will remind myself that and check in my oscilloscope. Thank you very much for your tips!

The algorithm is rather simple.

  1. The first signal is sampled as a start value.
  2. Then sample following signals.
  3. Compare the latest signal with one before.
  4. If the latest signal(input voltage) is higher than the previous signal, return 1, else 0.

With that algorithm, the processor speed does not matter.

Let us know if you are happy with the result.

I will!

Thank you for your messages and support! :smiley:

Perhaps I missed it in the noise, but exactly how are you inputting your signal to the Arduino?

Can you please draw a circuit diagram?

This is just one of many possible rates you can choose for UART serial output data (Serial.print()). That has nothing to do with input data sampling.

Yes this is a faster serial input signal, but this is not the fastest input signal it can process. The input / output of a serial signal can go up to 2000000 bauds.

A simple digital read takes about 4uS. But there are even faster ways of reading a signal, through a process known as "port manipulation".
This is the link:-
https://docs.arduino.cc/retired/hacking/software/PortManipulation/

However, a bit of a warning, using this method is specific to nearly ever model of Arduino. That is you have to use it differently on different processors, which is why, I guess, the link says it is retired.

Using this method you can input a signal in only two clock cycles. Which for a plane old Arduino Uno R3 running at the standard 16 MHz rate works out at 625 nS.

However, a faster sample rate is not the way to go because no matter what speed you go at there will always be faster signals in any noise reading generated.

See this for types of noise that can be produced by semiconductors.
K10147_C011.pdf (953.2 KB)

You can see that this gets complicated and very mathematical. Most semiconductors exhibit several types of noise at the same time. So isolating one type of noise that involves quantum tunneling is, to say the least, tricky. See this link about the tunneling diode.

Here is my prototype of Random event generator.
I am doing this for the first time so just trying to patch everything I found might be important. And it did not work :sweat:

So I decided to find what might be the issue one by one.
To begin with, may be the signal is way too fast for Arduino to capture.
(To make the point of this thread simple, I didn't really mention about the circuit design on this thread.)

But seeing people's response, now I am certain that my circuit design is the issue!

Anyways here is my design and I am using comparator (opAmp) to convert the noise, then feed it to Arduino.

How do you expect the comparator work with the + input connected to 5V?

The LM93 has an open collector output and needs a pullup resistor on the output to function correctly.

Why connect the comparator output to an analogue input on the Arduino, when the output is digital?

This is the result of me cannot decide whether I should use the opAmp to convert signal into digital output or, let Arduino convert signal digitally...

Then I decided to try opAmp comparator approach, because I imagined that the final input signal will be more raw and authentic rather than signal processed by Arduino.

  • -input connected to noise source and + input connected to reference Voltage which I didn't draw but in my physical circuit board, I added voltage control to reduce + input voltage.

The LM386N1 is not an op-amp, it is an audio power amplifier.

You've got a note on the schematic saying 'Gain = R2/R3'
It should be 'Gain = R3/R2'.

Sorry for the confusion! What I meant is LM393M!
Which I wanted to use it for comparator to create digital input!

For LM386N1, like you said I wanted to use it to amplify the signal from the noise source generated from zener diode.

Thank you for pointing this out! I will fix it!

It has already been pointed out that this is neither accurate nor relevant.
The digital read performance of the Uno (actually the ATmega328P microcontroller) is relevant if your external circuit produces a stream of bits.
However, if you are measuring a voltage as your circuit appears to show, then the performance of the microcontroller's analog to digital converter (ADC) becomes relevant. For this you have to look at the data sheet.

A real OP amp is many orders of magnitude slower than the signals you want to read. The chip you actually used is slower still, even when wired correctly.

This makes a mockery of wanting to read a digital signal as fast as possible.

I'm not sure what you expect to see. The noise from the zener might be fast spikes. Try to see it with a scope. That should be the first step.

I suppose you could integrate, but if for too long a time it will average to a constant.

Or, maybe try a comparator, feed it to a digital pin and read it on a clock for 16 bits or whatever. But again, start with a scope to see the distribution in amplitude and time.

Re the circuit:

I would try it in spice.

I filed the attached article image decades ago when (as a hobbyist) I was playing with zener generated white noise. Apologies if it's stuff you're already familiar with. :slightly_smiling_face:

You can do as @6v6gt suggests in #22 and read a stream of random bits.

Then use those bits as input to a process that will produce a random N bit number… not just N of those bits in a row, see

HTH

a7