Using LED as data flow indicator?

Hi there,

Suppose you have a wire in which data signal flows. Lets say that this data signal is around 2V. I want to use an LED to indicate the flow or presence of signal on this wire.

Whare are the considerations, techniques, tricks etc. that I should be aware of?

I have used LED with microcontrollers with one end to GND and other end to power source with a resistor in between (both ways of connection). But I have not used an LED in a continous wire as indicators of data signals? How should I proceed. I hope I made myself clear. Thanks

Regards

Well, the LED & series resistor might do the job - connect it so that the LED is lit when the signal is not in its idle state (which might be either high or low, depends on what exactly the signal is).

This assumes:

  • the signal has a definite idle state (it’s possible that the signal might end up randomly high or low, depending on the last bit that was sent, or that it’s constantly changing even when no data is being sent),

  • the signal source provides enough current to light the LED,

  • the voltage is sufficient (2V is marginal, only a red LED has any chance of working here), and

  • the signal lasts long enough for a flash of the LED to be visible.

For cases of insufficient voltage or current, the signal could turn on a transistor that lights the LED from a more suitable power source.

If the duration isn’t enough to be visible, additional circuitry would be needed to stretch the on-time of the LED - a “retriggerable one-shot” is basically what you need.

Also known as a “pulse stretcher” in this particular application. You could wire one up with a 555 easily enough.

Thanks for responses. However, things you folks are talking about seems to get more complicated.

May be, I was not very clear. Consider this scenario:

You are sending a character, say, C, from your microcontroller to a SD flash card. The binary representation of C is “100 0011”. So I want to put an LED in between to detect these “100 0011”. That is the LED turns “ON OFF OFF OFF OFF ON ON”. That way you can sense that something has gone to the SD card. I do not want anything precision but some LED activity (turning ON or OFF) just enough to indicate that the character C went through.

microcontroller ---------LED-----------> SD memory card

“100 0011” ---------“ON OFF OFF OFF OFF ON ON”-----------> SD memory card

.

smdFan:
Thanks for responses. However, things you folks are talking about seems to get more complicated.

May be, I was not very clear. Consider this scenario:

You are sending a character, say, C, from your microcontroller to a SD flash card. The binary representation of C is “100 0011”. So I want to put an LED in between to detect these “100 0011”. That is the LED turns “ON OFF OFF OFF OFF ON ON”. That way you can sense that something has gone to the SD card. I do not want anything precision but some LED activity (turning ON or OFF) just enough to indicate that the character C went through.

microcontroller ---------LED-----------> SD memory card

“100 0011” ---------“ON OFF OFF OFF OFF ON ON”-----------> SD memory card

.

Unfortunately, I think that they did understand. The problem is that the LED will flash at the rate of the signal which is too fast for the eye to observe, unless you slow down the communication drastically (less than approx 20 Hz). While SD cards are required to perform with a 25MHz clock, it is not guaranteed that they will perform corectly at such a low speed. This is why we have logic analyzers. Since you are probably communicating with the SD card via SPI, a fairly simple analyser can be used (4 bits, speed depends on actual transmission rate). You can also use a DSO.

Greetings (No First Name Supplied),

smdFan:
However, things you folks are talking about seems to get more complicated.

May be, I was not very clear. Consider this scenario:

I think your request was very clear, and that Muntron has

given you a clear answer.

Connecting an LED with ballast resistor to the signal line

and ground will tell you of activity. It will not pulse out

the actual code sequence (in “Morse code” fashion) unless

you capture the date and replay it at human radable (slow)

speeds.

A circuit to do exactly what you want is fairly simple, using

either a uC (with some code) or combinational logic.

Unfortunately, the skill to impliment these is greater than

the problem you are trying to solve (i.e. confirming data

flow).

A different approach would be to use your project’s

hardware as the test equipment and write a much smaller

code to exercise the hardware at normal speed and then

use this to test your project. Once you have confidence in

the test mode you can go back to the project’s code.

I do this all the time with uC development! Most new

hardware that I build gets a quick check out with one

or two LEDs hung on IO lines to quickly confirm activity.

Comments Welcome!

bigglez:
Greetings (No First Name Supplied),

smdFan:
However, things you folks are talking about seems to get more complicated.

May be, I was not very clear. Consider this scenario:

