ATtiny85 OLED 0.9″ Arduino
Pada artikel ini saya akan membagikan tutorial dasar memprogram ATtiny85 untuk menampilkan teks dan logo di OLED SSD1306 dengan menggunakan beberapa Library. Konsekuensinya menggunakan library, akan memakan sedikit lebih banyak memori ATtiny85.
Jika anda mencari tutorial bagaimana menampilkan teks dan logo ke OLED dari ATtiny85 tanpa menggunakan library, bisa baca artikel Teks Logo ATtiny85 OLED 128×64 Tanpa Library.
Rangkaian
Pada rangkaian berikut, ada dua pembagaian komponen yang digunakan, yaitu Programmer (Arduino ISP) dan Komponen Utama (ATtiny85 ke OLED).
Jika anda belum memahami apa itu firmware bootloader silahkan baca artikel berikut yang sesuai dengan anda gunakan:
- Cara Burn Bootloader ATtiny85 Pakai Arduino
- Cara Burn Bootloader Arduino Menggunakan USBasp
- Cara Burn Bootloader dan Program ATtiny13 Dengan Arduino
- Cara Perbaiki avrdude: stk500_recv(): programmer is not responding

Arduino ISP | ATtiny85 OLED |
Pin PB 13 (SCK) Arduino Uno terhubung ke Pin 7 (PB2) ATtiny85 Pin PB 12 (MISO) Arduino Uno terhubung ke Pin 6 (PB1) ATtiny85 Pin PB 11 (MOSI) Arduino Uno terhubung ke Pin 5 (PB0) ATtiny85 Pin PB 10 (RESET) Arduino Uno terhubung ke Pin 1 (PB5) ATtiny85 Pin Power (5V dan GND) Arduino Uno terhubuung ke Pin 5V dan GND ATtiny85 | Pin 7 (PB2) ATtiny85 terhubung ke Pin SCK OLED 128×64 Pin 5 (PB0) ATtiny85 terhubung ke Pin SDA OLED 128×64 Pin 5V dan GND ATtiny85 terhubuung ke Pin VDD dan GND OLED 128×64 |
Setelah rangkaian diatas dibuat, maka langkah utama adalah kita harus isikan chip ATtiny85 sebuah firmware bootloader. Anda dapat membaca artikel Cara Burn Bootloader dan Progam ATtiny85 Menggunakan Arduino ISP.
Library
Sekarang, setelah ATtini85 berisi firmware bootloader, maka kita akan memerlukan dua library Arduino agar ATtiny85 dapat berkomunikasi dengan OLED 128×64 0.9″.
Dua library tersebut adalah TinyWireM dan SSD1306_minimal, dimana penggunaanya:
- TinyWireM digunakan untuk komunikasi I2C khusus untuk chip varian ATtiny.
- SSD1306_minimal adalah library untuk driver OLED.
Silahkan tambahkan dua library tersebut ke Arduino IDE anda.
Kode Program Tampilkan Teks
Pastikan anda telah menambahkan library ATtiny85 yang telah dijelaskan pada artikel Cara Burn Bootloader dan Progam ATtiny85 Menggunakan Arduino ISP.
Kita akan menampilkan kata di OLED 128×64 yaitu “Halo Semua…”, “ATtiny85 + OLED!”, “www.chippiko.com”.
Untuk progam dasarnya adalah sebagai berikut:
#include "SSD1306_mmal.h"
//Declare objek OLED
SSD1306_M oled;
void setup() {
oled.t(0x3C); //Set alamat OLED
oled.clear(); //
delay(1000);
tampil();
}
void loop() {
}
void tampil() {
oled.startScreen();
oled.clear();
//Tampilkan pada koordinat (x:0, y:0)
oled.cursorTo(0, 0);
oled.printString("Halo Semua...");
//Tampilkan pada koordinat (x:0, y:10)
oled.cursorTo(0, 10);
oled.printString("ATtiny85 + OLED!");
//Tampilkan pada koordinat (x:0, y:20)
oled.cursorTo(0, 20); // x:0, y:20
oled.printString("www.chippiko.com");
}
Setelah program diupload, seharusnya anda akan melihat tampilan seperti :

