Make a strobe which automatically varies between 8-20 Hz with a 555 chip? - Page 1
Forum section: electronics / beginners

author: seanspotatobusiness
author_rank: Regular Contributor
timestamp: February 02, 2019, 11:50:32 pm
content: I would like to make a strobe which varies automatically in frequency between 8-20 Hz. Is that something I could do with a 555 chip or would it need to be something more complicated? I need it to ramp up and down in frequency automatically so I can't adjust it with a potentiometer or something.

author: soldar
author_rank: Super Contributor
timestamp: February 02, 2019, 11:55:17 pm
content: Yes, this can easily be done with a couple 555 timers. Basically it is the same as the "police siren" where one timer generates a ramp which controls the frequency of the second timer.

author: seanspotatobusiness
author_rank: Regular Contributor
timestamp: February 04, 2019, 12:59:22 am
content: Thanks very much! After copying the most common versions I found lying around the 'net, I've got the following. I'm having trouble trying to determine what values to use to achieve the desired outcome. I guess most people don't care what specific frequencies their sirens sound but I'm quite particular in needing 8-20 Hz. There are calculators for single-chip circuits but I'm not sure whether they apply; also I'm trying to work backwards from a particular frequency range and duty cycle (50%) whereas they ask me to specify the resistor and capacitor values. I'd like to go from 8 Hz to 20 Hz over the course of 15 seconds and then go back to 8 Hz ad infinitum.

author: seanspotatobusiness
author_rank: Regular Contributor
timestamp: February 04, 2019, 02:25:20 pm
content: Am I right in thinking it isn't actually possible to make a device this way which moves between 8 and 20 Hz over a period of about 15 seconds? It seems like the modulation of the second 555 chip by the first chip is inextricably correlated to the frequency of the first chip so 8-20 Hz output and 15 seconds period are just not compatible?

author: Buriedcode
author_rank: Super Contributor
timestamp: February 04, 2019, 03:21:02 pm
content: Your schematic, the right 555 would generate a frequency of ~ 2kHz, with the left @30Hz. So the right 555 would switch between two frequencies at 30Hz, because the output is either high or low - it won't slowly move between the two frequencies. Also you don't need C4, it should be a low value resistor, say 100R. The reason is, often circuits with two 555's are generating a "siren" which drives a speaker - this requires a large value cap on the output to drive the speaker, but you're driving a MOSFET which is driving an LED.And.. you're using a P channel MOSFET, on the high side, wired backwards. I would use a N channel MOSFET, on the low side (source to GND, drain to LED cathode) or an NPN bipolar transistor. I can provide a schematic if you don't know what I'm talking about.Two things:1) although you have explained your requirements quite succinctly, am I correct in saying you wish for the 8Hz strobe to slowly increase in frequency to 20Hz over the course of 15 seconds, thenramp down again over another 15 seconds? Or do you want to immediately go back to 8Hz again? The difference is, the first requires atriangle wave, that reaches its peak in 15 seconds, then back to its low in 15 seconds, and the latter requires asawtooth wave. A sawtooth can be generated with a 555 and an extra transistor, but I am unsure if one can create a triangle wave with it. THere are opamp and comparator circuits that can do this.2) Do you have access to simulation software? I believe LTspice is free, and includes an NE555 timer model. Its fairly accurate and you can play around with it, trying different ideas and values to see what kind of output you get.You are correct in saying that its quite difficult to obtain a specific frequency when you're changing the voltage on the "CV" pin of the 555, as this changes the thresholds of the internal comparators, and so, changes the conditions - this means that the equations we use for the 555 are no longer valid. This is why I suggested using LTspice.You don't have to use 555's. There are comparator and opamp circuits that can produce triangle or sawtooth waves, as well as square-wave oscillators. You may even requires a combination of the two, but its certainly "doable".

author: seanspotatobusiness
author_rank: Regular Contributor
timestamp: February 04, 2019, 04:51:29 pm
content: Thanks very much for your detailed response!I actually wouldn't mind whether the solution ends up as a triangle wave or sawtooth; either of those would be acceptable to me so long as it's moving between those frequencies.I'm downloading LTspice now and have updated my schematic with slightly better component choices and diodes across pins 7 and 6 which I think give me a 50% duty cycle. I will try to model it in LTspice. Do you think the opamp/comparitor approach would be easier? Thanks again for your help.

author: Buriedcode
author_rank: Super Contributor
timestamp: February 04, 2019, 09:36:17 pm
content: Quote from: seanspotatobusiness on February 04, 2019, 04:51:29 pmAfter googling some "police siren 555" circuits, it looks like they use a pseudo-triangle wave: If you knock up a simple astable 555 circuit in LTspice, and look at the voltage on the capacitor (connected to "trigger" and "threshold", pins 2 and 6) you'll see the cap charging and discharging between 1/3 and 2/3 VCC. For 12V thats between 4V and 8V. It's nto a perfect triangle wave, but it does ramp up and down fairly smoothly.Quote from: seanspotatobusiness on February 04, 2019, 04:51:29 pmI think for now, two 555's *should* be enough, its just a question of playing around with part values, to get the parameters you're after. NE555's (or the many other versions of the device) are old, cheap, widely available and surprisingly versatile. They're not great at certain things, but for this application I think it'll be hard to find something that requires less parts, or is easier to work with. On the other hand, comparators are also cheap, and available in packages with 2 or 4 of them, which allows one to make "building block" circuits quite cheaply. If you/we struggle getting 555's to do what you want, I'll try and knock up some comparator circuits.LTspice, like many other simulators does have limitations, and occasionally produces bizarre results - like 5kA (thats kiloamps) peaks because most components are "ideal". But it can be invaluable for situations like this where you just want to try out idea's and fiddle with values to see what happens.I'm not sure if that imgur link is your latest schematic. If it is you still have that MOSFET the wrong way aroundand on the high side. See this link for the difference between using N channel and P channel:

author: soldar
author_rank: Super Contributor
timestamp: February 04, 2019, 09:59:07 pm
content: Quote from: Buriedcode on February 04, 2019, 09:36:17 pmYes, it is not straight but curved exponential. Still, it is easy to make it exactly a straight ramp by charging the capacitor through a constant current supply instead of a plain resistor.

author: seanspotatobusiness
author_rank: Regular Contributor
timestamp: February 06, 2019, 10:50:22 pm
content: LTSpice wouldn't launch on my own PC but it's running okay on my mum's laptop. Here's a link to the circuit on my OneDrive:https://1drv.ms/u/s!Avvwzet1PgNTgqV9UEgr8HoTQ46H6gThe frequency is too high at the moment. Also it seems that the circuit switches between two frequencies without a smooth transition between either. I was hoping to get the frequencies between 8 and 20 Hz as well as 8 and 20 Hz themselves. I'll play around with the component specifications and post again if I manage to get anywhere near my goal.

author: soldar
author_rank: Super Contributor
timestamp: February 06, 2019, 10:58:18 pm
content: The second 555 timer is jumping between two frequencies because you are inputting the square output of the first timer. If you want a continuous variation you should input a sawtooth which you can get from the timing capacitor.Can you post the asc file? Maybe we can play with it.

author: seanspotatobusiness
author_rank: Regular Contributor
timestamp: February 06, 2019, 11:05:31 pm
content: I tried to link to it via my OneDrive but now I've attached it to this post as well/instead. Changing C3 to 100 nF reduced the frequency to something I was expecting although it still switches instantly between frequencies in this simulation.Edit: when I used C2 for the sawtooth, I had to use a diode to stop it from getting stuck at a full charge. Although the sawtooth is happening, the frequency from U2 appears to be fixed (right windows):

author: soldar
author_rank: Super Contributor
timestamp: February 06, 2019, 11:34:21 pm
content: It's late for me and I need to go but I made some changes which should get you closer. The signal going from the first to the second timer is a sawtooth now. See if you can advance some more.

