My RTC module works only when the board is powered via USB

Hi community,

First time poster, so I apologise if I'm posting to the wrong forum of a crap post you're about to read :slight_smile:

So, I've built a board with an RTC module, an LCD display and some relays. Everything works as it should and my system is functioning properly, except when I power it down and turn it back on. When my board us running off of 12V VIN pin my system isn't getting the time from the RTC module. but, when I plug the USB in it picks up the time from the RTC.

My RTC is running on A4 and A5 together with the LCD which is also using a serial module on the same pins. However, even without the LCD connected the time is incorrect until the USB is plugged in.

This really doesn't make sense from everything I read. The RTC module is this one:

https://www.jaycar.com.au/medias/sys_master/images/8978843140126/XC4450-dataSheetMain.pdf

It's connected to VCC 5V and GND and SCL and SDA are connected to A4 and A5. When the USB is connected and the IDE is open I get the correct time printed in the console.

But this weird issue is killing me. So everything is running well, but when the power is connected and reconnected the system loses the current date and time and all it needs is the USB to be connected to start working again. Even with my Mac in sleep mode, in which case it's only getting the power via USB I suspect.

Any ideas would be appreciated. Thank you in advance!

Cheers,

M

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile:

Does another (simpler) sketch work with external power? What is voltage on 5V pin while powered from Vin?

Hi,
Have you got the backup battery fitted?
What is its voltage?

Tom... :slight_smile: