Once fault is detected device should not resume to normal working condition until and unless POWER is switch off for 30 Seconds.
If power is restored before 30 seconds ( after switching OFF ) it again goes in Fault state.
Device do not contain any battery and carry 56F8037 micro controller on board.
Solution 1:
I am thinking to charge a capacitor using a transistor switch n a GPIO of micro;
once the fault is detected and once power is switch off it should get discharged through a resistor which will take approximately 30 seconds to drain.
Before powering ON device the voltage across capacitor will be sensed using a GPIO.
If it still high fault detector will enter in FAULTY state else resume normal.
Can anyone find out what risk am running with this??
Or a better direction to work..
I'm still unclear what you're trying to achieve. If the micro doesn't control the power why do you need it? Is it just a fault monitor which cancels a fault indication after 30 secs if the fault is no longer detected?
Yes..
Its fault detector who disables the fault once 30 seconds are over after switching off power.
The tricky part is of TIME..i.e. 30 Seconds
How electronics will come to know the power was switched off for min 30 seconds.
As micro is OFF no question of timers..
As batteries are not on board I can not use RTC to read and take time difference.
I am thinking to charge a capacitor using ( GPIO connected to Transistor base : A Switch ) drawing current from Vcc
Once fault is generated Switch will get activated and charge the capacitot and keep the switch open till power is available.
Once power is OFF, this capacitor will be drained by resistor connected to it to ground. ( Now I need to make sure the discharging time of this cap should be 30 seconds. need to control time constant )
On Powering ON micro will check for status of the capacitor charge using another GPIO; if it fully drained means 30 seconds of power off time has been done
Else will consider fault condition persists. ( In fault condition Vcc is available with some LED indication )
Using a cap for a 30 sec. timer is very iffy. If the cap or charge transistor fail the circuit will not work at all. IE there will be no voltage on the cap.
What exactly is your application?
I don't get it? You are using one of these correct? So why not employ the use of the uC totally in the fault loop? On fault detect the uC shuts things down. When fault is removed and no fault detect for 30 additional seconds the uC allows the process to resume.
What exactly in detail is the system and what defines a fault?