"Random" Timer

Thread Starter

Kim Sleep

Joined Nov 6, 2014
391
Ok, Im looking for a "random" relay switcher, running off of 5 to 9vdc. (Your Choice, I can accommodate any of these voltages), from 5 seconds to 3o seconds, but I want to be able to adjust the times in case I need a bit of difference.
Now Ive asked this before, but people have been hung up on my term off "Random". Nobody is testing this for accuracy, nobody is using test equipment, this is "Percieved Randomness" by the user. Its for a Toy...so thats the type of randomness that Im talking about.
No, Im not using a microcontroller
Thank you in advance
 

BobTPH

Joined Jun 5, 2013
11,463
You could do it without a microcontroller, but that might require 5 or more chips vs 1, and redesign if you need you need to change anything.
 

WBahn

Joined Mar 31, 2012
32,706
Not sure what you mean by "adjust the times"? Do you mean just set the upper and lower limits (the 5 sec and the 30 sec)? If so, over what range do you need to be able to change them and with what kind of resolution?

Is there a reason that you won't consider a microcontroller-based solution. That would be almost trivial to implement.

How many different "random times" do you think will be enough to get the desired results? The fewer the better, without a micro. Would bouncing around between eight different delays be adequate?
 

Thread Starter

Kim Sleep

Joined Nov 6, 2014
391
By "random" do you mean each delay time should be different from the previous?
What is the "relay" driving?
By "random" do you mean each delay time should be different from the previous?
Yes this is what I mean
What is the "relay" driving?
It is timing out a game, so that is still in design
Thank you
 

Thread Starter

Kim Sleep

Joined Nov 6, 2014
391
Not sure what you mean by "adjust the times"? Do you mean just set the upper and lower limits (the 5 sec and the 30 sec)? If so, over what range do you need to be able to change them and with what kind of resolution?

Is there a reason that you won't consider a microcontroller-based solution. That would be almost trivial to implement.

How many different "random times" do you think will be enough to get the desired results? The fewer the better, without a micro. Would bouncing around between eight different delays be adequate?
Thank you, but I am more interesting in building a circuit
 

Art Vandelay

Joined Nov 1, 2024
140
This circuit changes the duration of each pulse by varying the voltage at the CONT pin with a free running oscillator.

The simulation is showing the 555 monostable circuit being triggered 3 times. The output pulses are: 10.6s, 12.3s and 6.8s.

Instead of including an op-amp triangle wave generator, I simulated a triangle wave ranging between 1-2V.

To get the output to pulse between the hard limits of 5-30s, you'll need to calculate the upper and lower voltage for the triangle wave as well as the RC values for the 555 timer. You can find the formula in the 555 datasheet under Pulse Width Modulation.

Given the complexity with tuning this circuit, I'd go with a microcontroller.

dkr1.png
dkr2.png
 
Last edited:

Ian0

Joined Aug 7, 2020
13,097
First you need a random number generator. You can make one with a shift register and an exclusive-or gate. See the following extract from Horowitz and Hill.
53FACFE9-9CD8-401F-AF35-E3474C2A351B.jpeg
Then use some of the output pins of the shift register to switch in different timing resistors of a 555 circuit.
You can clock the random number generator with the same pulse that triggers the 555 to start timing, then every pulse gives a different time length.
It takes three ICs and some resistors. (Shift register, exor gate and 555).
 

MisterBill2

Joined Jan 23, 2018
27,186
You can use a string of binary counters and some multiple input "AND" gates to produce a rather random series of intervals that will eventually repeat. OR, do you mean truly random??
 

WBahn

Joined Mar 31, 2012
32,706
You can use a string of binary counters and some multiple input "AND" gates to produce a rather random series of intervals that will eventually repeat. OR, do you mean truly random??
The TS indicated that they are only trying to achieve "perceived randomness" in the context of some toy. So I imagine that it can be highly non-random and still be acceptable, but that still leaves open the question of how random is random enough to achieve the perception of randomness. Even children can spot repeating patterns if they are obvious enough -- and the same repeating pattern in one toy might be a lot more obvious than the exact same pattern used in a different toy. For instance, most people will pick up on a non-random audio pattern much more quickly than the same non-random visual pattern of, say, blinking lights. We're very good at pattern recognition, but with sound it is more atuned to temporal patterns, while visually, we are more sensitive to spatial patterns. But since the TS is talking about spacings between 5 s and 30 s, my guess is that as few as eight, or perhaps just four, intervals available might be good enough.
 

Thread Starter

Kim Sleep

Joined Nov 6, 2014
391
The TS indicated that they are only trying to achieve "perceived randomness" in the context of some toy. So I imagine that it can be highly non-random and still be acceptable, but that still leaves open the question of how random is random enough to achieve the perception of randomness. Even children can spot repeating patterns if they are obvious enough -- and the same repeating pattern in one toy might be a lot more obvious than the exact same pattern used in a different toy. For instance, most people will pick up on a non-random audio pattern much more quickly than the same non-random visual pattern of, say, blinking lights. We're very good at pattern recognition, but with sound it is more atuned to temporal patterns, while visually, we are more sensitive to spatial patterns. But since the TS is talking about spacings between 5 s and 30 s, my guess is that as few as eight, or perhaps just four, intervals available might be good enough.
hat is a great idea, thank you!
 

Thread Starter

Kim Sleep

Joined Nov 6, 2014
391
You can use a string of binary counters and some multiple input "AND" gates to produce a rather random series of intervals that will eventually repeat. OR, do you mean truly random??
Well, the discussion of what is "Truly Random " could go on for many many pages, which is why Im settling for "perceived randomness"
 

Thread Starter

Kim Sleep

Joined Nov 6, 2014
391
First you need a random number generator. You can make one with a shift register and an exclusive-or gate. See the following extract from Horowitz and Hill.
View attachment 336986
Then use some of the output pins of the shift register to switch in different timing resistors of a 555 circuit.
You can clock the random number generator with the same pulse that triggers the 555 to start timing, then every pulse gives a different time length.
It takes three ICs and some resistors. (Shift register, exor gate and 555).
Thank you for this info, eventually, I may try this. Thanks
 
Top