PiicoDev Real Time Clock (RTC) RV3028 (CE08239)

This is a placeholder topic for “PiicoDev Real Time Clock (RTC) RV3028” comments.

Accurate timekeeping, even during a power outage.

Read more

Hi, I recently bought two RTC PiicoDev modules and noticed that one of them holds the time for a couple of hours when disconnected whilst the other one can hardly manage a few minutes. Is it possible to de-solder the capacitor and attach a small cell battery instead?

I look forward to your reply.

Thank you.

2 Likes

Hi all
When I followed the link to find out a bit more about this device I clicked on a couple of links listed at the end of the description. I was connected to a GitHub page which required a sign in. The link to the schematic is one of them. Why is this. Does this mean one needs a GitHub account to sign in to view the schematic and is this scenario going to apply to future PiicoDev modules.
Cheers Bob

2 Likes

Hi Bob,

It looks like the link 404’d - the repo might be private since its a relatively new module. Come Monday it should be fixed :smiley:

Physically the Makerverse RTC and PiicoDev ones look very similar, while not exactly the same schematic here’s a similar one: https://github.com/CoreElectronics/CE-Makerverse-Supercap-Real-Time-Clock-RV3028/blob/main/Documents/schematic-makerverse-supercap-real-time-clock.pdf
(The charging circuit and main IC are the same)

Hey Socrates,

While not the main use case you certainly can, there’s a THT test point on the pack that you could attach a wire to any compatible power source.

It’s interesting that it only lasts a few minutes/hours though, did you have the module resting on anything metal or have you disabled the trickle charge?

1 Like

Hi,

Thank you for the reply.

One was resting on a timber surface and the other on an acrylic rig.

I gather the THT test point is on the back in the middle of the circuit board…correct?

I was thinking more in line of removing the capacitor and soldering a battery in its place.

Can you disable the trickle charge in software?

Many thanks for your help.

Regards

1 Like

I bought one of these and a Makerverse one.
The Makerverse one holds the time for a few days.when not powered.
The PiicoDev lasts maybe 10 minutes, certainly not an hour. It is not fit for purpose, a recent power outage lasted over an hour.

I have yet to do more testing on it, but a bit of a disappointment given the other PiicoDev products are excellent.

Cheers
Jim

1 Like

Hey @James46717 - it sucks to hear that your PiicoDev RTC didn’t work out. The two products use virtually identical application circuits so it sounds like something else is amiss here.
Perhaps @Trent5487676 can weigh in.

1 Like

Hi Jim,

That is an interesting issue as Michael pointed out those two modules have more similarities than differences regarding the hardware side of things.

I’ve included download links for the two schematics below, the most major difference between the two that I can spot is that the current limiting resistor is smaller on the Makerverse unit, which should have the opposite effect if this was a power drain due to hardware differences.
PiicoDev version Schematic
Makerverse version schematic

Given both units are specced the same I think the best test will be to add headers to the PiicoDev unit, then swap it with the Makervse unit so they have same software configuration. If both are connected to the same hardware peripherals and running on the same libraries then they should have the same power draw and battery life. If the same code and peripherals gives a different result we’ll know there is a hardware defect with one unit and be able to sort that our as an RMA under warranty.

1 Like

I think I might be wrong in what I said. I have been focused on the project development and not looked in depth at why the PiicoDev RTC is losing its time. Now the project is complete and working nicely, time to investigate the RTC.

The RTC is read by a Pi Pico on power up to set the time for the Pico RTC. The Pi Pico has run for days without a problem, it own RTC keeps good time. It is only when the mains power is switched off the RTC loses its time and it only happens after the Pico had been running for a number of days.

I did some bench testing and the PiicoDev RTC keeps its time ok for up to an hour. Didn’t test any longer than that. Now I intend to leave it on for 24 hours, then turn it off and on again and see what the time does. Might have to leave it longer.

Its possible there is a bug in my software when the time loops past midnight.

Anyway, I don’t think the unit is faulty.

Regards
Jim

4 Likes

Recent testing showed the problem I am experiencing with the PiicoDev RTC relates to the time going past midnight. After running over night the time the Pico displayed was correct, removed power and reconnected it, the time showed 00:00.

I then set the time to 23:55 and waited till it went past midnight, removed and reconnected power and the same thing happened.

Now I intend to leave the device unpowered for a number of hours during the day and see how the RTC holds up. To try and get an understanding of how long the capacitor will last. But it seems the problem is related to the time going past midnight.

Regards
Jim

3 Likes

Further testing. Added code to my program to read the RTC every 3 minutes and print the result in Thonny. The RTC runs perfectly keeping accurate time, over midnight it still increases ok and any other time.

But … if it started before midnight and then runs past midnight and the power is removed it comes back with 00:00. The print out on Thonny shows it was keeping the correct time immediately prior to power off.
Set a time then run it for a while and power it off it comes back with the correct time as long as it has not gone past midnight.

This seems to me to be something in the way the chip is setup or not as the case maybe. And something related to change of day. ie run past midnight.

More investigation needed I think, now where is that datasheet.
Maybe look a the Makerverse code, it uses the same chip, I think.
Cheers
Jim

PS wonder if anyone else has experienced something similar.

