How to detect led is on


hi. i'm trying detect changes on power suply. have uncontinuous power supply , has tree leds indicating state of charge, green 1 when ac power supply on, yellow 1 when charging, , red 1 when ac power supply off.
i don't know how connec tto arduino , grove base shield. leds connected positive born , +5v. ground of each led selected on/off internal ups relay. can tell me how connect arduino , detect charge / led state changes ??
thanks in advance

connect arduino ground power supply ground.

connect 1 of arduino digital i/o pins switched side of led.

enable internal pull-up resistor on i/o (input) pin.

when led off, input read high (pulled-high internal resistor , leakage through led).   

when relay closes pulling led pin ground , turning on, input pin pulled ground , read low.


Arduino Forum > Using Arduino > General Electronics > How to detect led is on


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62