# Help to detect switch to ground, 12 - 240v Inverter (remote)

Hi,

This picture is for the manual remote for my 12 - 240v inverter.

Pressing the button for a second (or 2) will turn it on / off,

When On the green LED will light up,

The 12v line has power to it all the time,
The Green LED ( pin 2 ) is Open when the unit is off,
and Grounded when it's On,
( tested this by connecting this pin to my multi meter and the negative terminal
of the 12v supply to the inverter )

I'm wanting a way to monitor this with an arduino ( On / Off via the Green LED )

can someone give me an idea how to check the grounding of pin 2 ?

If it was the other way around (power on / off ), I would not need any help,

Nigel

After some Googling, maybe this would work ?

Pin1 to 12V, Pin 2 to GREEN LED.

The logic will be inverted. When the GREEN LED line is grounded the opto-coupler will be on and the voltage at the pin of the Arduino will be low.

When the GREEN LED line is open or high the opto-coupler will be off and the Arduino pin voltage will be high

Loose the 10k resistor.

Use Arduino's buildin pull up resistor.
pinMode(optoPin, INPUT_PULLUP);

The 1k resistor can likely be raised in value (1-10k) if current draw on the 12volt side is a problem.
Leo..

Hi,

Is the Green LED, a LED and resistor combined?
Check the voltage across the Green LED when it is ON. Or pins 1 and 2 of the RJ12.
There has to be a current limit resistor in circuit somewhere.

If no resistor then the voltage across the Green LED when ON will not be enough to turn the opto LED ON as you are wiring them in parallel.

Tom..

TomGeorge:
Hi,

Is the Green LED, a LED and resistor combined?
Check the voltage across the Green LED when it is ON. Or pins 1 and 2 of the RJ12.
There has to be a current limit resistor in circuit somewhere.

If no resistor then the voltage across the Green LED when ON will not be enough to turn the opto LED ON as you are wiring them in parallel.

Tom..

There is no resistor on the remote, but it has resistance when I checked ( internal to the inverter I think )

This is what I've designed so far, ( I will change / remove some of the resistors )

Hi,
Will you be keeping the Green and Red LEDs already in the circuit?

If so then your optos may not work.

I think you fail to see that your optos rely on the volt drop across the Red and Green LEDs to work.

It will not be 12V but about 1.2 to 1.6V, this may not be enough to operate your optos.

Like I asked what is the voltage across your Red and Green LEDs when they are ON.

Tom...

Remove the 4k7 resistors on the collectors of the optos (purple line).
Enable the buildin pull up resistors with code, as explained in post#2.

Swap the values of the voltage divider.

The zener is ok there, but useless in case the Arduino is off.
Tits on a bull. Can be removed.

A 15volt supply is too high for the Nano.
The extra 75mA from the relay will overheat/fry the onboard voltage regulator.
A 5volt micro-power buck converter could fix that.
Leo..

TomGeorge:
Hi,
Will you be keeping the Green and Red LEDs already in the circuit?

If so then your optos may not work.

I think you fail to see that your optos rely on the volt drop across the Red and Green LEDs to work.

It will not be 12V but about 1.2 to 1.6V, this may not be enough to operate your optos.

Like I asked what is the voltage across your Red and Green LEDs when they are ON.

Tom...

The LEDs will not be in the final circuit,

I measured the voltage across where the green LED was, (lead on each pin with my multimeter set to DC, 20 volt range.)
when the unit is powered off, but still connect to the battery, it showed 0.2 volts
when it was powered on, it showed the same voltage to the unit ( 14.2v )

Wawa:
Remove the 4k7 resistors on the collectors of the optos (purple line).
Enable the buildin pull up resistors with code, as explained in post#2.

Swap the values of the voltage divider.

The zener is ok there, but useless in case the Arduino is off.
Tits on a bull. Can be removed.

A 15volt supply is too high for the Nano.
The extra 75mA from the relay will overheat/fry the onboard voltage regulator.
A 5volt micro-power buck converter could fix that.
Leo..

I have the voltage divider set to give me a 15v range ( max output from my solar controller to the batteries )

