RTC Problem

I am unable to get the RTC working on my IND.IO device. I have looked at all of the forum articles including the blog, installed the coin battery, but the clock does not increment.

I just ordered 10 of these from Mouser and I got the CR1220 batteries for them all. My project requires an rtc for scheduling.

So I opened another Ind.Io and the clock on that one seems to be working. How can I get the one that is not working replaced?


Dries Van Craen
Dries Van Craen
| 0 0 0
Asked on 6/20/21, 2:04 PM

I don't know if this is the source of your problems, but the MCP7940 library for the RTC has 4 bugs;

Setting the second can corrupt the RTC.
Setting the month can corrupt the RTC.
It won’t allow the date to be set on the 31st of the month.
It will allow an invalid day of the week value of 0.

Once the RTC is corrupted, it’s behaviour can become very strange.

It is possible to stop and start the clock from code and it is possible for the bug relating to setting the seconds to stop the clock. 

As the MCP7940 library is not being maintained, I wrote a new library from scratch for my Industruino projects.


If you use my code and call setSecond() it should start the clock.

Neil Wells
Neil Wells
| 1 0 0
Answered on 6/20/21, 3:28 PM

Thank you for your help. I tried your library and sketch on the now three ind.io devices where the clock is not incrementing. When I run your sketch I just get nothing on the serail monitor. If I remove the if (rtc.newSecond()) clause I get 0s. Wow I am really worried now. I now have THREE ind.ios where the clock does not work. The one that the clock is working in is having an issue with the ethernet board. Maybe you can't use both at the same time? I have spent about a month on this project. I wish I would have verified that all of the hardware worked before I went down this path. This is horrible. I hope this is a fluke with the boards I have. I am getting some more maybe those will work right. If they are not maintaining the library does this mean these boards are obsolete? I hope someone from Industruino can help!

Dries Van Craen
on 6/20/21, 5:37 PM

Many thanks Neil, i have added a link to your library in our github docs

on 6/21/21, 6:08 AM

I'm using this library: https://github.com/Zanduino/MCP7940 Seem to work, and is well maintained

Enrico Michieletti
on 6/24/21, 4:36 PM

Hi Dries,

Please upload the demo sketch https://github.com/Industruino/democode/blob/master/rtc_D21G/rtc_D21G.ino and send us a screenshot of the Serial Monitor output to connect@industruino.com

| 1 1 3
Answered on 6/21/21, 6:07 AM

I sent the requested items. Have you received them?

Dries Van Craen
on 6/22/21, 1:24 PM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

63 follower(s)


Asked: 6/20/21, 2:04 PM
Seen: 1236 times
Last updated: 6/21/21, 6:07 AM