Hello,
Im currently working with an OLED screen and a RTC module (DS3231). The thing is that when I power down the devices, the current is 0.88mAh. But if I only use 1 i2c device (Oled screen or RTC, doensnt matter) the consuption is 0.014mAh.
What is going on? I don't understand anything.
I think the I2C bus is still sending information or some device is not correctly powered OFF. For the DS3231 Im setting the PIN to LOW and for the OLED screen im using some code that I found on the Adafruit library
My problem is the current, I would like to cut that as much as I can so the batteries Im planning to add will last longer. Is there any way to switch the devices off so they wont consume power?
I attached a more detailed scheme of my wiring.
Thanks in advance
// **** INCLUDES *****
#include <Wire.h>
#include "LowPower.h"
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"
#include <RTClibExtended.h>
#include <avr/power.h>
SSD1306AsciiWire display;
RTC_DS3231 RTC; //we are using the DS3231 RTC
const byte rtcPIN = 8;
void setup()
{
Serial.begin(9600);
pinMode(rtcPIN, OUTPUT);
digitalWrite(rtcPIN, LOW);
}
void loop()
{
digitalWrite(rtcPIN, HIGH);
delay(5);
Wire.begin();
RTC.begin();
display.begin(&Adafruit128x64, 0x3C, 4);
display.setFont(System5x7);
display.clear();
display.print("Hello!!");
DateTime now = RTC.now();
printTimestamp(now);
delay(5000);
uint8_t control = 0x00;
Wire.beginTransmission(0x3C);
Wire.write(control);
Wire.write(0xAE);
Wire.endTransmission();
Wire.end();
digitalWrite(rtcPIN, LOW);
// Enter power down state for 8 s with ADC and BOD module disabled
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
}
void printTimestamp(DateTime currentTime) {
char timestampChar[20]; // should handle yyyy/mm/dd hh:mm:ss and null terminator
snprintf(timestampChar, sizeof(timestampChar), "%d/%02d/%02d %02d:%02d:%02d", currentTime.day(), currentTime.month() , currentTime.year() , currentTime.hour(), currentTime.minute(), currentTime.second()); // write to char array
Serial.println(timestampChar);
}