2 Likes

Hi Jim,

It uses the same chip so swapping out the libraries might be worth a shot!
Very interesting bug, would it be possible to grab a copy of your your RTC code so we can replicate something here?

Regardless we’ll investigate :smiley:
Liam

1 Like

Hi Jim,

Thanks for sharing your results, that is interesting and I agree with Liam. It would be interesting to try with the alternative Makerverse library as it is functionally the same hardware. If there is a bug in one library we’ll work towards getting it patched.

@James46717 nice detective work -This will help us attempt to replicate in-house. @Liam, @Trent5487676 I’ll add this to next week’s tasks.

2 Likes

I think the libraries are solid and they look pretty much the same, small differences. The register values written to the RTC are the same. Extensive examination of the datasheet shows nothing out of place. Still I cannot find anything to explain why I am experiencing what I am.

Possibly it is how I am using the RTC. The Pi Pico device is a very simple single watering circuit I built it to keep water to a few plants while we were away on a cruise ship. It can be set to skip up to 2 days. It had been working nicely before our trip. When we got back it was stuck at the enter time screen. There had been a power failure, unsure when. So I decided to add a RTC.

The Pi Pico reads the RTC on power up and sets its own RTC then uses this time to turn the watering system on and off. A menu option allows setting of the time which then updates the RTC time. It does not access the RTC while running except for when the time is changed through the menu option or a power failure.

It was not until another power failure I realised something was not working correctly with the RTC and I began my investigation. Initially I thought the capacitor was losing its charge somehow, static or something else but that has proved incorrect. I should delete my previous post where I said it only lasted for 10 minutes, I was wrong there, apologies.

I have a solution.
The Pi Pico resets itself at 00:00:00 via machine.reset() and the problem seems to have gone away. Power loss after that returns the correct time. Interesting.

Testing continues.
Regards
Jim

1 Like

I have a Pico with RV3028 RTC, and a VL53L1X sensor. Been banging away debugging stuff for a while, I would have thought the RTC capacitor had heaps of time to charge. However…

I made a few minor changes to my breadboard hookup… which meant disconnecting the I2C cable briefly. I was disappointed to find that the RTC had lost its time… reset to zero. Was only disconnected for a short while.

So… I looked into the library, there are methods to set trickle charge etc… which I have never used. It’s not real obvious what parameters to use…

I did wonder if the RTC capacitor may have been drained by the distance sensor. I have a LiPo on my expansion board, but can’t be sure if at some point I had the LiPo disconnected… but the RTC effectively still connected to the distance sensor.

Asked on the support chat… they advise i look for answers on the forum - so, here I am, looking for words of wisdom?

Any help appreciated,
T

1 Like

Hey @Trevor277988,

What an interesting problem, would you be able to share a schematic or photos of how you have these modules connected?

I would be surprised if the VL53L1X sensor managed to drain the capacitor in this module but I would be curious to see how you have this configured.

How long would you say it took for the capacitor to drain once you disconnected the I2C cable?

It’s pretty simple… Pico on an expansion board with LiPo… I2C cable to RTC, then chained to VL53L1X. Other parts to my build include an RGB LCD1602. On the same I2C bus, but wired directly from the Pico… not via the little I2C daisy chain.

LiPo is fully charged. Have been messing about with this for weeks… so many hours of it all being connected (and I presumed, charging the cap). One minor detail… I did have (until today) a Pico splitter board in there… ie Pico to splitter, one side to RTC, another side to distance sensor. I would hope that does not change things!

In my final build I won’t need the splitter I will do some more tests this arvo and report back… but have no clue what this method in the library does…:

    def configTrickleCharger(self, R = '3k'):
        tmp = self._read(_EE_BACKUP, 1)
        tmp = _setBit(tmp, 7)
        if R == '3k':
            tmp = _writeCrumb(tmp, 0, 0b00)
        elif R == '5k':
            tmp = _writeCrumb(tmp, 0, 0b01)
        elif R == '9k':
            tmp = _writeCrumb(tmp, 0, 0b10)
        elif R == '15k':
            tmp = _writeCrumb(tmp, 0, 0b11)
        else:
            print("R parameter must be '3k', '5k', '9k', or '15k'")
            return
        self._write(_EE_BACKUP, tmp.to_bytes(1, 'little')):

There is also

def setTrickleCharger(self, state = True):

Does this need to be called to start charging the capacitor? Who knows?

Finally… occcasionally I have had to resort to machine.reset() in the Thonny REPL. AFAIK this leaves the RTC’s time untouched. Just sayin…

More results to follow…

Cheers,
T
PS… reading the driver more thoroughly, I see the above methods are called during init… so, no issues there.

Hi Trevor,

As you’ve spotted these functions are called in the initialisation to set the rate of charging for the RTC.

The supercapacitor is only connected to the RTC’s V_backup so it shouldn’t be discharging for other things in your circuit.

Have you been able to test how long the RTC continued after being disconnected from power?

Hi Everyone,
Is it possible to return the voltage level from the capacitor?
This is so I can determine how long it might be able to keep the time for.
It seems the only way to tell at the moment is to unplug it for a while and see if it works.
Thanks
David

1 Like