# RV3028 on a Motor 2040

**URL:** <https://forums.pimoroni.com/t/rv3028-on-a-motor-2040/19881>\
**Category:** Support\
**Created:** [July 21, 2022, 12:08am UTC](https://forums.pimoroni.com/t/rv3028-on-a-motor-2040/19881 "2022-07-21T00:08:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Angel1](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/angel1/32/8891_2.png) [@Angel1](https://forums.pimoroni.com/u/Angel1)\
**Post date:** [July 21, 2022, 12:08am UTC](https://forums.pimoroni.com/t/rv3028-on-a-motor-2040/19881/1 "2022-07-21T00:08:51Z")

</div>

I am new to Pico and the Motor 2040. I would like tobe able to get the RTC to run on the Motor 2040. I have done a bit of googling on the subject but no luck. Is it even possible to get time onto the Motor 2040. I have two motors doing what I want be no luck with the RV3028. Any pointers appricated

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [July 21, 2022, 7:52am UTC](https://forums.pimoroni.com/t/rv3028-on-a-motor-2040/19881/2 "2022-07-21T07:52:48Z")

</div>

Your adding the RTC to the Pico, not the motor shim. Think of it that way and it may be easier to sort out. I have one wired up to a Pico Lipo via i2c.  
You’ll need to setup i2c.  
I used pins 4 and 5 as those are the pins used by the Qw/ST connector on my Pico Lipo.

```auto
from pimoroni_i2c import PimoroniI2C
i2c = PimoroniI2C(sda=(4), scl=(5))

```

Then you need to setup the RV3028.

```auto
import time
from breakout_rtc import BreakoutRTC

```

I also added the following code from one of the examples, and so far mine works and keeps accurate time. I’m not 100% sure its needed though?

```auto
rtc.set_backup_switchover_mode(1)
rtc.set_24_hour()
rtc.update_time()
rtc.enable_periodic_update_interrupt(True)

```

The above code is all in the section above the while true loop.  
[Raspberry Pi Pico GPIO Pinout](https://pico.pinout.xyz/)

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [July 21, 2022, 8:07am UTC](https://forums.pimoroni.com/t/rv3028-on-a-motor-2040/19881/3 "2022-07-21T08:07:45Z")

</div>

If you don’t want to do any soldering etc. You’ll need one of these,  
[STEMMA QT / Qwiic to Breakout Garden Adapter - Pimoroni](https://shop.pimoroni.com/products/stemma-qt-qwiic-to-breakout-garden-adapter?variant=39308432703571)  
And a JST-SH to JST-SH cable.  
[JST-SH cable - Qwiic / STEMMA QT compatible - Pimoroni](https://shop.pimoroni.com/products/jst-sh-cable-qwiic-stemma-qt-compatible?variant=31910609813587)

---

<div class="post-metadata">

**Author:** ![Angel1](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/angel1/32/8891_2.png) [@Angel1](https://forums.pimoroni.com/u/Angel1)\
**Post date:** [July 22, 2022, 9:42pm UTC](https://forums.pimoroni.com/t/rv3028-on-a-motor-2040/19881/4 "2022-07-22T21:42:45Z")

</div>

Hi, this is me again and I got the RTC working (crudely but working).

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [July 22, 2022, 10:01pm UTC](https://forums.pimoroni.com/t/rv3028-on-a-motor-2040/19881/5 "2022-07-22T22:01:02Z")

</div>

Nice to hear you got it working. =)

The set time example should set it based on the time on the host PC. It’s a quick and easy way to set the date and time to your time zone. Assuming the host PC is setup that way that is.  
[pimoroni-pico/micropython/examples/breakout\_rtc at main · pimoroni/pimoroni-pico · GitHub](https://github.com/pimoroni/pimoroni-pico/tree/main/micropython/examples/breakout_rtc)

I ran it on my Pi 400 in Thonny and it was easy peasy.
