Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Arduino Life Timer

Status
Not open for further replies.

imranahmed

Advanced Member level 3
Advanced Member level 3
Joined
Dec 4, 2011
Messages
817
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
6,493
Please let me know I want to implement life timer in Arduino it will start with Arduino power-up and when Arduino power-off it stores time and when again we power-up Arduino it will display last hours or minutes Arduino ON and add new power-up time and so on.
Any hint or article?
 

Hi,

for me it seems th most important issue is to detect the turn off of the MCU. This might be realized by observing the supply voltage by an ADC or a supervisor IC [1] which is triggering an interrupt. This approach requires enough energy stored on the PCB (capacitors) to enable the storage of the current timer value, before the MCU is completely powered down. The ADC/supervisor has to observe an "isolated-version" of the power supply e.g. by means of a diode, otherwise you are measuring the buffered voltage (energy) stored in the capacitors.

If you are interested in the actual time, use an RTC IC. Have a look at the PT7C43390 [2] which provides the followong ability "Users always can take back the information in the registers which is stored before power-off the main power supply, after the voltage is restored."

[1] https://www.ti.com/power-management/supervisor-reset-ic/products.html
[2] https://www.diodes.com/assets/Datasheets/PT7C43390.pdf

BR
 
Hi,

for me it seems th most important issue is to detect the turn off of the MCU. This might be realized by observing the supply voltage by an ADC or a supervisor IC [1] which is triggering an interrupt. This approach requires enough energy stored on the PCB (capacitors) to enable the storage of the current timer value, before the MCU is completely powered down. The ADC/supervisor has to observe an "isolated-version" of the power supply e.g. by means of a diode, otherwise you are measuring the buffered voltage (energy) stored in the capacitors.

If you are interested in the actual time, use an RTC IC. Have a look at the PT7C43390 [2] which provides the followong ability "Users always can take back the information in the registers which is stored before power-off the main power supply, after the voltage is restored."

[1] https://www.ti.com/power-management/supervisor-reset-ic/products.html
[2] https://www.diodes.com/assets/Datasheets/PT7C43390.pdf

BR
Yes I want to store last time when it powered-off and add new tim when it again power-on.
Ok I am visiting your given links.
 

Hi,

* there are independently running ON time counters.
* You may store the uptime in SRAM, FRAM, NVRAM, in EEPROM (mind write cycle limit)
* you may store the uptime in an external clock circuit.

ARDUINO is more a brand name or an IDE than a dedicated hardware. --> But the solution depends on the hardware you want to use.

Klaus
 
Hi,

* there are independently running ON time counters.
* You may store the uptime in SRAM, FRAM, NVRAM, in EEPROM (mind write cycle limit)
* you may store the uptime in an external clock circuit.

ARDUINO is more a brand name or an IDE than a dedicated hardware. --> But the solution depends on the hardware you want to use.

Klaus
Yes ATmega328P in Arduino UNO I am using and trying to store time value as a counter of minutes and hours.
I want something like this below:
Hours:Minutes:
Start:
00:00
00:01
.
.
.
.
00:59
01:00
.
.
.
.
02:30
power-off and 02:30 is saved in EEPROM actually it is saved at every time when on.
then power on again
02:30
02:31
02:32
.
. and so on.
 

Hi,

if you want to save in EEPROM.
You first need to detect early_power_down ... before VCC starts to fall.
Then you need to have enough energy stored in capacitors to safely write the data into EEPROM.

A workaround is to safe the current runtime in EEPROM every minute (not only at power down).

I didn´t read the datasheet .. but you should do.
* how much time is needed to write the data to the EEPROM. (for the size of the capacitors)
* how often you may write to the EEPROM. (wear out)

Klaus
 
Hi,

if you want to save in EEPROM.
You first need to detect early_power_down ... before VCC starts to fall.
Then you need to have enough energy stored in capacitors to safely write the data into EEPROM.

A workaround is to safe the current runtime in EEPROM every minute (not only at power down).

I didn´t read the datasheet .. but you should do.
* how much time is needed to write the data to the EEPROM. (for the size of the capacitors)
* how often you may write to the EEPROM. (wear out)

Klaus
Datasheet mentions 100,000 write EEPROM cycles means every minute writing in EEPROM it will scrap in 69 days :unsure:.
 

Attachments

  • pic1.png
    pic1.png
    58.6 KB · Views: 88

..
so either
* suitable external memory, or
* early power down signal

Klaus
 
FRAM for storage a possibility, 100 trillion write cycles -




I would approach this once/day synced to NET time with an ESP8266 to get net time,
and an arduino to do the power control/power down/sleep.





Regards, Dana.
 
Last edited:
Hi,

or you supply the AVR with a backup battery - in power down it draws just 0.2uA - and use the AVR internal RAM.

Klaus
 
FRAM for storage a possibility, 100 trillion write cycles -




I would approach this once/day synced to NET time with an ESP8266 to get net time,
and an arduino to do the power control/power down/sleep.





Regards, Dana.
Great very nice Dana 100 trillions write cycle is enough for my project.
Thank you.
--- Updated ---

Hi,

or you supply the AVR with a backup battery - in power down it draws just 0.2uA - and use the AVR internal RAM.

Klaus
Yes it is also an option but I Dana send me FRAM usage it is best for my project.
Thanks you all.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top