Questions tagged [rtc]

Real-Time Clock. Keeps track of current date/time. Some have batteries like the DS3231, and the DS3231 also has programmable alarms that can interrupt an Arduino.

Real-Time Clock. Keeps track of current date/time. Some have batteries like the DS3231, and the DS3231 also has programmable alarms that can interrupt an Arduino.

188 questions
10
votes
3 answers

Convert to and from Unix Timestamp

What is the best way to convert between date, hours, min, seconds to Unix timestamp in milliseconds in Arduino? I need to have this conversion, since I'm using RTC (date, hours, min, secs etc) and communicating Unix timestamp over BLE I found some…
Dzung Nguyen
  • 417
  • 1
  • 8
  • 17
8
votes
1 answer

The difference between "time_t" and "DateTime"

I've run into an issue trying to combine 2 different Arduino timer projects I've found online. For both projects I'm using a DS3231 RTC, but have been able use the DS1307 library just fine in my code. The first set of code I picked up started…
Vinterwoo
  • 259
  • 2
  • 4
  • 7
5
votes
0 answers

How to set ESP32 RTC clock source

According to the manufacturer's link below, the default RTC timekeeping in the ESP32 is supposedly based on Internal 150 kHz RC oscillator. Apparently, there is another option called Internal 8.5 MHz oscillator, divided by 256 (~33 kHz) that has…
Randy
  • 407
  • 3
  • 13
5
votes
1 answer

ESP32 how to preserve RTC time during brownout

I want to use the ESP32 built-in RTC clock. In my situation, my ESP32 will not have access to an NTP server I do not want to use external RTC modules ESP32 provides a pin VDD_RTC will powers the RTC domain exclusively My problem would be solved if I…
mquevedob
  • 51
  • 3
5
votes
3 answers

Calculate absolute time based on cycles and RTC

I'm developing a low power data logging device. It samples sensors at the frequency of 20Hz, and also has a real time clock for absolute time (the logged time need to be exact down to ms). I think that querying time for every samples would be…
Dzung Nguyen
  • 417
  • 1
  • 8
  • 17
5
votes
10 answers

DS1307RTC Outputting cryptic 165/165/2165 date. What are some possible fixes?

My board. I think I have it wired correctly (the lights aren't, but the board is). I've read through the first few Google results to no avail. My sample code to test the chip: // Date and time functions using a DS1307 RTC connected via I2C and…
Rashi Abramson
  • 181
  • 1
  • 2
  • 9
5
votes
1 answer

RTC resets when power is off

I have a few RTC modules with a batteries. All of them have this same issue with my project. They work fine when connected via USB. But if I disconnect the power then reconnect they reset to Jan 1 2000. I've read several posts about similar…
futurebird
  • 425
  • 5
  • 15
4
votes
2 answers

RTC interrupts and coin batteries

Summary I'm having problems with my RTC draining its coin cells quickly - fresh batteries are drained in a few months. The RTC is set to signal an interrupt every 5 minutes, and I wonder - if there is no other power attached to the circuit, is that…
Tyler
  • 217
  • 2
  • 10
3
votes
2 answers

Nextion Display not getting updated data

I am using an Arduino Mega to display the readings of 4 pots on a Nextion Display as well as store them on an SD Card with a time stamp. I keep getting: recvRetCommandFinished err on the serial monitor and the display does not update with time. I…
3
votes
2 answers

Set control register to low in ds3231 rtc

I have been using ds3231 rtc module for keep tracking and make alarm along with backup battery. when I used it for first time it worked fine. but now it doesn't keep track my time when the power lose it from main power but I have checked that my…
3
votes
2 answers

How to wake up Arduino with an rtc?

I am doing a data logger with an Arduino Mega2560 and I want to use a code to make it sleep when no measure is needed and wake it up with an RTC when time comes. The reason I want this is because I intend to run the code on a Pro Mini later so I…
JamesONeil
  • 75
  • 8
3
votes
0 answers

Scheduling and BLE Read on demand

I'm building a data logging device with BLE capability using RFduino. Sensors are read using timer interrupt to a buffer. When the buffer is full, then the whole buffer is written to SD card. At the same time, I have BLE_Receive to set time of the…
Dzung Nguyen
  • 417
  • 1
  • 8
  • 17
3
votes
3 answers

How to have some code executed at a certain time of day with a DS3231 RTC?

I recently bought a DS3231 RTC, but I cannot seem to figure out how to get it to work. I have tried all different tutorials and example programs but I keep getting 2165.25.165 165:165:165 as the output. I am using an Arduino Micro, with the RTC…
Zelkins
  • 135
  • 1
  • 6
3
votes
1 answer

How to set Alarms on the DS3231 easily so the Nano doesn't have to go to sleep with delay statements?

I want my solar array sun tracker to shut down at night then move full east in the morning to catch the first rays. I know the DS3231 can set alarms but it is not clear from its documentation how to do it with the normal library. Delay…
SDsolar
  • 1,175
  • 3
  • 11
  • 35
3
votes
1 answer

Comparing time_t values within an if statement

I am using an UNO with a RTC to control a light board. I'm using a simple control structure to decide when to turn things off and on. It's my understanding that a time_t value is just a number (number of seconds since 1970), and that I should be…
Vinterwoo
  • 259
  • 2
  • 4
  • 7
1
2 3
12 13