I'm working on a project that involves using a DS3231 clock to obtain the time when an ESP32 wakes up. Currently, my ESP32 along with the sensor has a current consumption of around 0.2mA, which is acceptable for my needs. However, when I connect the DS3231 directly to the 3.3V and GND pins of the ESP32, the current consumption jumps to 0.7mA, which is much higher than expected.
It's important to mention that the DS3231 clock is powered by a CR2032 battery to maintain the time when the ESP32 is in low power mode or sleeping. Additionally, I have removed the LED that originally came with the DS3231 to reduce any additional consumption.
The connection between the DS3231 and the ESP32 is as follows:
The SDA pin of the DS3231 is connected to the DA pin (pin 21) of the ESP32.
The SCL pin of the DS3231 is connected to the CL pin (pin 22) of the ESP32.
I'm using the RTClib.h library for clock management in my code. I have checked my connections and everything seems to be properly wired. I wonder if anyone has experienced a similar issue and if there is any known solution to reduce this current consumption when integrating the DS3231 with the ESP32.
Any help, advice, or suggestion would be greatly appreciated. Thank you in advance for your time and assistance!
this is my code
#include <Wire.h>
#include <RTClib.h>
#include <esp_sleep.h>
RTC_DS3231 rtc;
// Define los pines SDA y SCL que se usarán para la comunicación I2C con el RTC
#define SDA_PIN 21
#define SCL_PIN 22
void setup() {
Serial.begin(115200);
// Wire.begin(SDA_PIN, SCL_PIN); // Inicia la comunicación I2C con los pines SDA y SCL definidos
// if (!rtc.begin()) {
// Serial.println("No se pudo encontrar el módulo RTC");
// while (1);
// }
// Configura el ESP32 para despertar después de un período de Deep Sleep
esp_sleep_enable_timer_wakeup(10 * 1000000); // Despertar después de 10 segundos
}
void loop() {
// DateTime now = rtc.now();
// Serial.print("Hora y fecha: ");
// Serial.print(now.year());
// Serial.print('/');
// Serial.print(now.month());
// Serial.print('/');
// Serial.print(now.day());
// Serial.print(' ');
// Serial.print(now.hour());
// Serial.print(':');
// Serial.print(now.minute());
// Serial.print(':');
// Serial.print(now.second());
// Serial.println();
// Entra en Deep Sleep
esp_deep_sleep_start();
}
This is the version of my DS3231 and the LED that I removed.
Which module do you recommend for minimal power consumption? I only need it to provide the date and time when awakened and eventually wake the ESP32 three times a day.
You also need to remove the misguided (that is, idiotic) battery charging circuitry, which can lead to small explosions. The diode on the upper left is part of it.
Finally, you can remove the pullup resistors, and use internal pullups on the Arduino instead.
That module should be OK once you have removed all the junk parts.
@jremington seriously, thank you very much man, you have helped me a lot, thanks for answering my questions.
Are you referring to removing this part of the circuit along with the slc and sla respisteas, yes?
Having done it several times, I am absolutely certain that it is not only safe to remove that diode, it is essential to do so. Labeled 1N4148 below.
The diode circuit attempts to charge a non-rechargeable battery. You can find other discussions of this really terrible design on the web, and on this forum.
very interesting @jremington, I had no idea that it was poorly designed, hey @alexander_idid keep in mind that 1 of those resistors that you are going to remove is the one from the SQW/INT output, which you will use as an interrupt to wake up your Arduino, check the circuit to only remove those from SDA, SCL and 32k.
The LED and the diode should be removed. The other components may optionally be removed, but you may have to provide other pullups, and the operation may not save enough current to make a significant difference.
Hello @jremington , what a pity to bother you but I could ask you about what advice you give me to lower the energy in my system, I have tried several things but it has not worked out, currently it is at 0.3mA, I need it to reach close to 0.2mA, this It is the link to the forum and this is an image of my circuit.
I believe the DS3231 draws about 100uA, which is 0.1mA, when powered through its Vcc pin. But on the backup coin cell, it ony draws about 2uA.
I'd suggest you power the RTC module from a GPIO pin on your processor. Turn that on only when you need to communicate with the RTC via I2C. Then you can just leave the pullup resistors in place.
Check to see if your board will attempt to charge your battery when power is applied. Many of the ones I've will have a charge path to the battery. Not good for power and not good for a non-rechargeable battery.
Hi Mr @jremington,
I am currently going from breadboard to PCB, in EasyEda for that task, in the design of the DS3231 Module I had a question about what these 'Jumpers' refer to or what function they have? Could I simply order them to be omitted or are they necessary for operation?
Isn't that for a more minimal design, built around the module itself? The effect is different with a dev board (which has a 'power' LED and other considerations) , I believe?