The analog portion of this circuit that actually generates the randomness came from Cryogenius. Gyro has a number of random number generator designs of his own there as well. Here's the recipe. Click on them to open larger and in a new tabs or windows.
A few things to note:
- First and foremost, you will need to program a PIC. How or where you do this is entirely up to you - I will only provide the code you burn to it. (See file download at the bottom of this page)
- This circuit puts a fair amount of stress on the transistor being reverse-biased. (Q1) It's a good idea to solder a socket onto the board itself and then seat the transistor into it - this way, when/if you burn it out, it can be easily replaced.
- The higher the voltage you give this circuit, the more the analog portion will fluctuate or "hiss". The maximum voltage depends on the components that you use. In my implementation, for example, this limit is set at the 7805's 30V max so I'm actually using a 25V source instead of the 12V listed here. Make sure you have plenty of heat dissipation if you're going to push it like this.
- If you plan to deviate from the 12V input listed, you might get better results by placing a 0.1uF cap between the analog and digital portions of the circuits. (pin 7 on the PIC)
- Even at 12V the 7805 gets quite hot. You may want to attach it to a heat sink - especially if you plan to go anywhere near its voltage limit.
Result The port runs at 9600-N81 and is currently write-only. I have designed the circuit board to handle an incoming data feed on pin 5, though, so future PIC code may implement this. Rather than a traditional heat sink, I used an aluminum case and then attached the heatsink on the 7805 directly to it. (The pic above doesn't show this as it was taken before I attached them) The case warms up enough to be noticeable but not so much that I can't hold onto it and it looks so much better this way.
Disclaimer: I'm a computer scientist - not an electrical engineer. This basically means that I know a lot about programming, a fair bit about digital logic, and very little about analog circuitry. This does work and is feeding entropy into my systems right now; however, it is a distinct possibility that it could be tuned to work better. If this is something that you're comfortable doing and would like to suggest changes, please feel free to send them to me.