"Enjoy life in His fold. Stop worrying because there is hope."

OLED (I2C) With ATtiny85

NOTE: Prior pushing through with this article, I advised you to read and visit my article Miniaturizing Your Arduino Projects Using ATtiny85 if you haven’t yet. In this article, you will learn how to set up your ATtiny85 so that it would be ready to be uploaded with sketches through an ISP.

In one of my previous posts (LCD Display with ATtiny85), I detailed how LCD is used with an ATtiny85, or in my case the ATtiny85 Development Board. I tried the usual libraries which I use for my OLED with my Arduino boards (Uno, Pro Mini, Nano and Atmega328-based DIY boards), but these do not work well (does not compile successfully to ATtiny85). I was able to scout one from the Internet, and the library can be found here: ATTiny85 Connects to I2C OLED Display – Great Things Can be Small article from Instructables. The article explains how soldering is done with the ATTiny85 kit, but we can skip that. The components/modules needed are the following:

Arduino Board as ISP (You may use the Arduino board of your choice, but you need to take note of the pins used for your board when using it as an ISP.)

At this stage, your Arduino UNO is ready to be used as a programmer / ISP.

ADDING THE REQUIRED LIBRARY

Next thing to be done is to add the required library, which can be found here. Once downloaded, install it in the Arduino IDE. You may want to open the embedded sample from the compressed file (ATTiny85_OLED_weather_demo.zip).

Now, we need to connect the OLED display to the ATtiny85 chip (or in my case the ATtiny85 Development Board).

ATTINY85 TO OLED CONNECTIONS

Since our OLED display is using i2c, we only need 4 pins all in all: VCC, GND, SCL and SDA. From the ATtiny85 pinout, you will see VCC (chip pin 8), GND (chip pin 4), SCL (chip pin 7, PB2) and SDA (chip pin 5, PB0). Connect the corresponding pins for these two modules:

ATiny85 Pin 7 (PB2) to OLED’s SCL pin

ATiny85 Pin 5 (PB0) to OLED’s SDA pin

ATiny85 Pin 8 (VCC) to OLED’s VCC pin

ATiny85 Pin 4 (GND) to OLED’s GND pin

Orange wire connects from ATtiny85 P2 to OLED Display’s SCL pin

Dark blue wire connects from ATtiny85 P0 to OLED Display’s SDA pin

Red wire connects from ATtiny85 5V (VCC) to OLED Display’s VCC pin

Black wire connects from ATtiny85 GND to OLED Display’s GND pin

UPLOADING SKETCH TO ATTINY85 DEVELOPMENT BOARD

Make sure that the connections are in place (Arduino Nano to ATtiny85).

Open the program / sketch you want uploaded to your ATtiny85 Development Board.

Go to Tool and setup the following, as shown from the screenshot below: