Arduino Mega and 1.3 Inch OLED Display


In this project we will connect a 1.3 Inch OLED display to a Arduino Mega. OK, so why use an OLED display? Some of the advantages are as follow;

  • They are sunlight readable and each pixel is self luminous unlike a TFT where there is a back light to light the whole display. 
  • They are more energy efficient since only the pixels that are on is lit not the whole back light like a TFT display.


- Arduino Mega 2560

- 1.3 Inch OLED Display

- Prototyping Wires

- Male Header Pin

Arduino Mega and 1.3 Inch OLED display for IoT project

Setup (Hardware)

  1. Cut 4 pins from the male header.
  2. Solder the header to the board.

    Soldering header to OLED display for Arduino Mega
  3. Connect red wire from 3.3V(Arduino Mega) to VCC(Display)
  4. Connect brown wire from GND(Arduino Mega) to GND(Display)
  5. Connect blue wire from pin 20(Arduino Mega) to SDA(Display)
  6. Connect green wire from pin 21(Arduino Mega) to SCL(Display)Arduino Mega connection to OLED (IoT and Home Automation project)
  7. Connect the USB cable to the computer

Setup (Software)

Do ensure you have done the necessary installation of software as per our setup blog

  1. Install the LCD drivers by selecting "Tools->Manage Libraries..", search for U8g2 and install the driver.OLED Driver installation for Arduino IoT
  2. Ensure you have selected the correct board for your project, if using a Arduino Mega select "Arduino/Genuino Mega or Mega 2560"
    Arduino Mega 2560 selection in Arduino IDE
  3. Download the Script
  4. Ensure you have selected the correct COM port for the board.
  5. Upload the script, and you should see the following.
    Arduino Mega OLED display for IoT and Home Automation



Leave a comment

Please note, comments must be approved before they are published