I'm constructing a simple circuit that beeps a beeper on a given time interval, using a 555 timer. Is there any simple way to randomize the time on the 555 timer between two given intervals, say, any time between 30 seconds and two minutes? I'm not even looking for true randomization, just something simple to make the interval different between each pulse. Ideally, this would be simple/small enough that I can put two of them in one circuit with a 556 timer - the second one would be sub-second timing to create a different 'beep' every time. Any ideas?


P.S. - bonus if the intervals can be adjusted with a potentiometer?

  • 2
    \$\begingroup\$ Accepting an answer so quickly is discouraging to others who otherwise also would have posted an answer. Now you'll possibly get less replies/ideas. \$\endgroup\$ – Federico Russo May 16 '12 at 5:07
  • \$\begingroup\$ @FedericoRusso really? Haha I had never considered that before, thanks for the tip! \$\endgroup\$ – Chris May 16 '12 at 5:14
  • \$\begingroup\$ I remember my favorite tester I designed to Dial a phone number for testing a DS1 digital network.. It went off-hook, dialed 888.8888 got connected and then hung up,, waited and repeated all week. I did it with just a couple counters and a few gates with Pulse control Dialing. Chris can you unaccept. I'd like to see a simpler solution. Can you bit bang a PIC? The best design is the one using the tools you know how to use. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 May 16 '12 at 5:55
  • \$\begingroup\$ @TonyStewart sure, no problem. And ya, possibly, and then I could get a little more functionality, as well. Perhaps a PICAXE? \$\endgroup\$ – Chris May 16 '12 at 6:39

I agree with Olin: ditch the 555 and get a microcontroller. The PIC10F200 is the first one which comes to mind if you only need a couple of I/Os and a simple program. Thanks to the internal oscillator it doesn't need any of the external components required by the LM555. The 10F200 is only a few cents more than the LM555 and can easily replace two of them. The LM556 is no competition either: it costs twice what you pay for the 10F200.

So Olin's answer is the right one? No :-). I'm going for the bonus! I recently found the Atmel ATTiny5, which is comparable with the PIC10F200: same SOT23 package, same 512 bytes program memory, internal oscillator. BUT! The ATTiny5 has an ADC, which the PIC doesn't have! Connect the potentiometer to it and the bonus is mine! :-)

(You can also make a crude ADC with the PIC, but it needs 2 pins which you can use as outputs, and since we already have two outputs and one I/O of the 10F200 is only input, you'll have to give up that buzzer output. Edit. On second thought, you can do it with one I/O, but you'll need two resistors an a capacitor instead of one resistor and a capacitor.)

The software will be very much the same as for the PIC: program an LFSR (Linear Feedback Shift Register):

enter image description here

An 8-bit LFSR can cycle through up to 255 combinations before it repeats, a 16-bit LFSR through 65535. Use the potentiometer reading to define the clipping values for the timer.

  • \$\begingroup\$ Note that tiny PICs are available with A/Ds too. The PIC 10F22x series is pretty much the 10F20x series with a A/D and a few other minor things added. \$\endgroup\$ – Olin Lathrop May 22 '12 at 12:11
  • \$\begingroup\$ Once you've got an MCU, you can use other sources for randomness, too - for instance, use an unconnected analog pin and sample the LSB on it. Or, set up a transistor race mediated by an MCU pin. \$\endgroup\$ – Nick Johnson May 22 '12 at 12:17
  • 2
    \$\begingroup\$ @Olin - Bah, you're spoiling my answer! :-) \$\endgroup\$ – stevenvh May 22 '12 at 12:37
  • \$\begingroup\$ Cool! Thanks for the detailed and entertaining answer, and enjoy your bonus! \$\endgroup\$ – Chris May 22 '12 at 23:35

You said you want simple and small, but yet you are using a 555 timer. Those two are at odds with each other.

Return the 555 timer to whatever museum you found it in and use a microcontroller. The tiny PIC10F200 can do this job. It comes in a SOT-23 package, and only needs a single bypass cap additional part.

The rest is firmware. This part has a internal oscillator and 255 usable instruction words. That's plenty for a little timing and pseudo-random number code. You can even have it do the multiple outputs at the same time. This part has six pins: power, ground, one input and three I/O. You can therefore have it produce up to 3 separate events directly from its pins.


