TS2493 Jaycar Electronics Group RV-3028 Real Time Clock with Supercapacitor Backup (Blue and Eco-friendly): Difference between revisions
Keyestudio (talk | contribs) No edit summary |
Keyestudio (talk | contribs) No edit summary |
||
Line 30: | Line 30: | ||
== '''4.Schematic Diagram''' == | == '''4.Schematic Diagram''' == | ||
<br> | <br> | ||
[[File:TS24934.Schematic Diagram 1.png| | [[File:TS24934.Schematic Diagram 1.png|1100px|frameless]]<br> | ||
<br> | <br> | ||
[[File:TS24934.Schematic Diagram 2.png|500px|frameless]] | [[File:TS24934.Schematic Diagram 2.png|500px|frameless]] | ||
[[File:TS24934.Schematic Diagram 3.png|500px|frameless]]<br><br> | [[File:TS24934.Schematic Diagram 3.png|500px|frameless]]<br><br> | ||
== '''5.Wiring Diagram''' == | |||
<br><br> | |||
== '''6.Test Code (For ''Thonny'')''' == | |||
<br> | |||
<pre> | |||
from machine import I2C, Pin, ADC | |||
import time | |||
from Makerverse_RV3028 import Makerverse_RV3028 | |||
# Interval, in seconds, between data samples | |||
logInterval = 1 | |||
i2c = I2C(0, sda = Pin(0), scl = Pin(1)) | |||
rtc = Makerverse_RV3028(i2c = i2c) | |||
# ADC on Pin GP26 | |||
adc = ADC(0) | |||
while True: | |||
x = adc.read_u16() | |||
print(rtc.timestamp(), x) | |||
# Opening with "a" for appending | |||
with open("datalog.csv", "a") as f: | |||
f.write(rtc.timestamp()) | |||
f.write(',') # Comma separator | |||
f.write(str(x)) | |||
f.write('\n') # New line | |||
f.flush() # Ensure data is written | |||
f.close() # Really ensure data is written | |||
# Wait for "logInterval" seconds | |||
timeNow = rtc.getUnixTime() | |||
while rtc.getUnixTime() - timeNow < logInterval: | |||
time.sleep_ms(100) | |||
continue | |||
</pre> | |||
<br><br> | |||
== '''7.Test Result''' == | |||
<br> | |||
After uploading code, Shell interface prints current time and refreshes every 100 ms.<br> | |||
[[File:TS24937.Test Result.png|700px|frameless]]<br><br> |
Revision as of 16:52, 16 June 2023
1.Description
Loads of projects require accurate timekeeping. Whether you're building the ultimate alarm clock or making a custom datalogger, keeping accurate time is easy and safe with our Real Time Clock (RTC). Unlike most RTC modules, this one is backed up by a supercapacitor instead of a lithium battery - making it safer for use indoor. When connected to power, the RTC trickle-charges the supercap in just a few minutes - enough to keep the clock going for a couple of weeks once power is removed. The onboard RV-3028 handles timekeeping and date with 1ppm accuracy and has an incredibly low power consumption (45nA at 3V).
2.Parameters
Accuracy: ±1ppm @ 25°C
Working Temperature: -10°C ~ +50°C
Dimensions: 22.5 x 24 mm
Positioning Holes: 2 x M3, spacing 18.923 mm
Weight: 3.5 g
3.Features
- Safer for indoor use - no lithium battery
- Tracks year, month, day, weekday, hour, minutes, seconds
- Supercapacitor backed - keeps time for two weeks after power is removed
- Automatically switches between main power and backup power
- High accuracy clock - loses about 30 seconds per year
4.Schematic Diagram
5.Wiring Diagram
6.Test Code (For Thonny)
from machine import I2C, Pin, ADC import time from Makerverse_RV3028 import Makerverse_RV3028 # Interval, in seconds, between data samples logInterval = 1 i2c = I2C(0, sda = Pin(0), scl = Pin(1)) rtc = Makerverse_RV3028(i2c = i2c) # ADC on Pin GP26 adc = ADC(0) while True: x = adc.read_u16() print(rtc.timestamp(), x) # Opening with "a" for appending with open("datalog.csv", "a") as f: f.write(rtc.timestamp()) f.write(',') # Comma separator f.write(str(x)) f.write('\n') # New line f.flush() # Ensure data is written f.close() # Really ensure data is written # Wait for "logInterval" seconds timeNow = rtc.getUnixTime() while rtc.getUnixTime() - timeNow < logInterval: time.sleep_ms(100) continue
7.Test Result
After uploading code, Shell interface prints current time and refreshes every 100 ms.