1

I'm trying to make a subsystem that has several outputs. By default, all outputs are 0. When turned on, I want it to randomly set one output to 1, and make it stay at 1 until reset (the reset procedure can be anything, but is preferably a pulse). I'm a bit of a newbie at electronics, but I know all of the basics. Apart from the basic components, I have access to 555s and most of the 4000 series.

Preferably, I would like to avoid the use of a microcontroller.

Bluefire
  • 215
  • 2
  • 8
  • What's the input - a pushbutton or something else? If the former and you don't need something truly random a lot of simple games just use a 555 timer and a 4017 and rely on some randomness from the press length. This might give you some ideas: http://cdselectronics.com/Kits/LED%20Dice.htm – PeterJ Mar 12 '14 at 10:52
  • 2
    How random does this need to be? Random enough for a game, or random enough to derive cryptographic keys? – Polynomial Mar 12 '14 at 11:08
  • @PeterJ My input is going to be an output pulse from another subsystem. That means I can't do the press-push-button-to-trigger-astable-connected-to-a-4017, which is the only thing I can think of :( – Bluefire Mar 12 '14 at 11:24
  • @Polynomial Random enough for a game. Pseudo-random outputs are fine. – Bluefire Mar 12 '14 at 11:27
  • The obvious answer is to use a small microcontroller. You say you want to avoid that, but have given no justification for this seemingly arbitrary and inconvenient restriction. This therefore smells like a religious issue, which doesn't belong here. – Olin Lathrop Mar 12 '14 at 13:21

3 Answers3

2

Four possibilities spring to mind:

  1. Your idea of an astable connected to a 4017, might just work, if you use

    • A trigger pulse of 1000 or more times the period of the astable oscillator (possibly using a 555 monostable to extend the existing trigger pulse)
    • A thermistor, governing either the frequency of the astable oscillation, or the length of the trigger pulse.

    In this case, the tiny random heating/cooling of the thermistor by air currents may be sufficient to produce a random result.

  2. If this doesn't work, a microcontroller is the easiest option (this is probably true even if you have no experience with microcontrollers).

  3. The kind of algorithm that would be implemented inside a microcontroller can be built out of 4000 series logic, but it would not be entirely straightforward. With a handful of shift registers and XOR gates you can build a linear feedback shift register (LFSR), which produces a pseudo-random bitstream. You could demultiplex a few bits of the shift registers to enable one of N outputs (easiest if N is a power of two). You may need to clock the LFSR more than once per output, to avoid strong correlations in the random output.

  4. If you actually need a genuine source of randomness, one low-cost option is to use transistor avalanche breakdown noise to generate a random bitstream, and then use a shift register and demultiplexer again to generate the random one-of-N output.

Chris Johnson
  • 1,170
  • 9
  • 19
1

Make a simple one transistor AM radio or FM radio such as described here (or use the output of a commercial one) and tune it between stations to generate static, your random source. (I assume your location will be fixed, so you can find a reliable spot between local stations.) Feed the output normally going into the speaker into a comparator and set it up so the comparator triggers on the peaks coming from the radio.

When the radio is turned on, start a timer on detecting the first peak. During the time period, count the outputs from the comparator. Use those to feed a counter. When the timer stops, stop counting and use the counter value to select your 1 of N outputs. You will need to experimentally adjust the timer to get the number of peaks averaging half the value of your counter.

tcrosley
  • 48,066
  • 5
  • 98
  • 162
0

I'm not entirely certain how comfortable you are with electronics. Here's something I came across a long time ago when I was trying to do something very similar (I'm not certain how I ended up doing it though, to be honest.)

http://www.ciphersbyritter.com/RES/RNGMACH.HTM

It's in some sense a summary of a series of possible solutions/discussons published in peer reviewed journals between 1955 and 1996. The later ones include crude schematics as well and could possibly be reproduced.

The link has been valid atleast since 2007. In case in the distant future it disappears, the Internet Archive or the Way Back Machine or one of those services probably will have a cached copy.

Chintalagiri Shashank
  • 2,241
  • 18
  • 26
  • You should summarize the relevant portion of that link so that if it changes or disappears, there will be some context remaining on the site. – Adam Lawrence Mar 12 '14 at 15:40