My first signal conditioning project   - Page 1
Forum section: electronics / beginners

author: 1ABengineer
author_rank: Newbie
timestamp: April 10, 2025, 11:53:28 am
content: I watch a video from YoshiMaker called Creating Your Own Quantum Random Number Generator (QRNG)!and was inspired to make my own USB stick that spits out random numbers.To do this, i plan to make a prototype board with the basic circuit and add a couple of sub circuits to improve on it and a microcontroller to do the measuring.The basic circuit is fairly simple; the only problem is that I don't know how to calculate it. See basic circuit attachment. It's a simple circuit with a Zener diode in between two resistors to limit the current flow and a capacitor in parallel.One of the problems is that I don't know the value of the Zener diode in the video. I chose a 2V Zener diode for my circuit.I know how to calculate a voltage divider, and in this case Vout = Vsource *R2 /(R1 + R2) =0.455V to ground, but the Zener diode does not go to ground. And I don't know if current is flowing through my Zener diode and what the output voltage is.My feeling is that the output voltage is going to be 2 volts, but this is based on feelings and not on calculations.So my first question is, how do I calculate the output of this circuit?In the video, the maker gives three ways to improve the circuit.1. Cascade the basic circuit.2. Filter out the DC noise.3. Amplify the output.I know that cascading a circuit means that you attach the input of the second circuit to the output of the first circuit. But in this case I don't know what the input is.I designed a circuit, but I don't know if I got it right. See "cascaded circuit small.png".So the second question is, how do you cascade this circuit, and why does it improve the output signal?The signal coming out of the circuit on the video is around 1V with an amplitude of around 4 millivolts. See "scope shot small.png".And with filtering out DC noise, I think he means filtering out the thick middle part of the signal; see "signal small.png".And to be honest, I don't know how to accomplish this.So my third question is: does anybody know a simple filter circuit to experiment with to filter this out?Amplification.I have never worked with op-amps, and I really want some more experience with them. I read a little bit about the basic op-amp building blocks. And I think that a non-inverting amplifier would do the trick. First amplify the signal and then bring it down in range of my ADC with a voltage divider.questions:Is this the right strategy, amplification and then voltage divider?I have one rail, 5V. I don't think that it is handy to make 2 rails because the usb gives me 5v.How much can you amplify a signal with an op-amp? Is it possible to amplify 5 mV to 500 mV?Is there a good single-rail op-amp to begin experimenting with? (Personally, I like smd)Well, a lot of questions. Let me be clear: I don't want you to make my design for me, but it would be great if somebody could push me in the right direction so I can experiment and learn.Help will be greatly appreciated. greetings Bert

author: SteveThackery
author_rank: Super Contributor
timestamp: April 10, 2025, 01:22:16 pm
content: Calculating the DC voltages is straightforward. You have 5V pushing the current "downwards" through the circuit, and the zener diode develops 2V across it in a direction which opposes this current. So the net voltage pushing current downwards is 5V - 2V =3V.The two resistors are in series, so they have a combined resistance of 10k + 1k =11k. The total current using:I = V/R = 3/11000 =0.000273A, or0.273mA.The voltage drop across the 1k resistor will be:V = I.R = 0.000273 x 1000 =0.273V.The voltage across the 10k resistor will be:V = I.R = 0.000273 x 10000 =2.73V.The DC voltage at the output will be the voltage across the 1k resistor added to the voltage across the zener:0.273V + 2V =2.273V.These low voltage zeners aren't very accurate (the voltage varies quite a lot with current), so if you measure the DC voltage at the output it will probably be slightly different than the value we calculated.EDIT: as a sanity check we can add up the three voltage drops and check that they come to 5V. So:V(10k)+ V(zener)+ V(1k)= 2.73 + 2 + 0.273 =5.003V(That '.003' on the end is a rounding error.)

author: SteveThackery
author_rank: Super Contributor
timestamp: April 10, 2025, 01:43:36 pm
content: Does anyone know why the capacitor is there? It looks like it would filter out most of the generated noise (obviously the higher frequencies more). Is it to make pink noise instead?

author: PGPG
author_rank: Frequent Contributor
timestamp: April 10, 2025, 02:52:14 pm
content: Quote from: SteveThackery on April 10, 2025, 01:43:36 pmI have never done noise generators but using Zener diodes polarized with small current (with working point near the ch-k knee) for that purpose is probably typical.So if you use Zener diode such polarized but don't want noise than adding a capacitor to filter it out looks being rationale.

author: SteveThackery
author_rank: Super Contributor
timestamp: April 10, 2025, 03:33:03 pm
content: Quote from: PGPG on April 10, 2025, 02:52:14 pmThanks, PGPG. But the OPdoeswant the noise from the zener, so again, why the capacitor?

author: PGPG
author_rank: Frequent Contributor
timestamp: April 10, 2025, 06:11:28 pm
content: Quote from: SteveThackery on April 10, 2025, 03:33:03 pmRight. I missed it understanding only "signal conditioning project" in title.

author: MathWizard
author_rank: Super Contributor
timestamp: April 10, 2025, 11:34:54 pm
content: I made an Avalanche Pulse Gen w/ a reverse biased BJT. Now is that also considered a "noise" generator ? (By some definition it must be noise)Is this zener circuit just sitting there w/ a normal DC current, and then you can measure some internal noise, like thermal, shot, burst, 1/f, that sort of thing ?? Or is there some AC signal feed in ?IDK, I'll have to look up noise generator circuits someday. Just another 1 of a million projects I wish I had to time to fool with today.

