Reading status of LED in given circuit

I wanna detect status of two LED from shown circuit. When LED is not glowing it’s one terminal show approx 10 volt and during OFF state of LED there is approx 0.9 volt. I want operate two relays on basis of two LED status. Help me i am beginner.

I am trying this programming- but i can’t read status of LED properly.

int LBLED = 2;
int FBLED = 4;
const int RELAY1 = 10;
const int RELAY2 = 12;

int LBLSTATE = 0;
int FBLSTATE = 0;

void setup() {
Serial.begin(9600);
pinMode(LBLED, INPUT);
pinMode(FBLED, INPUT);
pinMode(RELAY1, OUTPUT);
pinMode(RELAY2, OUTPUT);

}

void loop() {

int LBLSTATE = digitalRead(LBLED);
int FBLSTATE = digitalRead(FBLED);

Serial.println(LBLSTATE); Serial.println(FBLSTATE);

if (LBLSTATE == LOW)
{
while(FBLSTATE == LOW)
{
digitalWrite(RELAY1, HIGH);
digitalWrite(RELAY2, HIGH);
}

}
else
{
digitalWrite(RELAY1, LOW);
digitalWrite(RELAY2, LOW);
}

delay(1000);
}

How have you connected the Arduino to the circuit ?

How is the arduino hooked up? If you feed 10v into the pins of the arduino, you will destroy it.

@UKHeliBob

connections are at given pin --

int LBLED = 2;
int FBLED = 4;
const int RELAY1 = 10;
const int RELAY2 = 12;

I tried 1stly point of junction of LED and resistor and then at 1,2,13,14 pin no. of LM339

@Danois90

I used two different supplies,,,
for LM339 i m using 12 volt Battery while currently arduino is connected to LAPTOP's USB port.

On multi-meter it is showing 10 volt, so i tried to operate 6v relay directly using this but it can't able to operate relay.

Does the cirquits share a common ground? Have you measured the voltages at the connection points?

Have you connected the 12V analog ‘ground’. (BAT-) to the Arduino’s 0V/gnd pins - as a common 0V buss?

@Danois90 beat me to it!

BTW, once you get this working, you can eliminate all the op-amp and 12V circuit. But we can discuss that later.

@Danois90

Nope,

I will try it. Hope this will work....

As drawn the OP amp can drive current to the LED limited by 2.2k resistor - apparently not enough to drive 6V relay you are using.
You could add an optical coupler in parallel with current LED , adjust the limiting resistor , if necessary, and drive the relay direct from the optical coupler output.

Since all this monitoring circuitry is driven from the battery "under test" I would do some more calculations to make sure it would all work under "dead battery" scenario.

As a final note - lead acid battery "discharge characteristic / voltage " is not the best indicator of battery capacity - if that is your goal.

@232 - I was thinking the same, but figured OP is eventually going to add some logic in the Arduino :slight_smile:

Referring to schematic in OP, where is Arduino GND connected? Arduino pins 2 and 4?
2 opto isolators would be best way, IMHO.