Emergency Excuse Generator – PIC 16F690 Microcontroller Based

emergency_excuse_generator_2


If you have a hard time coming up with a good excuse in a split second then you need this PIC 16F690 based Emergency Excuse Generator. Next time the boss calls all you will need to do is give the big red button a press and bingo you will have an instant excuse to recite to your boss. 🙂 Full build details, code and schematics are provided.

I haven’t heard of the random number generation method used here before. I guess the built in pseudo-random PIC random number was not good enough? Maybe the creator can leave a comment to clear that up.

Thanks for the tip Alexander.

“Any time the need arises, you will have an original, freshly-generated excuse ready in seconds. One press of the button can get you out of a tight spot ensuring smooth sailing toward retirement and guaranteeing that you don’t have to perform any actual work.

Most similar projects use the user input (for example, the length of time a button is down) to generate random numbers. The button press time is used this way here too, but this is not enough for the Excuse Generator. One can get just several random bits out of a single button press, and for this project we need a constant flow of random numbers, even with a low degree of randomness. To deal with this problem I came up with the RC circuit connected to RB5. Most of the time RB5 is configured as an output that keeps the capacitor discharged. When a random number is needed RB5 is configured as a high-impedance input. The capacitor starts charging through the 1M resistor, while the microcontroller counts the elapsed time. When the capacitor voltage reaches logical 1 level, the value of the counter is taken as a random number. This works pretty well because the slow charging through the 1M resistor and the exact level at which logical 1 is detected by the microcontroller are quite noisy processes. However, special care must be taken when choosing the capacitor and resistor. I would recommend using a film/foil type capacitor- anything with low leak current. Depending on your capacitor, you may have to use different resistor value. Higher values will mean higher degree of randomness, but slower response time for the Excuse Generator.”


500emergency_excuse_generator

3 Comments


  1. Thank you for featuring the project on HackedGadgets.

    About the unusual random generator circuit:

    I was thinking to implement a nice pseudo-random generator in software, but I never got the chance to do it because… [click]… I had to embalm the CEO’s parakeet, and this takes a lot of time, as you know.

    The other reason is that with only 8K words program memory on the MCU I had to make the program as small as I could in order to leave room for as much excuse data as possible. It was a tight squeeze, and it meant that everything must be in assembly language. AFAIK, there is no built-in pseudo-random functionality that I could use. Please, correct me if I’m wrong. Implementing a pseudo-random number generator in assembly is not difficult, but the code for a decent generator would take precious resources.

    So, I came up with this RC-circuit idea – I was not sure if it is going to work, but it turned out splendidly. It can’t be used when great speed is required but this is not an issue with this project.

    I was also thinking to use the few least significant bytes of the ADC but, if I had done so, the project would be unportable to any MCU that doesn’t have ADC. With the current approach such porting should not be a problem.

    Of course, somebody might have a better idea – if you do, please let me know.



  2. This is cool. I really need this since I am running out of excuses in my old age 🙂
    A while ago, here on hacked gadgets I think, I saw a really neat and very random number generator. He used the CCD from a cheap webcam to which he glued the radioactive element from a smoke alarm. The particles from the decaying element would hit various pixels of the CCD, and wallah, a highly random number generator thats quite simple. The values could be used directly or to seed a random number generator routine.

Comments are closed.