Kode Program Tampilkan Gambar
Setelah kita dapat menampilkan teks, k kita akan menampilkan logo atau gambar di OLED 128×64. Langkah awal anda harus konversi logo/gambar menjadi kode piksel pada website image2cpp.
Berikut langkah-langkahnya:
- Pilih gambar (Select Image)
- Atur Gambar (Image Setting)
– Canvas size (s) ubah menjadi 128×64
– Background color (disesuaikan)
– Invert image color (disesuaikan)
– Brightness / alpha threshold (disesuaikan)
– Scalling (scale to fit, keeping proportions)
– Center (vertikal) - Preview
- Output
– Code output format (Arduino code)
– Draw Mode (Vertical) - Generate Code
- Copy baris code
Klik tanda panah kecil yang berada disebelah kanan, dibawah tombol serial monitor. Kemudian buat file baru dengan nama file dan exstensi “myBitmap.h” pada menu “New Tab”. Gunakan program berikut.
File Utama.ino
#include "SSD1306_mmal.h"
#include "myBitmap.h"
//Declare objek OLED
SSD1306_M oled;
void setup() {
oled.t(0x3C); //Set alamat OLED
oled.clear(); //
delay(1000);
oled.drawImage(myBitmap, 0, 0, 128, 8);
}
void loop() {
}
File myBitmap.h
// 'profil-dan-produk-Bank-Syariah-Mandiri', 128x64px
const unsigned char myBitmap [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xe0, 0xe0,
0xf0, 0xf0, 0xf0, 0xf8, 0xf8, 0xf0, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x70, 0xf0, 0xf8, 0xfc, 0xfc, 0xfe, 0xfe,
0xff, 0xff, 0xff, 0x7f, 0x3f, 0x3f, 0x1f, 0x1f, 0x0f, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
0x06, 0x0c, 0x0c, 0x1c, 0x3c, 0xfc, 0xfc, 0xfc, 0xfe, 0xff, 0xff, 0x7f, 0x7f, 0x3f, 0x3f, 0x1f,
0x1f, 0x0f, 0x07, 0x07, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x06, 0x04, 0x1c, 0x3c, 0x7c,
0xfc, 0xfe, 0xff, 0xff, 0x7f, 0x7f, 0x3f, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x06, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0x00, 0x80,
0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x00,
0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00,
0x00, 0xc0, 0xc0, 0xc0, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1, 0x81, 0x83, 0x03, 0x03, 0x01,
0x01, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x01, 0xc1, 0xc1, 0xc1, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0x00,
0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x03,
0x01, 0x01, 0x01, 0x03, 0xff, 0xff, 0xff, 0xff, 0x03, 0x01, 0x01, 0x01, 0x07, 0xff, 0xff, 0xff,
0xfe, 0x00, 0xc0, 0xe1, 0xf1, 0xf1, 0x71, 0x31, 0x39, 0x39, 0x3b, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0x03, 0x01, 0x01, 0x01, 0x03, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00,
0xfe, 0xff, 0xff, 0x8f, 0x03, 0x01, 0x01, 0x01, 0x01, 0x03, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x07, 0x03, 0x03, 0x03, 0x00,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x1f,
0x1f, 0x00, 0x07, 0x0f, 0x1f, 0x1f, 0x1c, 0x18, 0x1c, 0x1c, 0x0e, 0x1f, 0x1f, 0x1f, 0x1c, 0x00,
0x00, 0x1f, 0x1f, 0x1f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, 0x00,
0x03, 0x07, 0x0f, 0x1f, 0x1e, 0x1c, 0x1c, 0x1c, 0x1c, 0x0e, 0x0f, 0x1f, 0x1f, 0x1f, 0x00, 0x00,
0x00, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1f, 0x1f, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0x10, 0x18, 0x18, 0x18,
0x10, 0x00, 0x10, 0x70, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf0, 0x10, 0x00, 0x10,
0x10, 0x10, 0x18, 0x18, 0x18, 0x30, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0xe0, 0x20, 0x10, 0x18,
0x18, 0x00, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x10, 0x10, 0x18, 0x18, 0x18, 0x18, 0x30, 0xe0, 0xc0,
0x00, 0x00, 0x00, 0xff, 0xe0, 0x20, 0x10, 0x18, 0x18, 0x18, 0x10, 0x30, 0xe0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x02, 0x06, 0x04, 0x8c,
0xf8, 0x70, 0x00, 0x00, 0x03, 0x0f, 0x3c, 0xe0, 0xc0, 0x70, 0x1e, 0x03, 0x00, 0x00, 0x70, 0xf8,
0x8c, 0x06, 0x02, 0x02, 0x02, 0x82, 0xe7, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xf0, 0xfc, 0x04, 0x06, 0x02, 0x02, 0x02, 0x82, 0xff, 0xff,
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x1c, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
Hasil
Hasilnya adalah seperti pada gambar paling atas dari .

Terima kasih telah mengunjungi website Kini Saya Ngerti. Semoga artikel Tutorial Dasar ATtiny85 128×64 OLED Arduino ini bermanfaat.