Hi guys,
I've posted the same question in the French section (in case some french people read this before the other):
https://forum.arduino.cc/index.php?topic=663085.0
I'm currently working on a home automation controller project. I upgrade it sometimes with some new features.
To summarize, it is a box with a keypad and a LCD screen who display temperature of few sensors, store the measure history and compute the trend for each sensor. In addition, the box is connected with another module (radio, not Arduino) who send some orders to the box through digital inputs. These orders are interpreted by the box who will activate some relays. Also, the box will send/receive some data from another Arduino card (Uno) who is managing a touch screen (located in another room of the house).
Situation 1.0 (working fine)
I got an Arduino Mega on which the following stuff is connected:
- LCD screen 4x20 (I2C)
- Keypad
- 3 digital temperature sensors (OneWire)
- 4 digital inputs coming from the radio module
- One 8 relays card
- One buzzer piezzo
- A serial line sending and receiving data from the second Arduino
All this is powered by a computer power supply. 12v for Mega card and 5v for the relays.
Situation 2.0 (not working)
I've done a little POC on a backup Arduino (Uno) card, it's a simple clock using a DS3231 and a small OLED screen who displays the time and date. Both running through I2C protocol.
The problem is, if I test this little clock alone, all is working fine. But when I integrate my clock in my box, it is not working anymore.
Symptoms:
- My LCD screen doesn't work (even the backlight)
- The program doesn't finish its initialisation phase (I don't hear the little BEEP from the buzzer, it normally happen at the end of the setup loop).
- My OLED screen stay black
- The DS3231's LED is blinking
So I've tried this:
- If I cut the power of the DS3231 and I reboot the system, the box is working fine but the OLED screen stay black
- If I cut the power of the OLED screen, nothing change
- If I cut the power of the LCD screen, the program start properly and the DS3231's LED stay alight (not blinking)
Analysis attempt
According to the symptoms, I've think about an I2C address conflict. Unfortunately, every I2C component have a different address. So maybe it can be a conflict at components registers level, or a conflict in the libraries I use.
What do you think ?
PS1: I don't use native Arduino IDE, but VSCode with PlatformIO plugin
PS2: The libraries I use are:
#include <OneWire.h>
#include <DallasTemperature.h>
#include <math.h>
//#include <Wire.h> // Deja defini dans le LiquidCrystal_I2C.h
#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
#include <DS3232RTC.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>