I think your request was very clear, and that Muntron has

given you a clear answer.

Connecting an LED with ballast resistor to the signal line

and ground will tell you of activity. It will not pulse out

the actual code sequence (in “Morse code” fashion) unless

you capture the date and replay it at human radable (slow)

speeds.

A circuit to do exactly what you want is fairly simple, using

either a uC (with some code) or combinational logic.

Unfortunately, the skill to impliment these is greater than

the problem you are trying to solve (i.e. confirming data

flow).

A different approach would be to use your project’s

hardware as the test equipment and write a much smaller

code to exercise the hardware at normal speed and then

use this to test your project. Once you have confidence in

the test mode you can go back to the project’s code.

I do this all the time with uC development! Most new

hardware that I build gets a quick check out with one

or two LEDs hung on IO lines to quickly confirm activity.

Comments Welcome!

Thanks for your answer. I appreciate it. My problem is not checking hardware…etc. I can do that differently. However, I wanted a visual indicator (because it looks nice). However, it seems they are more trouble than worth it. Thanks

actually, I believe that driving an LED will give a visual indicator of the level of activity. I doubt you could just hook an LED+resistor to the line but the transistor suggestion earlier would work. The LED will light up when there is a signal on that line. The intensity will be proportional to the amount of time the signal is high.

I’ve seen this technique used for visual indicators in a number of places. If there is a need to see the individual bits, a Logic Analyzer is the best tool.

I use this exact method all the time when debugging circuits – its a great way to help figure out when data is flowing.

I usually just put a 3.3v LED in series with a signal, although I think sometimes I may have placed the LED from the signal line to ground. Since your signal is 2v, I would look for an extra low voltage LED, and then just play on a breadboard until you’ve got something that seems to work.

silic0re:
I use this exact method all the time when debugging circuits – its a great way to help figure out when data is flowing.

I usually just put a 3.3v LED in series with a signal, although I think sometimes I may have placed the LED from the signal line to ground. Since your signal is 2v, I would look for an extra low voltage LED, and then just play on a breadboard until you’ve got something that seems to work.

So will this will work? I think it should but I never done it. Thanks

[<LINK_TEXT text=“http://aycu25.webshots.com/image/47584/ … 710_th.jpg”>http://aycu25.webshots.com/image/47584/2005549713002806710_th.jpg</LINK_TEXT>](http://allyoucanupload.webshots.com/v/2005549713002806710)

Put in a current limiting resistor of say 330-470 ohms and you should be good to go. I have done this with an XBEE dev board I made and found it to be really helpful.

the LED will light but at a speed faster than the eyes as mentioned earlier…you have to stretch the pulses or store it in a buffer then display it at a rate that is readable to the human eye…

it’s much more like a DSO or a Logic Analyzer…

it will just appear less bright than at full brightness, with, of course, a brightness proportional to the number of 0’s and 1’s in the signal. generally I also find the faster the signal, the less bright the LED becomes.

unless the goal is to actually reconstruct the signal through blinks, rather than just telling ‘some data is going through here’, then it should be fine.

ohararp:
Put in a current limiting resistor of say 330-470 ohms and you should be good to go. I have done this with an XBEE dev board I made and found it to be really helpful.

I’d go with a smaller resistor than that. 330-470 ohm would be fine for 5V, but he’s connecting across 2.5V. As I understand it, to figure the proper current limiting resistor for an LED, you take the applied voltage and subtract out the LED’s voltage drop to determine the voltage acrioss the resistor, then use ohm’s law to get the size of the resistor based on the current you want.

In this situation, we’ve got a 2.5V source, and an LED with a 2V drop,and let’s say we want 20mA. So the LED drops the voltage to .5V across the resistor. Using Ohm’s law, .5V / .02A = 25 ohms. A 330 ohm resistor would only let 1.5 mA through, which would be pretty dim, if visible at all. Given that he’ll be dealing with pretty quick flashes, he’ll probably want them as bright as possible (but not so bright that they let the smoke out of the LED).

If the source was 5V, then a 330ohm resistor would give you (5V-2V)/330ohm = .009A, or 9mA, which would be reasonable. I usually use 220ohm for 5v, which gives 13mA, but either works fine.

Someone please correct me if I’ve got that wrong.

Keith