Re: Adding Status LEDs to input & output lines.... between microtroller & device
Your drawing is rather basic, the micro obviously will not control the 24v directly, there must be a transistor or transistor/relay controlling the load.
You can so long as the micro has enough current output, and most do, connect an led direct to the pin of the micro, if it runs off 5v then you need a 470r resistor to ground.
If the micro only has limited current outputs then you need a transistor, a bc547 will do, connect the base to the micro output via a 10k resistor, connect the collector to +5v, and connect the emitter to your led via a 470r resistor and then connect the led to ground.