Monochrome OLED Breakouts

Similar documents
2.2" TFT Display. Created by Ladyada. Last updated on :15:09 PM EDT

1.5" & 2.1" Monochrome 128x64 OLED Display Module

2.3" Monochrome 128x32 OLED Display Module

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

1.8" TFT Display Breakout and Shield

Adafruit SHT31-D Temperature & Humidity Sensor Breakout

Adafruit BME280 Humidity + Barometric Pressure + Temperature Sensor Breakout

Adafruit Si4713 FM Radio Transmitter with RDS/RDBS Support

Adafruit ATWINC1500 WiFi Breakout

Tiny Arduino Music Visualizer

TSL2561 Luminosity Sensor

Adafruit LSM9DS0 Accelerometer + Gyro + Magnetometer 9-DOF Breakouts

Adafruit LED Backpacks

2.8" TFT Touchscreen. Created by lady ada. Last updated on :00:25 PM EST

DS1307 Real Time Clock Breakout Board Kit

Adafruit Proto Shield for Arduino

PN532 NFC RFID Module User Guide

A REST API for Arduino & the CC3000 WiFi Chip

Adafruit Music Maker Shield

DATASHEET. ADAM Arduino Display Adaptor Module. Arduino Compatible Shield P/N: 4Display-Shield-FT843 For the 4D Systems 4DLCD-FT843 Display

Arduino Due Back. Warning: Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum. Overview

Arduino Lesson 0. Getting Started

All About Arduino Libraries

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

Arduino ADK Back. For information on using the board with the Android OS, see Google's ADK documentation.

Designing VM2 Application Boards

Pololu DRV8835 Dual Motor Driver Shield for Arduino

CAN-Bus Shield Hookup Guide

SainSmart UNO R3 Starter Kit

Arduino Lesson 1. Blink

EARTH PEOPLE TECHNOLOGY SERIAL GRAPH TOOL FOR THE ARDUINO UNO USER MANUAL

Matrix and 7-Segment LED Backpack with the Raspberry Pi

3.2 inch QVGA TFT Color LCD User s Guide Version 1 & 2

Character LCDs. Created by Ladyada. Last updated on :45:29 PM EDT

TEECES DOME LIGHTING SYSTEMS

MCP4725 Digital to Analog Converter Hookup Guide

Arduino DUE + DAC MCP4922 (SPI)

Board also Supports MicroBridge

Adding a Real Time Clock to Raspberry Pi

MARTECH SPI Tools. MARTECH SPI Tools User Manual v1.0. User Manual

NB3H5150 I2C Programming Guide. I2C/SMBus Custom Configuration Application Note

WICE-SPI Hardware Operation Manual

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

INTRODUCTION TO SERIAL ARM

AR1100 Resistive Touch Screen Controller Guide

The self-starting solar-powered Stirling engine

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

AXE033 SERIAL/I2C LCD

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

Arduino Lesson 5. The Serial Monitor

MFRD52x. Mifare Contactless Smart Card Reader Reference Design. Document information

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Microprocessor Project Laboratory

Arduino Lesson 4. Eight LEDs and a Shift Register

AVR Butterfly Training. Atmel Norway, AVR Applications Group

Part 1. MAX BIT DAC with an Arduino Board. MIDI to Voltage Converter Part1

PolyBot Board. User's Guide V1.11 9/20/08

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

Tutorial for MPLAB Starter Kit for PIC18F

Introducing AVR Dragon

DIY Pocket LED Gamer - Tiny Tetris!

Yun Shield Quick Start Guide VERSION: 1.0 Version Description Date 1.0 Release 2014-Jul-08 Yun Shield Quick Start Guide 1 / 14

Your Multimeter. The Arduino Uno 10/1/2012. Using Your Arduino, Breadboard and Multimeter. EAS 199A Fall Work in teams of two!

RGB LED Strips. Created by lady ada. Last updated on :00:18 PM EST

Arduino Lesson 13. DC Motors. Created by Simon Monk

7 OUT1 8 OUT2 9 OUT3 10 OUT4 11 OUT5 12 OUT6 13 OUT7 14 OUT8 15 OUT9 16 OUT10 17 OUT11 18 OUT12 19 OUT13 20 OUT14 21 OUT15 22 OUT16 OUT17 23 OUT18

Arduino Motor Shield (L298) Manual

Lab Experiment 1: The LPC 2148 Education Board

Testing Data Radio Modem with Serial Port Tool V1.20

AN-812 APPLICATION NOTE

