HI
i want to make a latching circuit that turn on or off using 1 gpio pin of arduino only .
i dont want to use a push button,
the load would be an led . there is no issue of power.
Basic idea is i want to turn on the LED and shut the MCU down without turning off the led.
how can i approach this without using a external push button and using only 1 gpio of arduino
sayHovis:
Light goes on when Arduino closes sw1. Light stays on regardless of sw1, until Arduino (which could have been turned off meantime) opens sw2.
Has to be an easier way
What will you use as sw1 or sw2 keep in mind that i only want to use 1 GPIO .
I think D FF as f/2 is a good option than rtc as it uses less number of pins and cheaper. the only con i can think of right now is that it uses more current than the rtc.
i want to make a latching circuit that turn on or off using 1 gpio pin of arduino only .
i dont want to use a push button,
the load would be an led . there is no issue of power.
Basic idea is i want to turn on the LED and shut the MCU down without turning off the led.
I don't know why you are even posting about this.
Just turn the led on and go to sleep.
You post doesn't say anything about waking up.
What's the problem ?
A. I don't know how to turn on a led.
B. I don't know how to go to sleep.
manveen_singh:
I think D FF as f/2 is a good option than RTC as it uses less number of pins and cheaper. the only con i can think of right now is that it uses more current than the RTC.
turn on the LED using the mcu .
then power down the mCU / make the mcu go to sleep / shut down each peripheral of the mcu .
Without turning OFF the LED . (led should remain on even if the mcu is sleeping /off / without any power ).
the challenge is the whole system should only use 1 gpio to turn on the led .
just assume all other gpio /i2c/spi pins are broken .
my point :
Step 1 : Before the MCU is turned on 1 : as base of q1 is pulled high it is always on ,
Step 2 : the only way to turn off the led is to give a HIGH pulse from the MCU pin .
this way the optocoupler turns on and base is shorted to GND , turning off the LED .
Step 3 : but when MCU goes to sleep the Gpio is not HIGH any more , it is LOW , thus Optocoupler is off.and the base gets VCC thru the R and and LED gets turned on .
As per my original Question .
I have to turn ON led led with MCU . THis means that LED is in OFF state before . LED is in OFF state originally .