2
\$\begingroup\$

I've got the output of a CMOS IC (74HC4017 1-of-10 decade counter). It's output pins are either 0V or VCC.

The counter is driven by a slow clock (say, 1Hz). Now I want an LED on one of the output pins to flash, but only briefly (say, 1/10th second) when an output becomes high (or when it becomes low, whichever is easier; it doesn't matter).

I tried putting a capacitor in front of the LED (Q0 -- C -- LED -- R -- GND) and of course the LED does flash… once. Then the capacitor is full and can't discharge, even when the output becomes low again.

I've been thinking and experimenting about this for a few hours now but can't come up with a solution.

\$\endgroup\$
3
  • \$\begingroup\$ A 555 based monostable comes to mind. I don't know if it's the simplest option available, but you can have the LED turned on for an specific time lapse. \$\endgroup\$ – Serge Jan 18 '13 at 21:01
  • \$\begingroup\$ Actually I experimented with a NE555 monostable, but it would only help the other way round: turn a short pulse into a long pulse. \$\endgroup\$ – DarkDust Jan 18 '13 at 21:06
  • \$\begingroup\$ You can shorten the input pulse to the 555 with an RC circuit. Alternately, have a look at 74LVC1G123, for example. \$\endgroup\$ – The Photon Jan 18 '13 at 21:09
5
\$\begingroup\$

Try adding a parallel resistor to "bleed" the capacitor while the driver output is high:

enter image description here

The R1*C1 combination gives a flash duration of about 100 us. As long as the LED is bright enough, it doesn't matter how short this duration --- your eye will still see it. If you want a visibly longer duration pulse you may want to look into something like a one-shot instead of a simple RC circuit.

I chose the R2 value to give a 10 ms time constant for discharging. This will allow the cap to be essentially fully discharged in the 500 ms your clock output is high.

Note this solution drives some current back in to the Vcc supply. There should be some other load on Vcc to consume this current, or you might cause problems with power supply stability. If there isn't any other load on Vcc, add an additional 10 kOhms from Vcc to ground.

\$\endgroup\$
4
  • \$\begingroup\$ Ah, I think I understand. Your circuit does the trick, thank you very much. Now taken one step further, how do I do this with multiple output pins that should all drive the same LED? Adding a diode (may not connect the outputs together) breaks the circuit, of course. \$\endgroup\$ – DarkDust Jan 18 '13 at 21:23
  • \$\begingroup\$ You want the LED to flash whenever any of the outputs has a falling edge? \$\endgroup\$ – The Photon Jan 18 '13 at 21:29
  • \$\begingroup\$ No, only a few (four of the ten: Q0, Q2, Q4, Q6), so there's always a low/high - high/low cycle. \$\endgroup\$ – DarkDust Jan 18 '13 at 21:34
  • \$\begingroup\$ 4-input OR gate would be the easy way. \$\endgroup\$ – The Photon Jan 18 '13 at 21:57
3
\$\begingroup\$

You get a lot more bang for your buck if you multiply the capacitor current through a transistor. You really get more bang if you also multiply the transistor current with another transistor:

schematic

Q1 and Q2 function together essentially like one NPN transistor with very high gain, about equal to the current gains of each multiplied together. This is listed in transistor datasheets as \$h_{fe}\$ and it varies over a wide range from transistor to transistor, but \$h_{fe} = 100\$ is a reasonable estimate. Thus, the pair of Q1 and Q2 have a current gain of roughly 10000. This gain multiplies the current from the capacitors, allowing them to light the LED longer without being bigger.

Select R1 as you would for any series resistor to limit the current through the LED. Something like \$ R_1 = (V_{cc} - V_{D1}) / I_{D1} \$ is a fair approximation. Assuming your supply is 5V, you want 20mA through the LED, and it's a typical red LED with a 1.6V drop:

\$ R_1 = (5V - 1.6V) / 20mA \approx 180 \Omega \$.

The time the LED will be on will be roughly \$ h_{fe} C_1 R_1 \$. If you want it on about 0.1 seconds, and our Sziklai pair has an effective current gain of 10000, then \$ 0.1s = 10000 \cdot C_1 \cdot 180\Omega \$. Rearrange a bit to get:

\$ C_1 = \dfrac{0.1s}{10000\cdot 180\Omega} \approx 5.6 nF \$

At rest, the base of Q1 is held below 0.6V by Q1's base-emitter junction. When the input goes high, the voltage over C1 is at first 0V, and Q1's base-emitter diode is forward biased, and the voltage over R1 is almost the full supply voltage. D1 isn't yet on because the voltage over R1 is too high.

However, the current through Q1 and R1 quickly raises C1's voltage, and consequently, lowers voltage across R1. Pretty soon, voltage across R1 has dropped enough to allow D1 to turn on. Now D1 begins contributing current to keep the voltage across R1 up. This in turn decreases the current required from C1. For every unit of charge through C1, 100000 times more charge is passed through D1.

Eventually, the voltage across C1 is almost the full supply voltage, and there's nothing left to supply base current, so current through D1 and R1 are zero.

The input goes low, shoving the left side of C1 to ground. The right side of C1 is now approximately -Vcc. This forward biases D2 so C1 can discharge, dumping its energy into your supply rails. If you have a bypass capacitor nearby that's significantly larger than C1, this won't be a problem except in the most sensitive of circuits. If you needed, you could put a resistor in series with D2 to decrease the noise.

U1 is an optional buffer to isolate the clock drivers from the capacitive load, slowing your rise and fall times. Since C1 can be so small, the load may not be significant for your application, and you can omit the buffer.

To extend this to multiple inputs, duplicate U1, C1, D2, and Q1 as many times as needed:

schematic

\$\endgroup\$
0

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.