Status LEDs for device operation

Hello!

I have successfully managed to connect an absolute encoder with SSI interface to an Arduino Uno via a MAX490.

What I want now is to have 2 LEDs for indicating operation status.

LED1 should light up when the encoder (uses 5V) is connected to the board via an RJ45 plug
LED2 should light up when the encoder data (angle) changes.

I can handle LED2 by using a separate Arduino pin to let the LED light up when there is a data change. No problem.

But what about the first LED? How can I make it light up when the encoder is plugged in and draws power? Of course, I cannot just put the LED with some resistor just before the encoder, as it would not get 5V but a quite lower voltage.

Any ideas?

Are all of the contacts used on the RJ45 plug? Tie an unused contact to ground on the encoder side of the plug. Make it so that when the plug is plugged in, the ground contact pulls an input (with pullup enabled) to ground. When the plug is not plugged in the input will be pulled up to Vcc.

An absolute encoder will only read all zeroes (or all ones) at one point in its rotation.

It will probably be sufficient to determine what value will be "read" when the encoder is not plugged in, and take this a an indication that it is actually not plugged in.

If the encoder is regularly moved to change value, then it can be presumed that if that "not plugged in" value is read for any significant period of time, then it really is in fact - not plugged in. :smiley:

szapo:
LED1 should light up when the encoder (uses 5V) is connected to the board via an RJ45 plug
............
But what about the first LED? How can I make it light up when the encoder is plugged in and draws power?

Basically you can't, you have to do it indirectly. There is no power drawn to speak of, unless you want to play about with op amps.

Thanks for the suggestions! So I guess there is no simple solution requiring only a few resistors.

Unfortunately, there is no free pin left on the RJ45, since I need all 8 pins for communication/data/reset lines.

Maybe one can implement the LED in the data signal part? If there is no encoder plugged in, there is obviously no data coming in.
But I haven't yet found a possibility to integrate the LED in the electronics around the MAX490 without destroying the signal.

szapo:
Thanks for the suggestions! So I guess there is no simple solution requiring only a few resistors.

How much simpler can you get than what I suggested?

Mind you, you have not actually explained what you are using (with a schematic), making it difficult to give more detail.