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
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.
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
Post a Comment