POCKET SCOPE 2. The idea 2. Design criteria 3

DS1307ZN. 64 x 8 Serial Real-Time Clock

KTA-223 Arduino Compatible Relay Controller

Hardware Connections between Arduino and IMU Nori Wilkins Apr. 5, 2013

3.2 inch Arduino LCD Shield User Guide

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

5inch HDMI LCD User Manual

Real Time Clock USB Evaluation Board V3.0

KiCad Step by Step Tutorial

Lab 3: PCB design with EAGLE

MAX6683 Evaluation System/Evaluation Kit

BV4512. I2C-LCD- 128 x 64 Graphic Controller. Product specification. November 2008 V0.a. ByVac Page 1 of 14

Adafruit's Raspberry Pi Lesson 5. Using a Console Cable

Advanced Data Capture and Control Systems

Information Board User s Guide

Adafruit CC3000 WiFi. Created by Rick Lesniak. Last updated on :30:11 PM EDT

Web Site: Forums: forums.parallax.com Sales: Technical:

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence :

Adafruit's Raspberry Pi Lesson 5. Using a Console Cable. Created by Simon Monk

An Arduino Controlled GPS Corrected VFO

Adafruit VS1053 MP3/AAC/Ogg/MIDI/WAV Codec Breakout Tutorial

EXPRESS PCB TUTORIAL Author: Lee Morey Revised: JE Feb 2015

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

Workshop Intel Galileo Board

CHAPTER 11: Flip Flops

DOGS GRAPHIC SERIES 102x64 DOTS

FLYPORT Wi-Fi G

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

RN-52 Bluetooth Hookup Guide

How to Move Canon EF Lenses. Yosuke Bando

EasyPIC4 User s Manual

Transcription:

Monochrome OLED Breakouts Created by lady ada Last updated on 2016-10-13 07:46:03 PM UTC

Guide Contents Guide Contents Overview Power Requirements OLED Power Requirements 5V- ready 128x64 and 128x32 OLEDs 0.96" 128x64 OLED Arduino Library & Examples Install Adafruit SSD1306 Library Install Adafruit GFX Run Demo! Create Bitmaps Wiring 128x64 OLEDs Solder Header I2C or SPI Using with I2C Using with SPI Wiring 128x32 SPI OLED display 128x32 SPI OLED Wiring 128x32 I2C Display 128x32 I2C OLED Wiring OLD 0.96" 128x64 OLED 128x64 Version 1.0 OLED Downloads Software Datasheets Files Schematic & Fabrication Print for 0.96" OLED Schematic & Fabrication Print for 1.3" OLED Schematic & Fabrication Print for 0.91" 128x32 I2C Schematic & Fabrication Print for 0.91" 128x32 SPI 2 3 6 6 6 7 9 9 9 10 12 16 16 17 17 18 21 21 23 23 26 26 30 30 30 30 30 32 34 36 https://learn.adafruit.com/monochrome-oled-breakouts Page 2 of 37

Overview https://learn.adafruit.com/monochrome-oled-breakouts Page 3 of 37

This is a quick tutorial for our 128x64 and 128x32 pixel monochrome OLED displays. These displays are small, only about 1" diagonal, but very readable due to the high contrast of an OLED display. Each OLED display is made of 128x64 or 128x32 individual white OLEDs, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is required. This reduces the power required to run the OLED and is why the display has such high contrast; we really like this miniature display for its crispness! https://learn.adafruit.com/monochrome-oled-breakouts Page 4 of 37

The driver chip, SSD1306 can communicate in multiple ways including I2C, SPI and 8-bit parallel. However, only the 128x64 display has all these interfaces available. For the 128x32 OLED, only SPI is available. Frankly, we prefer SPI since its the most flexible and uses a small number of I/O pins so our example code and wiring diagram will use that. https://learn.adafruit.com/monochrome-oled-breakouts Page 5 of 37

Power Requirements OLED Power Requirements The OLED and driver require a 3.3V power supply and 3.3V logic levels for communication. The power requirements depend a little on how much of the display is lit but on average the display uses about 20mA from the 3.3V supply. Built into the OLED driver is a simple switch-cap charge pump that turns 3.3v-5v into a high voltage drive for the OLEDs. You can run the entire display off of one 3.3V supply or use 3.3V for the chip power and up to 4.5V for the OLED charge pump or 3.3V for the chip power and a 7-9V supply directly into the OLED high voltage pin. 5V- ready 128x64 and 128x32 OLEDs Unless you have the older v1 128x64 OLED, you can rest assured that your OLED is 5V ready. All 1.3" 128x64 and the small 128x32 SPI and I2C are 5V ready, if you have a v2 0.96" 128x64 OLED with the 5V ready mark on the front, it's also 5V safe. If you have an older 0.96" OLED (see below) you'll need to take extra care when wiring it to a 5V micontroller. The OLED is designed to be 5V compatible so you can power it with 3-5V and the onboard regulator will take care of the rest. All OLEDs are safe to use with 3.3V logic and power. https://learn.adafruit.com/monochrome-oled-breakouts Page 6 of 37

