Digit pendant

November 2021

Following my experiments on the Cyberdemon choker, a friend asked if I'd be able to make them a piece of electronic jewelry that shows a random number 0-9. That sounded doable... let's figure it out!

Question #1: How can I generate random numbers?

Sure, you could do this with a microcontroller and some code... but I had recently taken a creative electronics class with Dogbotic, where we built synthesizers out of digital logic chips like the 4093 quad NAND integrated circuit. A 4093 can be repurposed to make four square wave oscillators when configured like this:

I had played with seven-segment driver chips that could turn a binary number into signals that would light up the appropriate segments, and I figured that I could use those four NAND oscillators as individual bits of a number ranging from 0-16. And if the frequencies of the oscillators were tuned so that they were all slightly out of sync, maybe the resulting number would look random enough.

Question #2: What frequency should the oscillators run at?

...

Question #3: How bright should it be?

I'm making a pendant that displays random digits on a seven-segment display, and I have to pick a resistor value to set the brightness of the LEDs, which also influences the battery life. I want to make the pendant as bright as possible (the lowest resistance possible) while keeping the battery life over 6 hours or so.

The charts below show what the battery life will be with the selected battery size and LED resistance. The line / dot plot shows the relationship between resistance and current consumed, with the selected value shown in blue, the "predicted" value curve (straight from a formula), and six experimental measurements I took on the circuit prototype for reference. The red line indicates a resistance that makes the lights too dim to be useful.

For this project, I needed to use a 100 milliamp-hour battery, but I could vary the resistance to restrict the current flowing through the LEDs and thus prolong the battery life.

Controls