We’ll take the fries.

fjdkalfjdklajfdaflj

We’ve all been there; hardest decision we’ve ever had to make. College and debt or freedom but no career? Start a family or live out alone? The number 2 with a small shake or side of fries?!

[Leon] sent in his random number generator, oddly enough not to just generate a number, but help us through with those life altering decisions. Using a noise diode like setup he’s able to generate random bits, which an ATtiny24 then converts and displays on a 7 segment LED. His generator also has the ability to set upper and lower limits. Seems like an awful lot of work to avoid the freedom of choice paradox, but we enjoyed the project none the less. Check out a video after the break.

Comments

  1. Magnavoid says:

    Interesting… Very Interesting.

  2. protozo says:

    ah finally the oddity i have been looking for =P

  3. Skitchin says:

    Bah, got my hopes up with the intro, was hoping there was finally a hack for that college/no career bs.

  4. smilr says:

    I’m actually more intrigued by the form factor than the circuit itself. (both are cool imo)

    I haven’t run across any hacks utilizing custom keyfobs before. I looked over his part list and see the fob is a part available from digikey. I hadn’t realized they carried such things :)

    Now I’ve got ideas running through my head for home / car automation ran from these sort of things.

  5. Tuckie says:

    It reminds me of the book, The Traveler (some characters used a random number generator to keep decisions truly random)

  6. Zake says:

    coin toss v2.0 :P
    great!

  7. VIPER! says:

    And for those who just cant make a decision on there own there’s this complex device.

    Or you could just carry around a coin/dice or my favorite the Magic 8 Ball = )

  8. nave.notnilc says:

    it’s good to see some proper randomness in a small project :)

  9. Leon says:

    @smilr

    I was surprised to find how many different key fobs are easily available — just google “key fob enclosure”. Some, manufactures will even sell any quantity directly (polycase) or give you some samples. That Serpac case fit my requirements (2 buttons, room for a display, location of buttons, overall size), but it might not fit yours, so look around to find a best match (or just make a random choice…)

  10. Franklyn says:

    Instead of trying to force a digital bit and then forming the number in software wouldn’t it be just easier to use and ADC and read out the voltage ?.

  11. Leon says:

    @Franklyn

    I looked in to it but decided that wasn’t the way to go. I’d probably need the op-amp for amplification anyway — the signal right out of the transistor is only a couple mV, and the maximum resolution of the 10 bit ADC would be 3/2^10~=3mV (assuming that the ADC is really that good).

    Since the op-amp chip had two op-amps on it, using the second one to make the signal digital seemed like the way to go.

    Moreover, even if I did use the ADC directly, I’d still need to do work in software to take in the one or two useful bits per reading, debias them, make sure the number is in the right range, etc.

    If there’s a version two, I may well look in to a controller with a better ADC for this purpose, since getting rid of the op-amp would keep the part count down (although I seem to recall that AVRs with 10 bit ADCs were my only options due to size constraints… although I might be misremembering.)

  12. Franklyn says:

    Thanks for clearing that up. I actually found the design quite interesting it’s definitely not something i’d think up on my own. Thanks for posting the writeup.

  13. Roly says:

    Nice little project, well written up. The bound setting is a nice embelshment. Hat tip to Leon {and thanks for the Pad2Pad link}.

    I’ve actually done a fair bit with practical randomisation problems, so if anyone is inspired by this hack, a few protips;

    * A pseudo-random number (PRN) generator, such as the CRC16 polynomial, either based in hard or software, isn’t *actually* random. It’s simply a count in an odd order, but *repeating*, and the first and second half of the count are mirror-images offset by one.

    For most applications a PRN is quite random enough, but in some applications a basic rule asserts itself, a digital computer cannot *alone* produce a truly random (“Stochastic”) number (i.e. where the next state cannot be determined from the current state).
    {Windoze is an exception}

    In fact it is exactly this predictability in PRN generators that is exploited in Spread Spectrum radio techniques to get the receiver PRN to slide into lock with the transmitter PRN.

    * A flicked coin toss is not truly random unless the coin is flicked strongly enough to make it rise at least a foot (30cm), it *rings* {and you quickly get a sore thumb}.

    * A simple but very effective way of generating a truly random number is to put a human in the loop. We ended up running an overflowing s/w counter flat out while waiting for button presses, rediscovering the old Apple-II trick. You could build a simple decision-maker just using a 4060 running fast, but here the microcontroller is justified by the hex range, and ease of bound setting {I really like the human>pot>micro}.

    * Multiplying random numbers together does not make them more random.

    It’s a very inviting idea that if you have a random number routine, the more often you call it, the more random it will be. Sounds logical.

    But it isn’t so.

    a) If you are using a PRN and you call it repeatedly it becomes *LESS* random, rather like the moir√© effect with “watered silk”, due to self-correlation. (One odd outcome of this was a routine that never once produced the two of clubs over 30,000 deals)

    b) With stochastic noise sources (mostly analogue) multiple readings make no difference at all, the first reading of the noise diode voltage is as random as any other.

    A variation of (a) is to get a random number, then get random numbers that number of times (rand x rand), grabbing the last. As above.

    But In Real Life tossing a coin, rattling dice, or shuffling cards, it is surprising how much tossing, rattling, or shuffling is required to *actually* (not just apparently) randomise the process. {Solitaire on W95 plays quite differently to a real deck and I am very sus of their dealing routine}

    HTHH :)

  14. luigi517 says:

    awe, I was hoping this hack actually involved french fries. :(

  15. Kit says:

    We should all make one to evade our Tabula Rasa overloads through unpredictable action.

  16. markii says:

    This would be great for Mr. Monk :-)

  17. jimmys says:

    leon-
    You mentioned that you moved away from the PIC line because there was no free C compiler for linux and OSX. The PIC16F support looks recent but you may be interested in SDCC – sdcc.sourceforge.net .

  18. lexi says:

    Or you could study in a country where a degree doesn’t cost you an arm and a leg. I payed $10k for four years of full time studies :)

  19. Hackius says:

    I got a scholarship for all my studies :)
    Didn’t pay a cent and now I’m debt free.

  20. Taehl says:

    Aha! This is just the thing for me! Up until now, I had always used the clock trick for making random decisions (and wear an analogue watch just for this reason).

  21. babble says:

    I just masturbate all day, it saves needing to make decisions, nor do I need to fool myself into thinking I am being random.

  22. M4CGYV3R says:

    Lol, keychain random number generator is random.

  23. Louis II says:

    …I swear this intro was used an an article just a week and a half a go… maybe 2.

  24. DeathsPal says:

    I can see it now. 2 D&D geeks are standing on a sidewalk some ware, one says something worthy of being flogged, the other reaches into his pocked dials up a key-chain to 6 (representing d6x1) and says “Roll you charisma!”

  25. Leon says:

    @jimmys

    That’s good to know. I made the PIC/AVR decision some time ago. I seem to recall the PIC compiler existed, but was at an early stage.

  26. Killerabbit says:

    @lexi
    You spent $10k and didn’t even learn how to spell “paid?”

  27. Jikki says:

    @ Killerabbit

    Perhaps it’s not an english speaking country lexi’s talking about. And what does it matter anyway?

  28. GenesisOfMoY says:

    fjdkalfjdklajfdaflj
    Lazy? Funny? or just Random, heh heh

  29. Jonas says:

    Useful for new age dice living :)

    If you havent read it read “The dice man” from 1971 by Luke Rhinehart (George Cockcroft) it’s awesome!

  30. mic says:

    Looks well done but not all that useful. A portable stick on combo lock cracker… leave it there see what happens.

  31. Wwhat says:

    People complain they need to pay for studying but meanwhile once they have a degree they are assured a high income forever basically, get over yourself eh, you can only complain if you were actually prevented by the cost, not if you could make it but just don’t like to pay.

  32. Tod says:

    Now the hard question… Do I use the generator or not? Got a hack for that?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 93,810 other followers