Depending where I look on the internet, depends what the answer is,
here ( https://www.arduino.cc/en/Main/arduinoBoardNano ) says this,

Power
The Arduino Nano can be powered via the Mini-B USB connection, 6-20V unregulated external power supply (pin 30), or 5V regulated external power supply (pin 27). The power source is automatically selected to the highest voltage source.

Here ( http://www.es.co.th/Schemetic/PDF/ARMB-0022.PDF ) says

Input Voltage (recommended)
7‐12 V
Input Voltage (limits)
6‐20 V

The Relay is the 5v type, it will operate for about 2 seconds to 'toggle' the unit on / off

Can some one check my schematic to see if I have the optocoupler wired correctly please,
just a thought what voltage can they run at ?

Nigel

Noddle:
I have the voltage divider set to give me a 15v range ( max output from my solar controller to the batteries )
Input Voltage (recommended)
7‐12 V
Input Voltage (limits)
6‐20 V

The Relay is the 5v type, it will operate for about 2 seconds to 'toggle' the unit on / off

Can some one check my schematic to see if I have the optocoupler wired correctly please,
just a thought what voltage can they run at ?

5volt across R1, and 10volt across R2 (the resistor from A6 to ground).
As said, swap the VALUES.

15volt (10volt drop), and a relay(100mA total) will generate 10volt*0,1Amp= 1watt in the regulator.
A Nano has little or no heatsinking. The regulator will get sizzling hot when the relay is active.

If you only activate the relay for 2 seconds, it might be ok.

Opto transistors go from Arduino pin (collector/pin5) to ground (emitter/pin4).
Remove that purple line.

Not sure about the opto LEDs.
I would use (1k-4k7) current limiting resistors there.
Leo..

15V sounds like lot for such a tiny regulator. I've had overheating problems powering my ESP modules (3.3V) from 12V, and that was just it's internal power use... especially if it's going to be enclosed.

Another thing: why two optocouplers? They seem to do the same thing just opposite. One is on as the other is off, as it's either one or the other LED that's on. To really open up an optocoupler normally needs about 10 mA (check the spec sheet) and drops just under 1V so you'd need resistors of >1K and 1/4W (they'd have to dissipate >100 mW).

An opto has an IR LED inside with a Vf of about 1.25volt.
The opto LED could just go in series with the existing LED.
Leo…

Hi,

The LEDs will not be in the final circuit,

I measured the voltage across where the green LED was, (lead on each pin with my multimeter set to DC, 20 volt range.)
when the unit is powered off, but still connect to the battery, it showed 0.2 volts
when it was powered on, it showed the same voltage to the unit ( 14.2v )

Read the under lined, you cannot drop 14.2 volts across an LED unless there is a series resistor built in.

Can you post a picture of the assembly.
Measuring an LED at it leads should be 1.2 to 2.0 V depending on the colour.

Tom...
Is the LED naked, or in a bezel?

TomGeorge:
Hi,Read the under lined, you cannot drop 14.2 volts across an LED unless there is a series resistor built in.

Can you post a picture of the assembly.
Measuring an LED at it leads should be 1.2 to 2.0 V depending on the colour.

Tom...
Is the LED naked, or in a bezel?

This was tested at a battery voltage of 12.7

When the unit was on,

at the LED on Pin side 1 was 7.01v, ( to ground )
at the LED on Pin side 2 was 5.06v, ( to ground )

Interesting.
I don't know what is wrong, but something is wrong with the numbers you gave.
These LEDs don't seem to have a current limiter - this means you should be measuring just over 1V when lit, 0V when off, measured across the LED itself.
When an LED is off, you should not be measuring any voltage across it. Measuring 5-7V across an LED without resistor (your LEDs don't seem to have one - at least not on that PCB, there could be one in the device this is to be connected to instead).
Also, where do you get the GND line to measure against? There's no GND in your original schematic, only a 12V input line, and three outputs (two to drive the LEDs, one for the switch).

If the green LED in the opening post has no series resistor in the diagram, then obviously the series resistor must be hanging around somewhere (not drawn in the circuit). So the label "GND when ON" in the opening diagram might not be accurate.

This is connected to a 12-240v inverter,
I'm using the GND from the battery ( negative terminal at the inverter, going to the battery )

I also assume there must be a resistor inside the inverter, but since this is new, I'm not going to void the warranty by opening it to trace the connection through

maybe I will use a relay, instead of a 'chip' to switch the arduino pin high / low