logo elektroda
logo elektroda
X
logo elektroda

How to connect DS3231 to ESP8266 using GPIO2 and GPIO14 and using SQW?

piotrkarpik8 1026 5
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18159386
    piotrkarpik8
    Level 6  
    Hello, I am working on my first project in Eagle, in order to get to know the program and learn how to design. It fell on an LED lamp. I should add that the board is not of my own making, but borrowed from one of the posts from this forum (with minor aesthetic tweaks).

    1 I would like to add a DS3231 to it to create an LED clock, however I have a problem with the SCL and SDA connections. I gather from the ESP8266 datasheet note that I need to connect these pins from the DS3231 to GPIO2 (SDA) and GPIO14 (SCL), however it also says that GPIO14 is responsible for the IR. Have I misunderstood this? How do I solve this so that one does not interfere with the other?
    2 Also, how should I use SQW and 32kHz in my project? I should connect a quartz resonator to the 32kHz to make it work at all? What about the SQW?
    3. what about the signals on the right side of the DS3231? GND and VCC to ground? What about SCL_2 and SDA_2? I understand that these are my IC output signals, but what to do with them? Should they be somehow connected to the LED lights (I will want to use the WS2812)?

    Thanks in advance for your time. I'll also add for my defence that I'm a second year student and we haven't had anything design related yet. I am trying to do some design on my own as a hobby.
    Greetings.
    How to connect DS3231 to ESP8266 using GPIO2 and GPIO14 and using SQW? How to connect DS3231 to ESP8266 using GPIO2 and GPIO14 and using SQW? How to connect DS3231 to ESP8266 using GPIO2 and GPIO14 and using SQW? .
  • ADVERTISEMENT
  • #2 18159449
    ArturAVS
    Moderator
    piotrkarpik8 wrote:
    I understand that these are my IC output signals, but what to do with them? Should they somehow be linked to the LED lights (I will want to use the WS2812)?
    .
    These are the leads of the 24C32 memory that is also on this module.
    If this is the module: https://diolut.pl/modul-pomiaru-czasu-rtc-ds3...MIu6Cs6ejD5AIVzqSaCh0ERgzfEAYYASABEgIWzfD_BwE

    piotrkarpik8 wrote:
    2. Also, how should I use SQW and 32kHz in my project? Should I connect a quartz resonator to the 32kHz to make it work at all? What about the SQW?
    .
    SQW and 32kHz are the outputs. Take a look at the DS's datasheet note. The quartz resonator is already "on board".
  • ADVERTISEMENT
  • #3 18174296
    piotrkarpik8
    Level 6  
    I have connected and made the design as follows. I would ask you to check the correctness of the connections and for any advice and guidance.
    If the whole schematic was needed I will upload it, but I am most concerned with the correctness of the RTC connection to the ESP.

    Regards.

    How to connect DS3231 to ESP8266 using GPIO2 and GPIO14 and using SQW? How to connect DS3231 to ESP8266 using GPIO2 and GPIO14 and using SQW? .
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 18174363
    kaczakat
    Level 34  
    On the ESP8266, the standard pins for I2C are GPIO4 and GPIO5, and this is also the case on the popular Wemos mini and Node MCU boards:
    How to connect DS3231 to ESP8266 using GPIO2 and GPIO14 and using SQW? .
    All in all it's some sort of soft solution on the ESP8266 anyway, so it could be on a different pin, but for the record GPIO14 is the SPI clock.
    Doing it your way you will still have to correct something when programming.
    There are no pull-up resistors for the I2C lines to VCC, maybe the clock module has them soldered on, maybe you don't need them, but if you're making your board from bare chips they probably should be.
    Helpful post? Buy me a coffee.
  • #6 18174583
    khoam
    Level 42  
    Now I noticed that you are powering the DS3231 module from 5V, so without logic level converters on I2C to ESP8266 you will be out. Some of these DS3231 modules can be powered from 3.3, then you would avoid the need for these converters.
ADVERTISEMENT