Circuit Diagram

First of all, connect the OLED with the Arduino. The OLED works with the Arduino through the SPI as well as I2C communication but we have connected it using SPI communication. The SPI pins on the Arduino are pin 8, 9, 10, 11, and 13. The connections of the OLED with the Arduino are as follows:





Connect CS of the OLED to pin 10 of the Arduino.

Connect DC of the OLED to pin 9 of the Arduino.

Connect RES of the OLED to pin 8 of the Arduino.

Connect D1 of the OLED to pin 11 of the Arduino.

Connect D0 of the OLED to pin 13 of the Arduino.

Connect VCC of the OLED to 5V pin of the Arduino.

Connect GND of the OLED to GND pin of the Arduino.

After that, connect the DS3231 module with the Arduino. The DS3231 module works with the Arduino through I2C communication. The pins for I2C communication on the Arduino are SDA and SCL. Connect the DS3231 module to the Arduino as follows:

Connect GND of the DS3231 to the GND pin of the Arduino.

Connect VCC of the DS3231 to 5V pin of the Arduino.

Connect SDA of the OLED to A4 on the Arduino.

Connect SCL on the OLED to the A5 pin on the Arduino.

In the end, connect the LM35 sensor with the Arduino. Connect the left pin of LM35 to 5V on the Arduino, the middle pin to A0 on the Arduino and the left pin to ground on the Arduino.