Apparently there is some desire to control the average interval length with a pot. If that is what you want, you can use a PIC 10F220 instead of the 10F200. That PIC has a 8 bit A/D and only costs a little more than the '200 (still only $.38 in 100s at microchipdirect). Again, the only other part you need aside from the microcontroller is a bypass cap. The pot can be around 20 kΩ or 47 kΩ. The ends are connected to Vdd and ground, and the wiper to one of the two analog input pins. The rest is firmware.

  • \$\begingroup\$ +1. Exactly what I was thinking about, only I was too lazy to type it out. :-) \$\endgroup\$ – stevenvh May 16 '12 at 12:25
  • \$\begingroup\$ When I saw Olin, I knew it was a PIC :) +1 \$\endgroup\$ – clabacchio May 16 '12 at 12:46
  • 1
    \$\begingroup\$ @Chris - If you want it small: the 10F200 is available in a 2mm x 3mm DFN package. \$\endgroup\$ – stevenvh May 16 '12 at 14:15
  • 1
    \$\begingroup\$ @stevenvh What about programming an SMD microcontroller? You should consider extra ICSP stuff in the footprint, right? I don't think OP cares if it is small, he is mentioning a pot for adjusting it and considers it as a bonus.. \$\endgroup\$ – abdullah kahraman May 16 '12 at 14:42
  • 1
    \$\begingroup\$ @abdullah - Anyway, he'll need extra components for the potmeter too; the 10F200 doesn't have an ADC on board. \$\endgroup\$ – stevenvh May 16 '12 at 14:57

Sure that's trivial. Just get a shift register, quad XOR gate and a pot on the 555 or use a Schmitt inverter to do the same (Relaxation Osc) and driver a binary counter to get the minimum period of 1 minute. Use another inverter to make a different tone. Use an RC delay one of an XOR gate and you got a one shot for each transition. Gate that with your tone or use another Schmitt inverter to make another fixed f tone, or use the same tone so when you change intervals with the pot the tone changes pitch too.

Look up PRSG, PRNG, LFSR or RNG or... ....all you need is an 8 stage random sequence generator. There are longer polynomials you can use simply too. If you use an inverter in the feedback, all zeros or a reset can be used as the starting seed. Or you can load a random seed another way.... But all 1's is illegal. This will make sense after you see the classic design . ( I used it in 1976 )

On 2nd thought , you only want a 4:1 ratio from .5 to 2min and this would create an 8:1 ratio . THat's not too hard to fix... using a fixed time delay of 30 seconds and a higher polynomial PRNG for better resolution then use a flip flop or 2 gates to set after 30 seconds and reset after 2 minutes. Now go run that in VHDL and put it into one simple CPLD chip. Next?

  • \$\begingroup\$ Awesome, thanks for the great answer! I was looking for a basic project to keep my busy for the next week or two, this looks perfect, thanks! \$\endgroup\$ – Chris May 16 '12 at 5:00
  • \$\begingroup\$ week? should be able to put it together in an hour.. with practise... \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 May 16 '12 at 5:38
  • \$\begingroup\$ haha true, I'm good with a soldering iron but not so much with making my own schematics. On that note - Am I right in saying I need 3 IC's - a 4015 shift register, a 4070 XOR and a 555 timer source? Also, I found this schematic - doctronics.co.uk/4015.htm#applications, could you possibly tell me if that business with the 4093 is replaceable with a 555? Thanks so much for the help, you've really gotten me thinking!! \$\endgroup\$ – Chris May 16 '12 at 6:07
  • 1
    \$\begingroup\$ "Look up PRSG, [...]". That's not the way. Answers should stand by them selfselves. If you think PRSG is interesting, explain it here, even if only briefly. \$\endgroup\$ – stevenvh May 23 '12 at 7:20

I assume the 555 is used in monostable configuration.

The interval is determined by the RC, and C is fixed. R may be varied; for instance by using a LDR, or a thermistor. Thus the RC constant would probably change too.

There is, ofcourse, the caveat that such a variable resistor/driver would need to be exposed to the right environment for it's resistance to vary.

Hope this helps.

  • \$\begingroup\$ LDRs and thermistors are variable resistors, but they won't vary by themselves. If light level and temperature are constant you won't see much change in the intervals. \$\endgroup\$ – stevenvh Sep 19 '12 at 10:09
  • \$\begingroup\$ @stevenvh: You're right. I updated the answer to accommodate the caveat. \$\endgroup\$ – Everyone Sep 19 '12 at 21:52

555's are so old school... YOu can make 6 oscillators with a HEx Schmitter inverter or use Schmitt NAND.

Then use both inputs of XOR with RC delay in one to make a one shot frequency doubler.

Actually this is all old school and use a shift register not D FF. and binary ripple counter to scale clock down.

Just use a breadboard.

enter image description here

  • 5
    \$\begingroup\$ This is interesting as stream-of-conciousness poetry, but its a little bit sparing of explanation to help OP with his question. \$\endgroup\$ – The Photon May 16 '12 at 16:39
  • \$\begingroup\$ Feynman said it is better to not know and wonder the full answer than to know the full answer and not know it is wrong. If you vote for cook book answers rather than suggestive directions, you don't teach how to think, rather just regurgitate data. If you understand his 1st replies, yu catch my drift. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 May 16 '12 at 18:59
  • 4
    \$\begingroup\$ @TonyStewart actually this is a Q&A site, where the A stands for "Answer", not "Argue" :) It's not all about the OP, you should leave valuable content for all the readers \$\endgroup\$ – clabacchio May 22 '12 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.