detect voltage by arduino
I am assuming you are going to simply measure the voltage drop across the LED and use that to determine if the LED is on, this will work but you will need a couple of extra components, you can damage your arduino if you feed in a voltage over 5V.







simulate this circuit &ndash; Schematic created using CircuitLab

In the above R1 and R2 form a voltage divider to reduce the voltage on the A0 pin of your arduino. We can calculate the maximum voltage you can use to safely stay under 5V on A0:

Vmax = 5.0 / (R2 / (R1 + R2))
     = 5.0 / (47000 / (100000 + 47000))
     = 15.6V


Finally read the value of A0 in your arduino code and use the following formula to convert that value into a voltage:

float r1 = 100000;
float r2 = 47000;

float vRaw = (analogRead(0) * 5.0) / 1024.0;
float vDrop = vRaw / (r2 / (r1 + r2));


Depending on the accuracy needed you may need to mess with the 5V value above and adjust r1/r2 to a measured value (depending on accuracy of the resistors you are using).

For a complete example see https://www.udemy.com/blog/arduino-voltmeter/