Pages: [1]   Go Down
Author Topic: Seeding the random number generator with a reverse biased diode?  (Read 1317 times)
0 Members and 1 Guest are viewing this topic.
Italy
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I need to have a random seed which is different every time I turn on the Arduino.

I remember reading many moons ago that the voltage across a reverse biased diode is a good source of white noise. For my purposes I'd guess that I could use the bottom two bits (several times) of a byte read of the voltage to form a new random seed.

I imagine a resistor from Vcc to a diode connected to 0v. The arduino would read the voltage across the diode.

Has anybody already done this? And did it work?

My machine will not have access to the internet, so it will not be able to lookup random numbers anywhere.

Logged

Owen F. Ransen

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there any user inter-action in your sketch?
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Yorkshire England
Offline Offline
Sr. Member
****
Karma: 2
Posts: 267
Arduino good init
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I wondered a while ago whether this could be used with the arduino somehow i never really looked into it but i can see i few ideas in it.

http://www.psyleron.com/

i thought of contacting them and seeing if they had some kind of shield for the adruino.
Logged

Italy
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there any user inter-action in your sketch?

No smiley-sad
Logged

Owen F. Ransen

Italy
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I wondered a while ago whether this could be used with the arduino somehow i never really looked into it but i can see i few ideas in it.

http://www.psyleron.com/

i thought of contacting them and seeing if they had some kind of shield for the adruino.

Errr....and how does that help me?

I must have missed something...

Logged

Owen F. Ransen

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2568
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are a lot of published noise generator using base-emitter reverse biased junction of the transistor.
It only works with voltage 7-12 V for common low signal transistors, you can't connect it directly to analog input, but voltage divider or cap/resistor would solve a problem.
Logged

Ontario
Offline Offline
God Member
*****
Karma: 24
Posts: 862
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My favourite low-parts-count RNG is a three-component free running 555 oscillator like this:
http://www.eleccircuit.com/alternate-555-oscillator/
you then hook pin 6 of the 555 into an analogue input and read that.  Pin 6 taps into the timer's analogue R/C circuit, so you are reading the charge on the timing capacitor, which is always changing, and changing in a pattern that is not linked to the Arduino clock.

If you have at least 12 volts available, you can use a reverse biased B-E junction circuit to generate noise, but in my applications, I only have 5V and building a boost converter takes more parts than the 555 oscillator way.
Logged

Italy
Offline Offline
Full Member
***
Karma: 0
Posts: 127
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks all for the suggestions (except for the "mental manipulation of random numbers via quantum telepathy" one, and even that one made me smiley  .)

I've just posted in this group a quick and dirty solution which is adequate for my needs and requires no extra hardware.
Logged

Owen F. Ransen

Pages: [1]   Go Up
Jump to: