3
\$\begingroup\$

I know that I can make a LED flash using a 555 timer. How may I make it flash twice every second?

What I am trying to do is to make the LED flashes two times, then wait a second, and then flashes two times again. In pesudo code is something like this:

while (1) {
    LED_BLINK_ONCE();
    wait(10ms);
    LED_BLINK_ONCE();
    wait(1000ms);
}
\$\endgroup\$
  • 1
    \$\begingroup\$ Related: electronics.stackexchange.com/q/51547/17592 \$\endgroup\$ – user17592 Apr 5 '13 at 13:41
  • 2
    \$\begingroup\$ electronics_dummy: This type of question gets downvoted very rapidly because it does not indicate sufficient research having been done before asking it: For instance, instead of saying you can make an LED flash, you could say "This schematic is how I believe a 555 is used to make an LED flash. Now what do I need to change to set the flash rate to X?". Better yet, if you search this very site, you might find prior questions paralleling this one. Welcome to the site. \$\endgroup\$ – Anindo Ghosh Apr 5 '13 at 14:25
  • 1
    \$\begingroup\$ @AnindoGhosh it seems with the edit and improvement the downvote was removed, but thanks for explaining. \$\endgroup\$ – Kortuk Apr 5 '13 at 15:16
  • \$\begingroup\$ Since you seem to already know how to write the code for it, I must mention that you can do this with a microprocessor, in a package that's the same size as a 555, similar in cost, and maybe even fewer parts. As a bonus, it will work! Somebody had to say it. \$\endgroup\$ – gbarry Apr 5 '13 at 18:03
  • \$\begingroup\$ I think the best circuit will depend on how long a single LED flash is - is it also 10ms then a gap of 10ms then another flash of 10ms then 970ms? I think the OP needs to state exactly what his requirement is, in particular the on time limits for the flash - maybe they are different for F1 and F2? \$\endgroup\$ – Andy aka Apr 5 '13 at 18:08
3
\$\begingroup\$

At first, the question was interpreted as "how can I make a LED flash with a 2Hz frequency?" The answer is below. The question has been changed, making this answer insufficient.

In short: no, you cannot do what you want using a single NE555. What you can do is using more than one NE555:

  • One pulsing at 1Hz with a very low duty cycle (20ms/1s)
  • Another one pulsing at 10ms, but only when the first one is on (using the chip's reset pin)

However, you see, this isn't very neat. To do such a specific blinking pattern as you want, you should use a small microcontroller. Olin's answer here shows the schematic, you'll have to write the code yourself.


The solution to get an LED to flash with a frequency of 2Hz:

You'll want to use the 555's astable operation. From the datasheet:

The frequency (you want 2Hz) can be adjusted with \$R_A + 2R_B\$ and the capacitor at pin 6. For a 2Hz operation you can use (approximately) \$R_A + 2R_B = 100\text{k}\Omega\$ and a capacitance of \$10\mu\text{F}\$ (see figure 14 of the datasheet):

enter image description here

They also give a function for the frequency:

$$f=\frac{1.44}{(R_A+2\cdot{}R_B)\cdot{}C}$$

With that formula, you can pick the values you want, to get a frequency of 2Hz.

\$\endgroup\$
  • 1
    \$\begingroup\$ +1 for giving the method and not the numerical answer! \$\endgroup\$ – Wouter van Ooijen Apr 5 '13 at 14:16
  • \$\begingroup\$ Two 555 timers (possibly combined in a single 14-pin package) should be able to provide the desired blink pattern. Wire the first one to generate a 1Hz low-duty-cycle output (the simplest way to reduce the duty cycle may be to wire a resistor from the control input to ground and arrange for the control-input voltage to be about half VDD instead of its normal 2/3). Then wire that output to the reset input of the second 555, whose blink rate should be the rate of blinks within each "on" part of the pattern. \$\endgroup\$ – supercat Apr 5 '13 at 15:32
  • 1
    \$\begingroup\$ If one wants the second 555's output to be active "low" for blinking the LED, one could wire its reset input high, and have the cap's charging resistor tied to the first 555's output rather than to VDD. That would alter the blink timing a bit, but the second 555's output would be high whenever the first 555's output was low. If one wants an active-high LED output, but doesn't like using the control input to adjust timing, one could use a diode from the first 555's output to the second 555's cap (so that when the first one outputs high, it jams the cap high). \$\endgroup\$ – supercat Apr 5 '13 at 15:38
  • \$\begingroup\$ @CamilStaps: My main point was that your answer was suggesting three 555's, but two will suffice. \$\endgroup\$ – supercat Apr 5 '13 at 15:39
0
\$\begingroup\$

The obvious way to do this is with a microcontroller. The tiny PIC 10F200 can do this easily, for example. It's not too hard to use a 666 555 timer to make a simple oscillator, but with varying duty cycle it gets more complicated, requiring two of them.

In contrast, the microcontroller solution only requires the micro and its bypass cap. This will be significantly smaller and simpler electrically than two analog timers, and quite possibly cheaper, depending on how accurate you want to make it.

In the firmware you create a routine that can delay some number of milliseconds passed to it, then call it like you already described.

\$\endgroup\$

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.