Simply connect GND to ground, and Vin to a 3 to 5V power supply. There will be a 3.3V output on the 3Vo pin in case you want a regulated 3.3V supply for something else. 0.96" 128x64 OLED The older 0.96" 128x64 OLED is a little more complex to get running as it is not 5V compatible by default, so you have to provide it with 3.3V power. https://learn.adafruit.com/monochrome-oled-breakouts Page 7 of 37

VDD is the 3.3V logic power. This must be 3 or 3.3V VBAT is the input to the charge pump. If you use the charge pump, this must be 3.3V to 4.2V VCC is the high voltage OLED pin. If you're using the internal charge pump, this must be left unconnected. If you're not using the charge pump, connect this to a 7-9V DC power supply. For most users, we suggest connecting VDD and VBAT together to 3.3V and then leaving VCC unconnected. https://learn.adafruit.com/monochrome-oled-breakouts Page 8 of 37

Arduino Library & Examples For all of the different kinds of small OLED monochrome displays, you'll need to install the Arduino libraries. The code we have is for any kind of Arduino, if you're using a different microcontroller, the code is pretty simple to adapt, the interface we use is basic bit-twiddling SPI or I2C Install Adafruit SSD1306 Library Start by installing the support library for the OLED display, you'll need it to talk to the OLED controller chip. We have the Adafruit SSD1306 library repository on GitHub (http://adafru.it/ahq) if you're interested in looking at the code. Start by downloading the library. You can do that by visiting the github repo and manually downloading or, easier, just click this button to download the zip: Download Adafruit_SSD1306 Library http://adafru.it/e3e Rename the uncompressed folder Adafruit_SSD1306 and check that the Adafruit_SSD1306 folder contains Adafruit_SSD1306.cpp and Adafruit_SSD1306.h Place the Adafruit_SSD1306 library folder your arduinosketchfolder/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.We also have a great tutorial on Arduino library installation at: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use (http://adafru.it/aym) Install Adafruit GFX You will need to do the same for the Adafurit_GFX library available here (http://adafru.it/aja) Download Adafruit GFX Library http://adafru.it/cbb Rename the uncompressed folder Adafruit_GFX and check that the Adafruit_GFX folder contains Adafruit_GFX.cpp and Adafruit_GFX.h https://learn.adafruit.com/monochrome-oled-breakouts Page 9 of 37

Place the Adafruit_GFX library folder your arduinosketchfolder/libraries/ folder like you did with the SSD1306 library Run Demo! After installing the Adafruit_SSD1306 and Adafruit_GFX library, restart the Arduino IDE. You should now be able to access the sample code by navigating through menus in this order: File Sketchbook Libraries Adafruit_SSD1306 SSD1306... After you've finished wiring the display as indicated on the following pages, load the example sketch to demonstrate the capabilities of the library and display. The OLED SSD1306 driver is based on the Adafruit GFX library which provides all the underlying graphics functions such as drawing pixels, lines, circles, etc. For more details about what you can do with the OLED check out the GFX library tutorial (http://adafru.it/apx) The library cannot determine the screen size via software. You have to specify it in the header file. Go into the library folder and open the file Adafruit_SSD1306.h. Toward the top you'll see a section of comments that tell how how to edit the file for different kinds of display. https://learn.adafruit.com/monochrome-oled-breakouts Page 10 of 37

https://learn.adafruit.com/monochrome-oled-breakouts Page 11 of 37