author: Buriedcode
author_rank: Super Contributor
timestamp: February 06, 2019, 11:46:45 pm
content: Quote from: seanspotatobusiness on February 06, 2019, 10:50:22 pmThe reason is, you're using the output of the first 555 to control the thresholds of the second 555, and the 555's output is essentially a square wave - either VCC, or 0V. So the second 555 is being controlled by the first, and is just switching between two frequencies, one where CV is high, and one where CV is low.In order to generate a "smooth" transition you would need to create a sawtooth wave - that slowly ramps up and down between two voltages rather than very quickly switch between VCC and GND. This is why I mentioned using comparators or opamps, but you can generate a sawtooth wave with the 555 - check the voltage on the "trig" or"thres" pin - you'll see a sawtooth wave between 1/3VCC and 2/3VCC (in your case, powering it with 15V it'll be between 5V and 10V).The trouble with connecting this to the CV pin is it isn't a low impedance source - that is to say, the OUT pin of a 555 can source and sink quite a bit of current - it just connects to VCC or GND via transistors, and can supply >100mA. But the voltage node on the trig/thres pins is the capacitor voltage charging and discharging through R1 and R2. So if that was to be used, it would need a buffer - an amplifier with a gain of 1, so the output is the same as the input, but.. it can provide some current, and prevents the input voltage being pulled off.The problem is, putting a signal on the CV can only change the frequency so much. 8 to 20Hz is a 2.5x range. A bit of experimentation shows the following attach LTspice circuit:With the values shown, CV = 2V gives ~ 20Hz, and a CV = 10V gives ~8.2Hz. So we need to generate a sawtooth wave that varies between those two voltages. I don't think the 555 can't do this. So you can either try and generate the wave some other way - comparators, opamps etc.., or use something other than the 555 to generate the pulse train, some kind of voltage controlled oscillator, so that the required sawtooth wave voltage is different. There are a number of ways to do this.

author: Buriedcode
author_rank: Super Contributor
timestamp: February 07, 2019, 12:18:26 am
content: Best I can do. First 555 creates a (nonlinear) ramp over about 9 seconds. If you wish to increase this you could increase R2 and R8 or C1. Because this voltage is needed to drive the CV pin of the next 555, it needs to be buffered, so a cheap LM358 as a voltage follower will do. As the voltage is between ~1.6 and ~10V, you could use almost any opamp as most have a common mode input within that range.The other 555 just generates between ~9Hz and ~20Hz and sweeps between the two. That isn't 8Hz but its close. As you can buy two 555's in the same package - the NE556, its a two chip solution.Notice the clever trick on the first 555 - the output is fed into the CV pin to change its internal thresholds, this gives a much wider range for upper and lower thresholds. Please don't assume this will work on a breadboard - the model of the NE555 in LTspice is "ideal", in reality the "trig" and "thres" pins are connected to comparators internally, and these may not be able to read voltages too close to VCC or GND. So if you can - prototype it!

author: seanspotatobusiness
author_rank: Regular Contributor
timestamp: February 07, 2019, 01:28:49 am
content: Thanks a lot. I look forward to doing this in a breadboard soon. I think I will need to buy a cheap oscilloscope since my local maker space is an hour away. I don't need to do any high frequency stuff so hopefully there are some threads on EEVblog discussing crappy oscilloscopes for hobbyists. Then again, maybe even a serial oscilloscope made using an Arduino would be fast enough for this.

author: not1xor1
author_rank: Frequent Contributor
timestamp: February 07, 2019, 06:21:26 am
content: Quote from: Buriedcode on February 07, 2019, 12:18:26 amit would probably work better with one of those CMOS spiced 555... even without the opamp buffer

author: Buriedcode
author_rank: Super Contributor
timestamp: February 07, 2019, 02:09:16 pm
content: Quote from: not1xor1 on February 07, 2019, 06:21:26 amPossibly, but even if the resistors in the CMOS version are 100k, it would still pull the first 555 off timing. Not by much though! And if the value of the first 555's resistors are kept low (meaning the cap has to be rather large) it shouldn't make that much of a difference. Good call.I'm tempted to test this myself now.