# How do electronic devices keep track of time without power?

There's laptops, PCs, microcontrollers and a lot of other things that can be plugged out and plugged in without a battery. But how does the system clock still keep track of time without anything to power it?

• -1 for thinking that a device can work without a power source. You should have asked what is the power source. – Quora Feans Oct 3 '15 at 9:28
• @QuoraFeans I don't see any assumption that the device can work without a power source. I understand the question to be asking "when I plug it back in after it's been unplugged for a while, it has the right time. how does it do this?". – Don Hatch Oct 4 '15 at 0:10

They use a small backup battery, which you can read about on Wikipedia:

Modern personal computer motherboards have a backup battery to run the real-time clock circuit and retain configuration memory while the system is turned off.

In computers this is usually called the "BIOS battery" and is generally a lithium cell such as a CR2032. In the photo below it is circled in red:

This is the same for portable devices which have their own battery, for example a laptop. You can prove this by removing the internal battery and seeing if it keeps the time.

So to answer your question they don't really keep time without power, they have a battery for it.

• And when that battery goes dead, very strange things can happen. I got a "broken computer" from someone I knew once after they bought a new one because they were tired of trying to get it to work... It cost me $2 for a new battery, and it worked great for years. They never knew the computer had a battery. – JPhi1618 Oct 2 '15 at 15:50 • It's not always a battery. My digital camera has a capacitor that can keep the clock running for a week or two, more than enough time for me to change the batteries. – Mark Oct 2 '15 at 21:51 • @JPhi1618 People just aren't comfortable with opening up computers. It's amazing how many "slow" or "broken" computers can be fixed by simply blowing dust off the CPU fan. – Dmitry Grigoryev Oct 2 '15 at 22:03 • Second the bit about laptops. I've got an old one here, it works but the CMOS battery is dead--it won't keep time anymore. It's a$2 fix--if I could find the stupid battery. Even the repair manual doesn't say where it is hiding. – Loren Pechtel Oct 3 '15 at 4:35
• Also many motherboards just refuse to let you into the BIOS settings if the battery is dead,but would otherwise allow you to start the computer just fine. – vsz Oct 4 '15 at 18:55

Modern equipment often uses ultra-capacitors to keep real-time clock powered when the system is off:

This is a typical solution for most mobile phones which are almost constantly powered and only need the back-up power when the user removes the battery.

• Do iOS and Android smartphones have something like this? – voices Oct 4 '15 at 11:54
• @RozzA: I don't really know what you're talking about. I think you're making a few incorrect assumptions about my simple query. – voices Oct 5 '15 at 12:31
• @MSalters So that if you travel someplace with no network coverage, you'll get your alarm in the morning and don't miss your bus go get out of the creepy place. – Dmitry Grigoryev Oct 5 '15 at 12:31
• @DmitryGrigoryev: You'd need a proper battery for that anyway, an ultracap won't do. The ultracap generally is there just to cover a short loss of primary power. But why save the RTC when temporarily removing a phone's battery? You'll just grab the network time when the battery is reinserted. – MSalters Oct 5 '15 at 12:37
• @MSalters but what if you remove your battery when in an out-of-coverage region? – Paŭlo Ebermann Oct 5 '15 at 12:40

While the other answers are definitely true: electronic devices cannot keep track of time without a power source, there are other considerations that can give the illusion of keeping track of time:

• connected devices ask for a time synchronisation as soon as they connect: computer usually gets it from the internet using NTP (network time protocol), GSM devices can also get it from their local cell tower.
• there are multiple services broadcasting time over the air waves: GPS is just a worldwide broadcasting system of an incredibly precise time. there are AM radio stations whose sole purpose is to broadcast their current time
• finally some smaller systems (microcontroller and embedded systems) do not really need an accurate time, just guarantee that time always flows in the same direction. They would save their timestamp every now and then in a permanent memory area and restart from their last known time on next start.

NTP is defined by RFC 5905

• It's not a good idea to write "the above answers" because the order could change as people vote on them. Your answer is currently the newest but no longer the last one on the page. – CJ Dennis Oct 3 '15 at 4:37
• As a practical example of the first: that is exactly what the Raspberry Pi does. – Martijn Oct 5 '15 at 12:56

Without a power source an electronic device can't keep track of time. Batteries are power sources so they can't be thought of as being able to keep time without power.

There is another strategy that doesn't keep track of time. When you 'sync' your device with the computer time on the device is synchronized.

• Or from GPS, or from the phone network. – David Oct 2 '15 at 16:29
• Or any other time source. – Lightness Races with Monica Oct 3 '15 at 16:35
• @LightnessRacesinOrbit like the user – ratchet freak Oct 3 '15 at 17:48

Besides the "big flat battery on a computer motherboard", there is another device other answers don't mention: the RTC (real time clock).

Some microcontrollers do have such a feature, by having an internal battery inside the chip, which can keep the time for decades without external power.

• Can you include some detail about microcontrollers with an internal battery? Many have pins for a separate external source (e.g. supercap or battery) but I've never seen one with a battery "inside the chip". – David Oct 4 '15 at 20:17
• st.com/web/catalog/sense_power/FM151/CL1410/SC403/… – oakad Oct 5 '15 at 0:21

## protected by W5VO♦Oct 3 '15 at 19:37

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).