Fitting a Real Time Clock to an Argon One V2 Case

I have an RPi 4B in an Argon One V2 Case. Is there any option for fitting a Real Time Clock with it in this case?

Hi Trevor,

You could plug an RTC into the exposed headers easily enough, but it’s a little messy.

To have an internal solution you might be able to fit this QWIIC shim (SparkFun Qwiic SHIM for Raspberry Pi | DEV-15794 | Core Electronics Australia) in the case and use a QWIIC compatible RTC (Adafruit PCF8523 Real Time Clock Breakout Board - STEMMA QT / Qwiic | ADA5189 | Core Electronics Australia) and a cable (PiicoDev Cable 100mm | Core Electronics Australia). It’d all be solder free. Teh QWIIC shim is just I2C so you could probably connect any I2C RTC to it.

2 Likes

Hi Trevor,

Welcome to the forum!!

Are you looking to take your Pi off-grid? If you aren’t the Pi automatically grabs the time from an NTP server and updates the system time.

Liam

1 Like

Hi Liam,

The Pi is plugged in 24/7 running weather software. Problem is when there is a power outage the Pi starts with the wrong time and usually takes about 10 minutes for the update from an NTP server. The data catch-up on the weather software is time dependant which means it either doesn’t bring in all the missing data or logs it against the incorrect timestamp. I think an RTC is the only way to overcome this.

Regards,
Trevor

2 Likes

Hi Doug,

You say an RTC could be plugged into the exposed headers but it’s a little messy. Do you mean it just looks messy or do you have to do some special wiring to get it connected to the header?

I’m a novice with the RPi so will everything you have suggested with the internal solution fit into the Argon One V2 case? Would someone be able to provide me with detailed instructions to connecting it all up if I go ahead and purchase the various components?

Regards,
Trevor

1 Like

Hi Trevor,

The Argon 1 case has a magnetically attached cover (1) for the GPIO pins (2)
image

If you lift that off you could plug in a RTC module like this one Adafruit PiRTC - PCF8523 Real Time Clock for Raspberry Pi | ADA3386 | Core Electronics Australia in top of the pins here
image

The shim etc I suggested earlier you’d have to take the current setup apart, put the shim on, plug the cable and RTC together then see if/where you can fit it while you reassemble.

Hope that helps

2 Likes

Thanks Doug. I’ll think about which way I want to go. I see the ADA3386 is not in stock. Any idea when it might be available to order?

Regards,
Trevor

1 Like

Hi Trevor,

Unfortunately there isnt an ETA at the moment, if you click the ‘Sign up to get notified’ button on the product page we’ll send an email once the ADA3386 modules are back in stock :slight_smile:

There’s a range of other RTC’s with a similar form factor that might be worth checking out if you need one ASAP, just be sure that there is example code! https://core-electronics.com.au/catalogsearch/result/?q=pi+rtc

Are you able to modify the software to hold on to the data while the time is being confirmed?

Liam

1 Like

Hi Liam,

I looked through the other products and the only one I can see that appears would plug into the header pins of the Argon One V2 case is DS1307 RTC Module. It doesn’t say whether it supports RPi 4B so could you please confirm compatibility and that it will plug into the exposed header on the Argon case.

With the weather software it runs as a service. I can disable the service before installing and configuring the RTC so it doesn’t upset anything. When I start the service again it will catch-up any missing data.

Regards,
Trevor

3 Likes

Hi Trevor,

Electrically that one will be compatible as the 40-pin header hasn’t changed.

However it unfortunately won’t fit onto the top of the Argon ONE case, the coin cell battery underneath will keep if from being inserted into the header.

When trying to cram a board to do a set function into a small space it usually requires something custom built.

To keep your project rolling a different enclosure might be the easiest way forwards? The HighPi is a great case and can fit a wide range of HATs inside!

Liam

2 Likes

Hi Liam,

I had gone ahead and ordered the Real Time Clock Module, SKU CE04865 before your reply came in. It was inexpensive so thought it was worth a shot. I have installed it and it seems to be working fine. The battery does keep it up slightly but it has sufficient contact into the header for it to work.

Regards,
Trevor

1 Like

Fyi, Raspberry Pi OS uses systemd by default for this sort of thing (delaying units that depend on time sync).

Please use a backup of your uSD just in case there are unintended outcomes…

Then, ensure systemd-timesyncd.service is being used:

sudo systemctl enable --now systemd-timesyncd.service

Configure time-sync.target to wait until time is synchronised:

sudo systemctl enable --now systemd-time-wait-sync.service

Edit your the desired service settings:

sudo systemctl edit <name>.service

Add/edit:

[Unit]
After=time-sync.target
Wants=time-sync.target

Test by rebooting and then from terminal run:

sudo journalctl -b \
    -u systemd-timesyncd.service \
    -u systemd-time-wait-sync.service \
    -u time-sync.target \
    -u <name>.service

The log should show entries that confirm the service was only started after time was synced.

I am also quite interested to know if after this setup the delay is still 10 minutes or just a few seconds.

Also worth a look in if missing data is of concern, use a Power Bank so that the RPi will stay on if power is unavailable for periods of time. The battery bank will shut down when depleted and a manual power on will be needed. You should get 10-15 hours with something like this:

2 Likes

Hi Gramo,

I was using delays in my service file as follows -

[Unit]
Description=CumulusMX service
Documentation=https://cumuluswiki.org/a/Main_Page
Requires= time-sync.target local-fs.target
After=network-online.target
Wants=network-online.target

I probably didn’t have everything configured properly as it wasn’t delaying start-up. Now that I have the RTC working it’s not really an issue for me anymore. I did consider a Power Bank but the weather station has data logging which allows catch-up in the case of system downtime.

Regards,
Trevor

3 Likes

Glad to hear you have it going :slight_smile:

2 Likes