# How do you tell how fast an LED is blinking?

#### hp1729

Joined Nov 23, 2015
2,304
An IR LED was the original posted question, but the question applies to any LED I guess that is blinking faster than the eye can detect. I can see using a photo transistor and a scope, but in this case the original poster did not have a scope.
I have seen frequency counters that had a pulse width measurement function, but the price of such things is right up there with a scope.
So do you make your own pulse width counter? We are looking at sub-microseconds for a pulse width. So we need a 4 digit counter that counts in nanoseconds? Not with any parts I have in stock.
Any other ideas?

#### dl324

Joined Mar 30, 2015
14,668
You could build your own counter that will have it's maximum frequency limited by the technology; e.g. 30MHz-ish for TTL, less with 4xxx CMOS. You can design it to count for a second to give you cycles per second or you can use fractional seconds and do the math in your head.

Commercial hobby level counters (most frequency meters will also function as counters) aren't prohibitively expensive; especially if you buy used.

Before I bought commercial counters, I built one using 2 MC145553 counters. At 5V, typical max frequency is 1MHz or so.

#### kubeek

Joined Sep 20, 2005
5,774
Why sub-microsecond? Unless it is some special kind of LED used for some weird purpose, I don´t see why would anyone flash it at more than a few kHz.
Also, do you want to know the pulse width, or the frequency, or both?

#### MrSoftware

Joined Oct 29, 2013
2,027
Use an arduino. Connect your detector to a input pin that is assigned to an interrupt. Every interrupt increment your counter. Every second or two divide your counter by time elapsed, display the result and reset the counter and timer. Reset these after displaying the result, the display will be slow and could lengthen the time required to service the interrupts and might skew the count until the display is complete. I'm not sure how fast you'll be able to count, that depends on how fast the arduino can service interrupts.

You could probably do the same with a couple of IC's, but I don't know which k ones to use.

#### Alec_t

Joined Sep 17, 2013
12,883
For checking the frequency, perhaps use a photo-diode to set a latch and a known variable frequency pulse generator to reset the latch. Average the latch output with an RC filter. Average should be half the logic supply voltage if f(photo-pulse)=f(gen).

#### hp1729

Joined Nov 23, 2015
2,304
Okay, no sub-microseconds. 1 MHz clocks to a counter. Simple AND gating, one input from an IR sensor, the other from the 1 MHz source. counting one time only. Maybe a 74120 set to single pulse mode??? see attachment
Counter gives "on" time. Invert the IR sensor input for "off" time.

#### Attachments

• 276.5 KB Views: 3

#### dannyf

Joined Sep 13, 2015
2,197
If you want to know how fast a led is driven, a multimeter with frequency range, a frequency counter, or a lowly scope will do.

If you want to know how fast a led blinks, a photo sensor is needed.

#### kubeek

Joined Sep 20, 2005
5,774
I am not sure what you mean. A measley ATmega with a counter, and the counter clock set at or provided at 1MHz will be more than capable of measurimg both the on time and off time of any wave, I´d say up to 200kHz or more.
That meaning you get 50x oversampling of the period, which gives you resolution of 2% PWM.

#### hp1729

Joined Nov 23, 2015
2,304
If you want to know how fast a led is driven, a multimeter with frequency range, a frequency counter, or a lowly scope will do.

If you want to know how fast a led blinks, a photo sensor is needed.
Yep. Sounds like a sensor and a counter is the way to go. Two 74LS390s gives me a four digit counter. I have a few 7-segment displays, TIL309, I think they are. BCD decoder and 7-segment driver built in.

Last edited:

#### SLK001

Joined Nov 29, 2011
1,548
If you want to know how fast a led is driven, a multimeter with frequency range, a frequency counter, or a lowly scope will do.

If you want to know how fast a led blinks, a photo sensor is needed.
Can't you infer how fast a LED blinks by how fast it is driven? If this is not 1 to 1, then what kind of LEDs are being used?

#### wayneh

Joined Sep 9, 2010
17,175
If the frequency is in the audio range, you can use a computer or smartphone oscilloscope to look at the the phototransistor output, as fed into the audio input of the computer. If the frequency is higher than that, you could divide it down first.

#### dannyf

Joined Sep 13, 2015
2,197
"If this is not 1 to 1, then what kind of LEDs are being used?"

A broken one? An incorrectly designed one? A wrongly installed one? A missing one?.....