LED indicator for data pin - Page 1
Forum section: electronics / beginners

author: Lucky-Luka
author_rank: Unknown
timestamp: June 24, 2019, 09:55:08 am
content: Hi allI would like to understand the connections that allow leds to blink as Tx and Rx are working in a serial communication.In the video I show what I mean.I have a connection between a FPGA and a breadbord with a PIC.I want to include in my pic board the little board with the max3232 so I was wondering how to connect leds to show when some data is flowing.Are they in parallel with data lines? In such a way don't they change signal levels?Cheershttps://youtu.be/kKMO86WT7o4

author: Rerouter
author_rank: Super Contributor
timestamp: June 24, 2019, 10:58:48 am
content: In general they are in parrellel with the data lines, as most TTL signalling is active low, they have a pullup from positive to limit there current to 0.5-2mA, and when the RX or TX goes to ground they light up.

author: Lucky-Luka
author_rank: Unknown
timestamp: June 24, 2019, 12:42:23 pm
content: Hiso, if I've correctly understood, I should do something like the attached image (image found on internet).Am I right?Cheers

author: Rerouter
author_rank: Super Contributor
timestamp: June 24, 2019, 12:43:40 pm
content: You want the top half of the image, not the lower half

author: Lucky-Luka
author_rank: Unknown
timestamp: June 24, 2019, 12:46:54 pm
content: With the top half part of the image don'tI change the level of the pin input?btw which R value should I use?Cheers

author: Rerouter
author_rank: Super Contributor
timestamp: June 24, 2019, 01:15:43 pm
content: It will change the level, how much comes down to your exact schematic.TTL idles high, if both devices have the same IO voltage, e.g. 3.3V, all is happy, they pull down to ground to send bits of dataSo when the bus is not doing anything, and the LED is connected to that same voltage, in this case 3.3V, it is off, no change to the signal what so everNow when it pulls the bus low, then the LED is on, its loading the signal with some current so its going to be a little higher from ground than it would be without the LED, but we can calculate what we can get away with.now your little PIC micro, It should at the worst case be able to sink 10mA on a given pin to ground with some very tiny offset voltage from ground (can be higher, but lets say 10mA to cover almost all cases), so aslong as what else your hanging off that pin does not let more than 10mA flow into the pin to ground, your good,I imagine your FPGA like any other IC set up with an input will be drawing down in the nA - single digit uA currents, so that can be ignored, leaving mainly the LED,So we need the LED to have less than what the pin can sink flowing through it, as its just an indicator LED, 0.5mA for indoor would be more than bright enough, for outdoor may need 2-5mA, still less than that arbitary 10, so in the clearnow for calculating the resistor, lets just say its a normal green LED for both, so about 2.4V dropped by the LED, so 3.3V - 2.4V = 0.9V we need to burn off in the resistor, lets say we want 2mA, well R = V/I so 0.9 / 0.002 = 450 ohms, round to a common value, say 470 ohms, and there you go, a bright LED that does not overload your pinsThe datasheets of your devices will tell you the maximum current each pin can sink (or source), and will probably even have a graph buried somewhere about output voltage vs current if you really want to doublecheck the datasheet, if they are all within spec, then your good and it will work.