author: JoeyG
author_rank: Regular Contributor
timestamp: April 11, 2025, 12:23:58 am
content: 32bit I2C random number generatorhttps://ww1.microchip.com/downloads/aemDocuments/documents/SCBU/ProductDocuments/DataSheets/RNG90-CryptoAuthentication-Data-Sheet-DS40002499.pdfTakes all the fun out of analog circuits.

author: 1ABengineer
author_rank: Newbie
timestamp: April 11, 2025, 09:26:58 am
content: SteveThackery thank you, I have never made a calculation with a zener. and you have explained it very well. I didn't use ohm's law and i should have, sorry, i put it al to paper and i think i got it.The video says that the capacitor is there to eliminate the DC noise that could be there.I think he wants to eliminate all the noise except the noise caused by quantum tunneling and entrapment, but i'm not surePGPG. I don't know what the "ch-k knee" is, but I'm gonna do some reading to find out. Thank you.MathWizard. I haven't got a clue, but thanks for replyingJoeyG. Looks like a very nice IC. but for my project I want to do some measurements and signal conditioning, thus not for this project. Thank u for replying.Regarding this project. I scrapped cascading the circuit. I just don't see it with 5V to work with. But I'm still interested in how that is done because I don't see an input to connect to.That leaves filtering and amplification. For amplification, I only need to choose a single rail op-amp. Suggestions for a particular beginner's op-amp are welcome.As for filtering, I don't know. Maybe I will scrap that also or leave it for when I have done some measurements.And I found out that USB with a microchip pic is a totally different beast and is worth a project on its own. So for the prototype board I'm using simple serial. But for the future, I want to put it in a USB stick enclosure. So I have some learning to do.thank you all for replying.greetings Bert

author: PGPG
author_rank: Frequent Contributor
timestamp: April 11, 2025, 02:46:45 pm
content: Quote from: 1ABengineer on April 11, 2025, 09:26:58 amI've just used Polish term translating it (partially wrongly).Polish 'charakterystyka' = English 'characteristic' sounds for me enough the same so I supposed that I need not to think about changing the shortcut.If you look at Zener diode characteristic you see two semi straight lines connected with knee and I have heard that if working point is at this knee the generated noise is the biggest, but I was never using it practically.

author: SteveThackery
author_rank: Super Contributor
timestamp: April 11, 2025, 04:00:19 pm
content: Ah, it seems "DC noise" has a higher frequency content than the quantum noise. Hence the right value of capacitor will filter out the "DC noise" more than the quantum noise.Does the guy in the video make the source code available for download? If so it might be instructive.The thing I'm thinking about most is you wanting a "USB stick that spits out random numbers". The thing is, whatever you plug the USB stick into is going to need an app to receive these random numbers and do something with them. So, if you want to use it with a PC, you'll need to write a Windows program to read the USB stick.Similarly, you will need to squeeze your circuitry and processor inside the USB stick, which is going to be a big challenge. You would probably be better using something like an Arduino or similar microcontroller that has a USB port on it. Then you would connect it to the PC using a USB lead. Very convenient, especially as it will power your circuit as well.If you configure the USB port in your Arduino to work as a serial port, your app on the PC can be very simple. In fact, a simple terminal emulator program would be enough if you just want to see the incoming random numbers on your screen.This project is probably more involved than you were anticipating. From what you have said about your experience, I'd be tempted to park this project for the time being, and start at the beginning, picking up your random number generator later on. The Internet, and especially YouTube, has loads of Arduino tutorials.I always recommend beginners to microcontroller electronics start with Arduino, because it is designed to be easy. Once you've got that under your belt you can move on to ESP32, for example (there are plenty of others).

author: pcprogrammer
author_rank: Super Contributor
timestamp: April 11, 2025, 04:44:35 pm
content: Maybe read up on zener diodes to understand why it generates the noise.https://uk.rs-online.com/web/content/discovery/ideas-and-advice/zener-diodes-guidePGPG is correct with the statement that it is at the turning point of the characteristics that the most noise is generated. The more current one forces through the diode the more stable the output voltage becomes, to the point where the zener diode dies of course.With a zener diode based voltage reference one chooses a point in the voltage/current graph based on expected current draw from the reference. A to low current will make the voltage drop when more current is taken from the circuit.In this noise generation application it is important to set the current a bit low and not load the circuit, so use an opamp buffer before connecting the signal to the input of an ADC.Another way to create even more noise is to reverse bias the zener into it's avalanche breakdown region. This is what MathWizard referred to in their post. In that case a bipolar junction transistor is used. This has been quite common in old drum machines to generate the hiss for the snare drum and the clash of the cymbals.The attached schematic shows a circuit that was used to generate the hiss sound for a snare drum. The BC107 on the left is reverse biased to generate the noise. The opamp amplifies and filters the noise and the BC107 on the right is used to make the envelope of the sound. Kind of like a VCA in a synthesizer.

author: PGPG
author_rank: Frequent Contributor
timestamp: April 11, 2025, 06:37:46 pm
content: Quote from: pcprogrammer on April 11, 2025, 04:44:35 pmZener diode is typically used working revers biased.

author: pcprogrammer
author_rank: Super Contributor
timestamp: April 11, 2025, 07:15:28 pm
content: Quote from: PGPG on April 11, 2025, 06:37:46 pmYeah, that coin dropped after I wrote my post and studied the voltage/current graph a bit closer. It is the bipolar transistor junction that gives a lot of noise when reverse biased. With a zener it basically is a bit of an unwanted side effect.In forward bias it works just as a normal diode, so it is the reverse bias that one wants a zener for.