30 Day, Random Timer

Thread Starter

Kim Sleep

Joined Nov 6, 2014
398
True randomness is really rather difficult.

One idea would be to have a "random number counter" that represents the 30 day period, clock this counter with a crappy, unstable high frequency oscillator. (with temperature drift, etc)
Use another independent counter to count-off the passage of time, the time counter.

Compare the time counter to a latch, when these are equal- start a 5 second pulse, latch the random number counter into the latch for the next comparison.

If the two time bases are asynchronous, the values should be random enough.

I would use an MCU to do this, with a sketchy RC oscillator and the master crystal time base.
An RC oscillator using high-impedance elements would be nice and noisy.
I have the 30 day counter as a schematic in the question, so I would like an add on to this existing circuit. I am 63 and have no programming skills, as I pre-date the I.C.. I have bought from Amazon a Trainer for Microcontrollers, but I just havnt had the time. Thank you for your response.
 

jiggermole

Joined Jul 29, 2016
185
with what you have, its very deterministic. Doing it analog would be very difficult. You would have to have an erratic input that would have to hold that erratic input or constantly be monitoring it while your counter counts. You have to have some circuitry to monitor the status of your counters to compare meaningfully to determine if you've reached a time to trigger or not. Its doable with analog, its just hard. Its FAR easier with a microcontroller.
I see the drawing very blurrily so I can't say for certain but it looks like what you're using for a counter is serial in parallel out. That makes using the existing circuitry with a microcontroller not too bad. you can parallel the outputs of the shift registers to the microcontroller to read how far along the counter is. Using the psudo-random of the microcontroller you can shift the trigger plus or minus by a few days. Introducing that psudo-random with the existing circuit isn't impossible, but my analog-fu isn't strong enough, I'd have to do some research on how to do it reliably. My initial thinking is to use the outputs of the shift register to cut in or out resistors to make a variable voltage divider tied to a comparator with a noisy reference whose output drives your buzzer and the reset.
 

AnalogKid

Joined Aug 1, 2013
12,128
So the 30-day windows are fixed, and the output is placed randomly within a window? If there is one and only one output allowed within each month, that changes the logic a bit. The output starts at a random time after the start of the month, and whenever it occurs it locks out additional events (and a truly random trigger generator would almost always make more than one trigger per month) for the rest of the month.

If all of that is correct, then this could be done with a clock circuit that delivers one short enable pulse per 30-days, one very low frequency random trigger generator (delay period from 1 second to 29,.999988 days (30 days - 1 second)), and a flipflop to lock out the rest of the month. The flipflop output also triggers a 5-second monostable.

Or something like that.

For the worst possible random case, two trigger events would be almost 2 months apart. Sticking to 1-second boundaries, that is approx. 0.0000058 Hz.

That might be off by a factor of 2, but still - it is an extremely low frequency for a random noise circuit of any topology.

ak
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,128
A source of random clock signals can be the Ed Nisley circuit:
https://circuitcellar.com/research-design-hub/projects/high-speed-random-numbers/
One of the classics. I think you could eliminate the pot and calibration adjustment by running the output noise signal through an integrator, and scaling that DC output to become the "LogicThreshold" voltage. Some audio power amplifier circuits do this, called a "DC servo", to eliminate the input coupling capacitor.

ak
 
Last edited:

Ron314

Joined Mar 14, 2023
21
This gadget reminds me of a method of getting even with an enemy. I can't quite remember the name of the concept but the idea is to annoy your victim to the point of utter frustration since the device that you are describing would cause somebody to flinch every time it triggered and yet if built right would happen at the least expected time, with a short enough pulse as to not be tracible. There was a whole book dedicated to this that was written maybe 30 years ago . . .. . what was it called ???
 
Top