7

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?

Thanks.

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

Chris
  • 617
  • 9
  • 15
  • 2
    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. – Federico Russo May 16 '12 at 05:07
  • @FedericoRusso really? Haha I had never considered that before, thanks for the tip! – Chris May 16 '12 at 05:14
  • 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. – Tony Stewart EE75 May 16 '12 at 05:55
  • @TonyStewart sure, no problem. And ya, possibly, and then I could get a little more functionality, as well. Perhaps a PICAXE? – Chris May 16 '12 at 06:39

5 Answers5

11

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.

Added:

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.

Olin Lathrop
  • 310,974
  • 36
  • 428
  • 915
  • +1. Exactly what I was thinking about, only I was too lazy to type it out. :-) – stevenvh May 16 '12 at 12:25
  • When I saw Olin, I knew it was a PIC :) +1 – clabacchio May 16 '12 at 12:46
  • 1
    @Chris - If you want it small: the 10F200 is available in a 2mm x 3mm DFN package. – stevenvh May 16 '12 at 14:15
  • 1
    @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.. – abdullah kahraman May 16 '12 at 14:42
  • @abdullah - ICSP uses 3 I/O pins you probably want to wire anyway. For a commercial product you would provide 3 pads at the bottom (+ two for power), which you would connect to on a test jig using [spring-loaded test pins](http://www.ladyada.net/make/pogojig/index.html). They're not only useful for programming, but they're extensively used in board testing. – stevenvh May 16 '12 at 14:50
  • 1
    @abdullah - Anyway, he'll need extra components for the potmeter too; the 10F200 doesn't have an ADC on board. – stevenvh May 16 '12 at 14:57
  • @abdullahkahraman: if your board is too small for the programming pins you can also have the controller programmed by your supplier. We do it often for large batches, it's cheaper than doing it ourselves. – Federico Russo May 16 '12 at 15:08
  • Hey there's no patent on my idea either, even if Olin duplicated it, the best answer is the one that suits the asker with tools he can use. Factoid: each chess player has over 4 billion possible combinations of moves in the 1st four entries. ELectronics is more multi-dimensional and even more moves than chess. – Tony Stewart EE75 May 16 '12 at 18:58
  • You could implement this with terminal mode using AT commands and no need for a PIC or any custom hardware.... and a lot faster to realize, flexible, scaleable and free ring tones too ... hmm a PIC was too obvious... – Tony Stewart EE75 May 16 '12 at 19:04
  • @stevenvh ah, why they aren't useful for programming? I've just finished a design of 2600qty the way you say it, with pads. Although I have programmed all of the chips in two days until the PCBs arrived, I didn't test the ICSP pins. – abdullah kahraman May 18 '12 at 04:27
  • @abdullah - I said *not only* useful. They're useful for programming and testing. – stevenvh May 18 '12 at 04:30
  • @stevenvh, oops, sorry :) OK, then, now it will be a pain in the ass to have those pogo pins in Turkey.. – abdullah kahraman May 18 '12 at 04:33
  • The 555 has the pro of being significantly cheaper per unit. If you don't need to do any fancy logic don't splurge for the micro controller. If you need just a little fancy logic, go for a "tiny" format micro controller with a small amount of memory. – awiebe Feb 25 '16 at 02:47
7

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.

stevenvh
  • 145,145
  • 21
  • 455
  • 667
  • 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. – Olin Lathrop May 22 '12 at 12:11
  • 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. – Nick Johnson May 22 '12 at 12:17
  • 2
    @Olin - Bah, you're spoiling my answer! :-) – stevenvh May 22 '12 at 12:37
  • Cool! Thanks for the detailed and entertaining answer, and enjoy your bonus! – Chris May 22 '12 at 23:35
3

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?

Tony Stewart EE75
  • 1
  • 3
  • 54
  • 182
  • 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! – Chris May 16 '12 at 05:00
  • week? should be able to put it together in an hour.. with practise... – Tony Stewart EE75 May 16 '12 at 05:38
  • 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 - http://www.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!! – Chris May 16 '12 at 06:07
  • 1
    "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. – stevenvh May 23 '12 at 07:20
0

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.

Everyone
  • 3,011
  • 8
  • 35
  • 49
  • 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. – stevenvh Sep 19 '12 at 10:09
  • @stevenvh: You're right. I updated the answer to accommodate the caveat. – Everyone Sep 19 '12 at 21:52
-4

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

clabacchio
  • 13,481
  • 4
  • 40
  • 80
Tony Stewart EE75
  • 1
  • 3
  • 54
  • 182
  • 5
    This is interesting as stream-of-conciousness poetry, but its a little bit sparing of explanation to help OP with his question. – The Photon May 16 '12 at 16:39
  • 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. – Tony Stewart EE75 May 16 '12 at 18:59
  • 4
    @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 – clabacchio May 22 '12 at 12:57