Shop OBEX P1 Docs P2 Docs Learn Events
Hardware Random Number Generator — Parallax Forums

Hardware Random Number Generator

TechnoRobboTechnoRobbo Posts: 323
edited 2007-09-14 10:23 in Robotics
No not a Psuedo-Random but a real random number generator.·The circuit was·based on these 2 links.
http://www.capgo.com/Resources/Temperature/Semiconductor/Semi.html
Which talks about using diodes as a temp sensor and
http://www.maxim-ic.com/appnotes.cfm/an_pk/3922
Which talks about using temp sensors as random number generators

I was experimenting with regular diodes then I decided to try LED's and see what happens. The results were off the chart. I used a Red LED under 1.7v forward voltage then I tried the ifrared since they are made of the same material. I am using the infrared to make it easier to identify the proper LED.

Since the results are so different from the regular diodes I am not sure of the exact mechanism that makes it function. I am leaving it up to all of you out there to peer review it and theorize.

Here's the circuit:
·attachment.php?attachmentid=49277
Here's the program:
' {$STAMP BS2}
' {$PBASIC 2.5}
Rand16············ VAR···· Word
result············ VAR···· Word
CAP··············· CON···· 12
x················· VAR···· Byte
LOW cap
Main:
DO
· GOSUB Get_Rnd
· DEBUG DEC Rand16,CR
LOOP
'subroutines
Get_Rnd:
FOR x = 0 TO 3·························· '4 Nibbles for max randomness
··· HIGH cap
··· PAUSE 1····························· '·· for 1 ms
··· RCTIME cap, 1, result··············· ' measure RC discharge time
··· Rand16.LOWNIB(x)=result.LOWNIB
NEXT
RETURN
END
·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun


TR

Post Edited (TechnoRobbo) : 9/13/2007 1:20:00 AM GMT

Comments

  • pwillardpwillard Posts: 321
    edited 2007-09-13 18:59
    LED's in certain conditions can actually exhibit some ambient light *sensing* ability, so you may be improving the randomness of the noise due to it's reaction to slightly·changing light levels.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-09-14 10:23
    pwillard,

    I had done experiments by covering the LED to eliminate outside stimuli,but since it generated small flickers of light, I never ruled out that theory.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
Sign In or Register to comment.