safe shutdown when power loss

Status
Not open for further replies.

jacko91

Active member
Hey,
my plan: working with an T3.5, which is powered on VIN with 5V. When power is lost, I want to save data to eeprom. Idea: feed the 5V into a GPIO and measure. Put an extra Cap on the 3.3V line, which holds the 3.3V line long enough to save data when a LOW is detected on the GPIO.

Is this feasible?
Will this lead to a problem with the voltage onboard voltage regulator?

Thanks
 
Hey,
just as an update: I did a voltage divider on the Vin line so that I can read it with an analog pin. Now I am detecting with this analog read if the 5V drops below a certain level, if so, the eeprom saving routine is started. There will be enough time (plenty of ms (i checked with oszi)) for saving before the teensy turns off. So no extra cap is needed.
 
If you figured out a reliable solution: would you mind to post a code example and the values of the voltage devider?
 
Hey,
sorry for the late reply.
I took two 10k resistors. Then measured the voltage of the resistor between GND and a ADC pin with analogRead(). If the voltage is below 2.5V I call my saving routine.

Greetings
 
Status
Not open for further replies.
Back
Top