5 ms·
This circuit is just about the standard one that everyone has used for decades (weirdly biased 2N3904s to make an avalanche diode) I sell OneRNGs (currently ou
by Taniwha 3y ago
This circuit is just about the standard one that everyone has used for decades (weirdly biased 2N3904s to make an avalanche diode)
I sell OneRNGs (currently out of stock more coming soon) that use a version of it, however SMT 2N3904s have been EOL'd, next generation will need to use something different (probably a zener)
- mananaysiempre 3y ago> for decades Well, the earliest quoted article is from 1995 :)
- magicalhippo 3y ago> however SMT 2N3904s have been EOL'd Can't you use the MMBT3904? DigiKey has several active suppliers of that (in SOT-23, as well as other packages).
- Taniwha 3y agoah hadn't noticed those - the big problem with this circuit is that if need to need to be able manufacture something it needs to be reliably repeatable - I've found I need to buy a reel made by a particular manufacturer and tweek the circuit just so.
- magicalhippo 3y agoAh I guess the manufacturing-dependent parasitics plays a role, given the floating base and such. Fortunately they're quite cheap tho :)
- cushychicken 3y agoA roll of 5k MMBTs from a sole source would probably cost you less than $500 if you looked around a bit. Another option: characterize a bunch of different vendors, then selectively populate resistors for proper biasing based on test results from each vendor. What are you tuning? The bias resistor? Edit: wow you can do even better than I thought. You could get 30k MMBTs for $500!! https://www.digikey.com/en/products/detail/diodes-incorporated/MMBT3904-7-F/814494 https://www.digikey.com/en/products/detail/diodes-incorporat...
- Taniwha 3y agoI tune the bias on the output stage (another 2N3094) - the goal is to get ~50% 1/0 when sampling - note that there's a software time domain filter in there as well - we're measuring after that. If you're making small runs buying a reel that doesn't work is a risk, I've already made the decision to switch to using a zener for the next production run
- cushychicken 3y agoDamn, you could have fixed this with a lot less hassle and hardware revision by biasing that output comparator properly with a second resistor to GND in addition to the 3.3V pull-up. Happy to show you what I mean with a quick sch sample if you give me a contact email. My email is the same as my username but at Gmail. Only mention this because: - MMBTs are dirt cheap, - they’re even cheaper when you buy at qty, and your device uses three, whereas you’d only have a single zener and single MMBT otherwise. End of the day, though - your board, your design, your decision.
- Taniwha 3y agoI'm actually switching to a zener for the next rev
- cushychicken 3y agoHear you. Good luck with the next run.
- adrian_b 3y agoAn actual Zener diode is preferable to an avalanche breakdown diode improvised from a bipolar transistor. The Zener diodes are designed so that avalanche breakdown happens in a controlled location, in the bulk of the silicon crystal, so it can be sustained for decades without any changes in behavior. The avalanche breakdown of the emitter junction of most bipolar transistors is not a controlled mode of operation and it happens in some random location, normally at the external surface of the silicon crystal. While a Zener diode is designed so that the avalanche current is spread over a large area, to avoid local overheating, in the bipolar transistor the avalanche current may become concentrated in a very small spot, so that the current density can become very high, despite the fact that the current is limited to a very small value by the external resistor. The small spot where the current is concentrated can become very hot, even up to causing the melting of the crystal. The initial avalanche path may become either insulating or equivalent with a resistor with a very high value in parallel with the junction. Then the avalanche breakdown will move to another spot on the periphery of the emitter junction, and the cycle will repeat. This leads to slow fluctuations in the breakdown voltage of the transistor emitter junction and in the amplitude of the noise during the lifetime of the device, which leads to a time-dependent statistical bias of the random bits. In rare cases, after a long time of use, the reverse-biased emitter junction can become completely resistive, in which case it will still generate thermal noise, but this noise has a lower amplitude than the initial avalanche noise. If the amplifier does not have a gain high enough, the noise may become unable to flip the output gate most of the time, leading to a strong bias in the output. If the hardware random bits are used only as an input to a secure hash function, then the not-ideal properties of the hardware RNG should not influence the output, as long as the bias of the random bits does not become so extreme as to cause a non-negligible probability of identical bit strings occurring as inputs to the hash. Also, the schematic with 74ALS04 is quite dated, as such legacy integrated circuits, which have not been used for many decades in new designs, may be hard to find. If 74ALS04 would be replaced with modern ICs, some changes would be necessary. Reproducing the schematic with equivalent CMOS gates is dangerous, because the CMOS gates biased into the linear mode of operation have a very high power consumption and they may latch-up, short-circuiting the power supply. There are many ICs with multiple fast operational amplifiers in a package, which are better suited and safer for the amplifier stages. Also using a standard CMOS gate at the output would be dangerous. It is much safer to use a Schmitt-trigger gate. Such Schmitt-trigger gates can be found in packages with a single gate that are no bigger than a transistor. If the noise generator would be used with a microcontroller, then the output gate would normally not be needed, because most microcontrollers have Schmitt-trigger inputs on their GPIO pins.