Create Bitmaps You can create bitmaps to display easily with the LCD assistant software (http://adafru.it/aps). First make your image using any kind of graphics software such as photoshop or Paint and save as a Monochrome Bitmap (bmp) https://learn.adafruit.com/monochrome-oled-breakouts Page 12 of 37

Select the following options (You might also want to try Horizontal if Vertical is not coming out right) https://learn.adafruit.com/monochrome-oled-breakouts Page 13 of 37

and import your monochrome bitmap image. Save the output to a cpp file You can use the output directly with our example code https://learn.adafruit.com/monochrome-oled-breakouts Page 14 of 37

https://learn.adafruit.com/monochrome-oled-breakouts Page 15 of 37

Wiring 128x64 OLEDs Solder Header Before you start wiring, a strip of header must be soldered onto the OLED. It is not possible to "press-fit" the header, it must be attached! Start by placing an 8-pin piece of header with the long ends down into a breadboard for stability Place the OLED on top so all the short ends of the header stick thru the header pads https://learn.adafruit.com/monochrome-oled-breakouts Page 16 of 37

Finish by soldering each of the 8 pins to the 8 pads! I2C or SPI The nice thing about the 128x64 OLEDs is that they can be used with I2C (+ a reset line) or SPI. SPI is generally faster than I2C but uses more pins. It's also easier for some microcontrollers to use SPI. Anyways, you can use either one with this display Using with I2C The display can be used with any I2C microcontroller. Because the I2C interface is for 'writing' to the display only, you'll still have to buffer the entire 512 byte frame in the microcontroller RAM - you can't read data from the OLED (even though I2C is a bidirectional protocol). To start, you'll need to solder the two jumpers on the back of the OLED. Both must be soldered 'closed' for I2C to work! https://learn.adafruit.com/monochrome-oled-breakouts Page 17 of 37

Finally, connect the pins to your Arduino GND goes to ground Vin goes to 5V Data to I2C SDA (on the Uno, this is A4 on the Mega it is 20 and on the Leonardo digital 2) Clk to I2C SCL (on the Uno, this is A5 on the Mega it is 21 and on the Leonardo digital 3) RST to digital 4 (you can change this pin in the code, later) This matches the example code we have written. Once you get this working, you can try a different Reset pin (you can't change the SCA and SCL pins). Finally you can run the File Sketchbook Libraries Adafruit_SSD1306 SSD1306_128x64_i2c example Using with SPI The breakouts are ready for SPI by default, but if you used them for I2C at some point, https://learn.adafruit.com/monochrome-oled-breakouts Page 18 of 37

you'll need to remove the solder jumpers. Use wick or a solder sucker to make sure both are clear! Finally, connect the pins to your Arduino - GND goes to ground Vin goes to 5V DATA to digital 9 CLK to digital 10 D/C to digital 11 RST to digital 13 CS to digital 12 (Note: If using the display with other SPI devices, D/C, CLK and DAT may be shared, but CS must be unique for each device.) This matches the example code we have written. Once you get this working, you can try another set of pins. https://learn.adafruit.com/monochrome-oled-breakouts Page 19 of 37

Finally you can run the File Sketchbook Libraries Adafruit_SSD1306 SSD1306_128x64_spi example https://learn.adafruit.com/monochrome-oled-breakouts Page 20 of 37

Wiring 128x32 SPI OLED display 128x32 SPI OLED The 128x32 SPI OLED is very easy to get up and running because it has built in level shifting. First up, take a piece of 0.1" header 8 pins long. Plug the header long end down into a breadboard and place the OLED on top. Solder the short pins into the OLED PCB. https://learn.adafruit.com/monochrome-oled-breakouts Page 21 of 37

Finally, connect the pins to your Arduino - GND goes to ground, Vin goes to 5V, DATA to digital 9, CLK to digital 10, D/C to digital 11, RST to digital 13 and finally CS to digital 12. (Note: If using the display with other SPI devices, D/C, CLK and DAT may be shared, but CS must be unique for each device.) This matches the example code we have written. Once you get this working, you can try another set of pins. Finally you can run the File Sketchbook Libraries Adafruit_SSD1306 SSD1306_128x32_SPI example If you're using the 128x32 OLED, be sure to uncomment the "#define SSD1306_128_32" in the top of Adafruit_SSD1306.h to change the buffer size https://learn.adafruit.com/monochrome-oled-breakouts Page 22 of 37

Wiring 128x32 I2C Display 128x32 I2C OLED The 128x32 I2C OLED is very easy to get up and running because it has built in level shifting and regulator. First up, take a piece of 0.1" header 6 pins long. Plug the header long end down into a breadboard Place the OLED on top https://learn.adafruit.com/monochrome-oled-breakouts Page 23 of 37

Solder the short pins into the OLED PCB. Finally, connect the pins to your Arduino GND goes to ground Vin goes to 5V SDA to I2C Data (on the Uno, this is A4 on the Mega it is 20 and on the Leonardo https://learn.adafruit.com/monochrome-oled-breakouts Page 24 of 37

digital 2) SCL to I2C Clock(on the Uno, this is A5 on the Mega it is 21 and on the Leonardo digital 3) RST to digital 4 (you can change this pin in the code, later) This matches the example code we have written. Once you get this working, you can change the RST pin. You cannot change the I2C pins, those are 'fixed' in hardware Finally you can run the File Sketchbook Libraries Adafruit_SSD1306 SSD1306_128x32_i2c example https://learn.adafruit.com/monochrome-oled-breakouts Page 25 of 37

Wiring OLD 0.96" 128x64 OLED This wiring diagram is only for the older 0.96" OLED that comes with a level shifter chip. If you did not get a level shifter chip, you have a V2.0 so please check out the other wiring tutorial! 128x64 Version 1.0 OLED The version 1 128x64 OLED runs at 3.3V and does not have a built in level shifter so you'll need to use a level shifting chip to use with a 5V microcontroller. The following will assume that is the case. If you're running a 3.3V microcontroller system, you can skip the level shifter. We'll assume you want to use this in a breadboard, take a piece of 0.1" header 10 pins long. Place the header in a breadboard https://learn.adafruit.com/monochrome-oled-breakouts Page 26 of 37

and then place the left hand side of the OLED on top. And solder the pins We'll be using the internal charge pump so connect VDD and VBAT together (they will connect to 3.3V). GND goes to ground. https://learn.adafruit.com/monochrome-oled-breakouts Page 27 of 37

Place a CD4050 level shifter chip so pin one is at the top. Connect pin 10 to D/C pin 12 to CLK (SPI clock) and pin 15 to DAT (SPI data). https://learn.adafruit.com/monochrome-oled-breakouts Page 28 of 37

Connect pin 2 to RES (reset) and pin 4 to CS (chip select). Pin 1 goes to 3.3V and pin 8 to ground. (Note: If using the display with other SPI devices, D/C, CLK and DAT may be shared, but CS must be unique for each device.) You can connect the inputs of the level shifter to any pins you want but in this case we connected digital I/O 13 to pin 3 of the level shifter, 12 to pin 5, 11 to pin 9, 10 to pin 11 and 9 to pin 14. This matches the example code we have written. Once you get this working, you can try another set of pins. https://learn.adafruit.com/monochrome-oled-breakouts Page 29 of 37

Downloads Software You can download our SSD1306 OLED display Arduino library from github (http://adafru.it/ahq) which comes with example code. The library can print text, bitmaps, pixels, rectangles, circles and lines. It uses 1K of RAM since it needs to buffer the entire display but its very fast! The code is simple to adapt to any other microcontroller. You'll also have to install the Adafruit GFX graphics core library at this github repo (http://adafru.it/aja) and install it after you've gotten the OLED driver library. Datasheets Files UG-2864HSWEG01 (http://adafru.it/aji) Datasheet UG-2832HSWEG02 (http://adafru.it/qrf) Datasheet UG-2864HSWEG01 (http://adafru.it/ajj) User Guide UG-2832HSWEG01 (http://adafru.it/qva) Datasheet SSD1306 (http://adafru.it/ajk) Datasheet EagleCAD PCB files for 128x32 0.91" SPI display PCB (http://adafru.it/ajl) EagleCAD PCB files for 128x32 0.91" I2C display on GitHub (http://adafru.it/rpf) EagleCAD PCB files for 128x64 0.96" display on GitHub (http://adafru.it/ajm) EagleCAD PCB files for 128x64 1.3" display on GitHub (http://adafru.it/rje) Fritzing objects available in the Adafruit Fritzing Library(http://adafru.it/aP3) Schematic & Fabrication Print for 0.96" OLED https://learn.adafruit.com/monochrome-oled-breakouts Page 30 of 37

https://learn.adafruit.com/monochrome-oled-breakouts Page 31 of 37

Schematic & Fabrication Print for 1.3" OLED https://learn.adafruit.com/monochrome-oled-breakouts Page 32 of 37

https://learn.adafruit.com/monochrome-oled-breakouts Page 33 of 37

Schematic & Fabrication Print for 0.91" 128x32 I2C https://learn.adafruit.com/monochrome-oled-breakouts Page 34 of 37

https://learn.adafruit.com/monochrome-oled-breakouts Page 35 of 37

Schematic & Fabrication Print for 0.91" 128x32 SPI https://learn.adafruit.com/monochrome-oled-breakouts Page 36 of 37

Last Updated: 2016-10-13 07:46:02 PM UTC Page 37 of 37