I want to add a RTC in my own custom PCB using a DS1302 IC. I am using the Arduino IDE and an ESP32 controller.

I made a PCB and tried to run it but it failed to read data from the RTC. Just to make sure where the problem, is I took out the working DS1302 module and replaced the IC with mine and it was not working after that, so clearly the issue is within the IC.

I have tried two different libraries as well but the issue occurs in both while reading data (not in initialization, hence the connection is ok, too.)

Is there some kind of configuration I have to do for new ICs? Is there something else I am missing here?

I have tried four new ICs. Is it possible that all of them are faulty?

The module I used for testing is a common one and works fine with its own IC.

Photo attached below with the IC I used.


enter image description here

  • 1
    \$\begingroup\$ Are there pull-up resistors connected to SDA & SCL? Can you post a schematic? \$\endgroup\$
    – Lior Bilia
    Commented Mar 11, 2023 at 12:48
  • 2
    \$\begingroup\$ @LiorBilia This module use 3 wire protocol different from I2C, and has inbuild pull down and does not need external components. I am adding datasheet of IC in quetion too. \$\endgroup\$
    – dharmikP
    Commented Mar 11, 2023 at 12:52
  • \$\begingroup\$ Ah, it is the Analog-sold Maxim variant \$\endgroup\$ Commented Mar 11, 2023 at 12:53
  • \$\begingroup\$ @MarcusMüller, I have purchased this from local vendor who does not provide manufacturer details. It does look like the one in the photo except middle number. I could not find the meaning of those markings. \$\endgroup\$
    – dharmikP
    Commented Mar 11, 2023 at 13:00
  • \$\begingroup\$ Well the middle row is the date code, two digits for the year, the next two digits for the week number, the last two letters being the silicon revision. The third row is the lot number; the + means "lead-free". Usually, that + is on a separate, fourth row with maxim, though. \$\endgroup\$ Commented Mar 11, 2023 at 13:08

1 Answer 1


I did made a PCB and tried to run it but it failed to read data from RTC. Just to make sure where the problem is I took out working DS1302 module and replaced the IC with mine and it was not working after that, so clearly issue is within IC.

I suggest more systematic testing...

You have a known good chip and a known good board and known good software. You tested that out and I am assuming that that test was with the ESP32 such that GPIO and software is configured properly and you can keep it that way.

You have 4 suspect chips and a suspect board. One or more of your suspect chips did not work in your known good board and software (not sure that you tested all 4 of them).

Test the known good chip in the suspect board and the known good software. If that works, you can believe that the new board is ok. If it does not work, put the good chip back in the good board and if it fails, suspect that your new board has fried the chip....so you have to find out why. If the good chip still works in the good board with good software - the problem is in the 4 suspect chips.

You did not say where you got the chips and it is quite possible that they are not genuine DS->MAX->AN chips. Search on fake DS1302 and you will get the idea.

If they are not genuine, they may still work, but are out of tolerance. You may want to just get genuine chips or you may want to explore them a bit more.

If you want to explore....try them without the battery / bumping Vcc to 5V / increase the CE/RST values (same line different data sheet nomenclature). That sort of thing.

That's my thinking - hope it helps.

Good luck and let us know what you find out.

  • \$\begingroup\$ I have 10 of them and tried all of them. All are not working and that too without using them in PCB first so issue is within IC. I will try to change few settings and see if it helps. Thank you. \$\endgroup\$
    – dharmikP
    Commented Mar 13, 2023 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.