oled lcd display module free sample

This article shows how to use the SSD1306 0.96 inch I2C OLED display with the Arduino. We’ll show you some features of the OLED display, how to connect it to the Arduino board, and how to write text, draw shapes and display bitmap images. Lastly, we’ll build a project example that displays temperature and humidity readings.

The organic light-emitting diode(OLED) display that we’ll use in this tutorial is the SSD1306 model: a monocolor, 0.96-inch display with 128×64 pixels as shown in the following figure.

The OLED display doesn’t require backlight, which results in a very nice contrast in dark environments. Additionally, its pixels consume energy only when they are on, so the OLED display consumes less power when compared with other displays.

The model we’re using here has only four pins and communicates with the Arduino using I2C communication protocol. There are models that come with an extra RESET pin. There are also other OLED displays that communicate using SPI communication.

Because the OLED display uses I2C communication protocol, wiring is very simple. You just need to connect to the Arduino Uno I2C pins as shown in the table below.

To control the OLED display you need the adafruit_SSD1306.h and the adafruit_GFX.h libraries. Follow the next instructions to install those libraries.

After wiring the OLED display to the Arduino and installing all required libraries, you can use one example from the library to see if everything is working properly.

This is an example for our Monochrome OLEDs based on SSD1306 drivers. Pick one up today in the adafruit shop! ------> http://www.adafruit.com/category/63_98

The Adafruit library for the OLED display comes with several functions to write text. In this section, you’ll learn how to write and scroll text using the library functions.

First, you need to import the necessary libraries. The Wire library to use I2C and the Adafruit libraries to write to the display: Adafruit_GFX and Adafruit_SSD1306.

Then, you define your OLED width and height. In this example, we’re using a 128×64 OLED display. If you’re using other sizes, you can change that in the SCREEN_WIDTH, and SCREEN_HEIGHT variables.

The (-1) parameter means that your OLED display doesn’t have a RESET pin. If your OLED display does have a RESET pin, it should be connected to a GPIO. In that case, you should pass the GPIO number as a parameter.

To draw a pixel in the OLED display, you can use the drawPixel(x, y, color) method that accepts as arguments the x and y coordinates where the pixel appears, and color. For example:

The library also provides methods to displays rectangles with round corners: drawRoundRect() and fillRoundRect(). These methods accepts the same arguments as previous methods plus the radius of the corner. For example:

The library provides an additional method that you can use with shapes or text: the invertDisplay() method. Pass true as argument to invert the colors of the screen or false to get back to the original colors.

Copy your array to the sketch. Then, to display the array, use the drawBitmap() method that accepts the following arguments (x, y, image array, image width, image height, rotation). The (x, y) coordinates define where the image starts to be displayed.

In this section we’ll build a project that displays temperature and humidity readings on the OLED display. We’ll get temperature and humidity using the DHT11 temperature and humidity sensor. If you’re not familiar with the DHT11 sensor, read the following article:

Note:if you’re using a module with a DHT sensor, it normally comes with only three pins. The pins should be labeled so that you know how to wire them. Additionally, many of these modules already come with an internal pull up resistor, so you don’t need to add one to the circuit.

The code starts by including the necessary libraries. The Wire, Adafruit_GFX and Adafruit_SSD1306 are used to interface with the OLED display. The Adafruit_Sensor and the DHT libraries are used to interface with the DHT22 or DHT11 sensors.

The (-1) parameter means that your OLED display doesn’t have a RESET pin. If your OLED display does have a RESET pin, it should be connected to a GPIO. In that case, you should pass the GPIO number as a parameter.

In this case, the address of the OLED display we’re using is 0x3C. If this address doesn’t work, you can run an I2C scanner sketch to find your OLED address. You can find the I2C scanner sketch here.

We use the setTextSize() method to define the font size, the setCursor() sets where the text should start being displayed and the print() method is used to write something on the display.

After wiring the circuit and uploading the code, the OLED display shows the temperature and humidity readings. The sensor readings are updated every five seconds.

The I2C address for the OLED display we are using is 0x3C. However, yours may be different. So, make sure you check your display I2C address using an I2C scanner sketch.

The OLED display provides an easy and inexpensive way to display text or graphics using an Arduino. We hope you’ve found this guide and the project example useful.

oled lcd display module free sample

Crystalfontz America is the leading supplier of LCD, TFT, OLED and ePaper display modules and accessories. We specialize in providing our customers the very best in display products, cables and connectors.

In addition to our large catalog of displays, we offer LCD development kits, breakout boards, cables, ZIF connectors and all of the LCD software and drivers you need to develop your product or project. We are located in the U.S. so we can get product to you fast!

oled lcd display module free sample

Established in 2010, Topfoison has devoted itself to the manufacturing and development of high-quality products for the Wearable device, Smart Watch, VR, Medical device, Industrial LCD display including Color LCD modules/OLED/LCD display/Round lcd screen/Round AMOLED/ Square transflective lcd screen/ IPS full wide display/ 1080p fhd AMOLED and 2K 1440p lcd. Topfoison focus on1.22-7.0 inch small size displays, all the products produced in our company enjoys the most advanced production craft and technology as well as the strictly ISO quality management system.

oled lcd display module free sample

OLED is an abbreviation for “Organic Light Emitting Diode” which would seem to indicate that these devices are somehow related to traditional LEDs but differ in the sense that they are “organic”. This is actually true on both accounts. The term “organic” to most people is used when describing the production of food but in this case, it has an entirely different meaning.

The “organic” in OLED refers to the organic molecules used in creating these devices. Organic molecules are simply molecules that are based around lines or rings of carbon atoms. Examples of organic molecules include common items such as sugar, gasoline, alcohol, wood, and plastics. Your OLED wasn’t grown without the use of pesticides!

oled lcd display module free sample

OLED means Organic Light Emitting Diode, it is a relatively newer technology compared with LCD, VFD or plasma displays. It has the potential to replace current LCD and LED televisions, monitors, and cell phone displays. It is structurally more complex than traditional LEDs and utilizes organic, carbon-based semiconductor materials for the emission region rather than silicon or germanium.

An OLED module display is made up of several layers; first it is sealed on the top or bottom by a transparent material, usually glass or plastic. On each side is placed either an anode or a cathode, one of which must also be transparent for the light to be emitted effectively. Finally, within the anode and cathode are the organic LED compounds, called an emissive layer on the cathode side and conductive layer on the anode. When a positive voltage is placed on the anode, holes jump across the emissive conductive barrier and join with electrons, which produces a photon of light.

An OLED can be made much thinner than any known LCD technology, not only the material itself but the lack of any needed backlight, since LEDs emit their light while liquid crystals only manipulate the passage of light. The potential for flexible displays, less energy usage, higher contrast and refresh rates, and cheaper displays is driving many companies to make OLEDs mainstream.

Fast Response Speed: OLED display response times are around 1,000 times faster than LCD displays; it is around 10 0 μs (0.01 ms). While LCD displays perform poorly at low temperature which has no effect on OLED display performance.

Greater Contrast: LCD displays need backlight to be seen which makes some light leaking to cause losing contrast, while OLED displays are true black for background to create superior contrast.

Wider Viewing Angles: LCD displays have genetic drawback of using rubbing process in manufacturing which makes the viewing angle narrower, while OLED displays don’t have such an issue.

Thinner and Lighter in Weight: LCD displays need backlight to light up. The backlight has light guide, diffuser, reflector, BEF, PCB for LED chips etc. which LCD displays difficult to be very thin. OLED screen panel emits light itself which makes it lighter and thinner.

Power Consumption: Again, an LCD screen needs backlight to make it work. The backlight has to light the whole LCD panel even in the sleep mode or only a small fraction of the display to be used, such as showing only time on the cell. Phone. Even with quantum dots backlight technology development, it is still very expensive to use, while OLED can just display part of the pixels selectively to save power.

Orient Display has several standard OLED displays products for customer to buy OLED display modules to have hands on experience. They range from 0.96”, 1.27”, 1.45”, 1.54”, 1.69”, 2.23”, 3.12” with resolution 128×32, 128×64, 128×96, 128×128, 160×128, 256×64. The interfaces have the options of 6800,8080 parallel, 3 or 4 wire SPI, I2C and RGB interface. Our standard OLED products colors have RGB and white, but we have a lot of other sizes, resolutions and colors to choose available either as standard or custom OLED panel display solutions. Orient Display doesn’t have touch panel available in our standard OLED display products but custom made RTP or CTP are welcome and we also provide integration solution for our customers.

For more convenience for our customers, especially for electronic students and hobbyist, Orient Display develops a line of Arduino OLED Display Modules.

Touch panels have been a much better human machine interface which become widely popular. Orient Display has been investing heavy for capacitive touch screen sensor manufacturing capacity and LCD module production ability. With Orient huge production capacity, top notch quality, and competitive pricing, Orient has been working with top OLED panel manufacturers to provide the best touch display technology in the market.

If you have any questions about Orient DisplayOLED display panels and OLED display modules. Please feel free to contact: Sales Inquiries, Customer Service or Technical Support.

oled lcd display module free sample

Tired of using character LCD displays in your Arduino projects over and over? Well! They are, in fact, a thing of the past. Enter the fantastic OLED (Organic Light-Emitting Diode) displays! They’re extremely light, almost paper-thin, theoretically flexible, and produce a brighter, crisper image.

OLED displays are available in a range of sizes (such as 128×64, 128×32) and colors (such as white, blue, and dual-color OLEDs). Some OLED displays have an I2C interface, while others have an SPI interface.

One thing they all have in common, however, is that at their core is a powerful single-chip CMOS OLED driver controller – SSD1306, which handles all RAM buffering, requiring very little work from your Arduino.

In this tutorial, we’ll be using both I2C and SPI 0.96-inch 128×64 OLED displays. Don’t worry if your module is a different size or color; the information on this page is still useful.

An OLED display, unlike a character LCD display, does not require a backlight because it generates its own light. This explains the display’s high contrast, extremely wide viewing angle, and ability to display deep black levels. The absence of a backlight reduces power consumption significantly. The display uses about 20mA on average, though this varies depending on how much of the display is lit.

The SSD1306 controller operates at 1.65V to 3.3V, while the OLED panel requires a 7V to 15V supply voltage. All of these various power requirements are fulfilled by internal charge pump circuitry. This makes it possible to connect the display to an Arduino or any other 5V logic microcontroller without requiring a logic level converter.

Regardless of the size of the OLED display, the SSD1306 driver includes a 1KB Graphic Display Data RAM (GDDRAM) that stores the bit pattern to be displayed on the screen. This 1 KB memory area is divided into 8 pages (from 0 to 7). Each page has 128 columns/segments (block 0 to 127). And, each column can store 8 bits of data (from 0 to 7). That certainly proves that we have:

As previously stated, regardless of the size of the OLED module, each module contains 1KB of RAM. The 128×64 OLED module displays the entire contents of 1KB of RAM (all 8 pages), whereas the 128×32 OLED module displays only half of the RAM (the first 4 pages).

The SSD1306 controller in the OLED display has flexible but complex drivers. To use the SSD1306 controller, extensive knowledge of memory addressing is required. Fortunately, the Adafruit SSD1306 library was written to hide the complexities of the SSD1306 controller, allowing us to control the display with simple commands.

This is a hardware-specific library that handles lower-level functions. To display graphics primitives such as points, lines, circles, and rectangles, it must be paired with the Adafruit GFX Library. Install this library as well.

This sketch will provide you with a thorough understanding of how to operate the OLED display and can serve as the foundation for more practical experiments and projects. Try out the sketch, and then we’ll go over it in detail.

The sketch begins with the inclusion of four libraries: SPI.h, Wire.h, Adafruit_GFX.h, and Adafruit_SSD1306.h. Although the SPI.h library is not required for I2C OLED displays, we must include it to compile our program.

The next step is to create an object of Adafruit_SSD1306.h. The Adafruit_SSD1306 constructor accepts 3 arguments: screen width, screen height, and the Arduino pin number to which the display’s reset pin is connected. So, a couple of constants are defined.

Also, since the OLED display we are using doesn’t have a RESET pin, we will send -1 to the constructor to indicate that none of the Arduino pins are used to reset the display.

This sketch uses the I2C protocol for communicating with the display. However, the sketch is ready if you wish to use SPI. Simply uncomment the following lines of code.

In the setup function, we need to initialize the OLED object using the begin() function. This function accepts two parameters. The first parameter, SSD1306_SWITCHCAPVCC, turns on the internal charge pump circuitry, and the second parameter sets the OLED display’s I2C address. Most OLED display modules of this type have an I2C address of 0x3C, but some have 0x3D.

To display text on the screen, we must first set the font size. This can be accomplished by calling setTextSize() and passing a font size (starting from 1) as a parameter.

The final step is to use the display() command to instruct the library to bulk transfer the screen buffer to the SSD1306 controller’s internal memory and display the contents on the OLED screen.

To display inverted text, we use the setTextColor(FontColor,BackgroundColor) function once more. If you’ve been paying attention, you’ll notice that we previously passed only one parameter to this function, but now we’re passing two. This is possible due to function overloading.

The print() or println() functions can be used to display numbers on the OLED display. Because an overloaded implementation of these functions accepts 32-bit unsigned int values, you can only display numbers ranging from 0 to 4,294,967,295.

The print() and println() functions send data to the display as human-readable ASCII text, whereas the write() function sends binary data to the display. This function can thus be used to display ASCII symbols. For example, sending 3 displays a heart symbol.

You can scroll the display horizontally by calling the functions startscrollright() and startscrollleft(), and diagonally by calling the functions startscrolldiagright() and startscrolldiagleft(). All of these functions take two parameters: start page and stop page. Refer to the OLED Memory Map section for an explanation of the pages. Because the display has eight pages from 0 to 7, you can scroll the entire screen by scrolling all the pages, i.e. passing parameters 0x00 and 0x07.

Sometimes, we don’t want to scroll the whole display, but just a part of it. You can accomplish this by passing the appropriate start and stop page information to the scrolling functions.

Our last example shows how to display bitmap images on the OLED display. This comes in handy when displaying things like logos, sprites, infographics, or icons.

The drawBitmap() function is used to display a bitmap image on an OLED display. This function accepts six parameters: top left corner X coordinate, top left corner Y coordinate, monochrome bitmap byte array, bitmap width in pixels, bitmap height in pixels, and color.

But, before we can use the drawBitmap() function, we need an image to draw. Remember that the OLED display’s screen resolution is 128×64 pixels, so images larger than that will not display properly. To get a properly sized image, open your favorite drawing program, such as Inkscape, Photoshop, or MS Paint, and set the canvas size to 128×64 pixels.

Once you have a bitmap, you must convert it into an array that the SSD1306 OLED controller can understand. This can be accomplished in two ways: with image2cpp (online) or with LCD Assistant (offline).

The dimensions of your image will be displayed in the Canvas size option under Image Settings. If your image is larger than 128×64, change it to 128×64 by selecting the appropriate scaling option. You can see the result in the Preview section.

For your information, there is a setting called “Draw Mode”. It actually generates images based on the scanning pattern of the display. If your image appears distorted on your screen, try changing the mode.

There’s also a Windows application called LCD assistant that can turn your bitmap image into a data array. It is not as powerful as image2cpp, but it is still widely used by hobbyists.

For your information, there is a setting called Byte Orientation. It actually generates images based on the scanning pattern of the display. If your image appears distorted on your screen, try changing the mode.

oled lcd display module free sample

In this tutorial a 0.96 inch monochrome OLED display from Geekcreit is connected or interfaced to an Arduino. Libraries are then installed and some example programs run which show how to use the display in an Arduino sketch.

The display connects to Arduino using only four wires – two for power and two for data, making the wiring very simple. The data connection is I2C (I²C, IIC or Inter-Integrated Circuit). This interface is sometimes called TWI (Two Wire Interface).

At the very lowest level, the Arduino Wire library is used to communicate with the display. Libraries are available that make it easy to start using the display right away to display text and graphics. These libraries are installed in this tutorial.

The first and most important thing to note is that some of the displays may have the GND and VCC power pins swapped around. Check your display to make sure that it is the same as the image below. If the pins are swapped, make sure to change the connections to the Arduino – OLED VCC connects to 5V on the Arduino, OLED GND to GND on the Arduino.

The image below shows how to connect the Geekcreit 0.96 inch OLED I2C display to Arduino. Pin connections are as follows for wiring the OLED display to an Arduino Uno.

Two Arduino libraries must be installed to start using the display. The SSD1306 driver library is used to initialize the display and provide low level display functions. The GFX library provides graphics functions for displaying text, drawing lines and circles, etc. Both these libraries are available from Adafruit.

The SSD1306 driver isn"t set up for the Geekcreit OLED display by default. The display size must be changed in the driver before it can be used. If it is not changed, an error message will appear when attempting to verify the example sketch (see the section below) in the Arduino IDE:

Open the Adafruit_SSD1306 folder that was just installed in the Arduino libraries folder. Find Adafruit_SSD1306.h and open it in a text editor. Scroll down the file to find the section with the header SSD1306 Displays or search for for this term in the text editor to find it quickly. Comment out #define SSD1306_128_32 and uncomment #define SSD1306_128_64 so that the code in this section looks as follows.

If the libraries for the display were installed correctly, example programs for the display will be found in the Arduino IDE under File → Examples → Adafruit SSD1306 – open the ssd1306_128x64_i2c sketch under this menu.

The I²C address must be changed in this sketch in order for it to work with the Geekcreit display. Change the address from 0x3D to 0x3C as shown in the code below. This address is not 0x78 or 0x7A as printed on the back of the OLED board.

After making the changes, the sketch can be uploaded to the Arduino. When building the sketch for an Arduino Uno the IDE will display a low memory warning message, but the sketch will still run.

If the changes to the driver and example sketch were made correctly and the OLED display is wired to the Arduino correctly, the sketch should start running. The example program starts by showing the Adafruit logo, it then turns on a single pixel. Various graphics and text functions are then displayed.

This section of the tutorial shows how to quickly start using the I2C OLED display with the Adafruit libraries. A quick start Arduino template sketch, text display demo and various graphics functions follow.

The template file below can be used to quickly start new OLED projects. It includes the necessary header files and initialization code for the display. Copy the code and use it as a basis for starting new OLED display projects.

The Arduino sketch below sets a pixel at each corner of the screen as shown in the image below. A function is then used to display a line of text on the display as can be seen in the image – a "hello world" program. An explanation of how the program works follows.

After initializing the display, the above sketch then draws a pixel at each extreme of the display by using drawPixel() to place a pixel in each corner of the screen. The first parameter passed to drawPixel() is the screen X coordinate and the second parameter is the screen Y coordinate.

Use print() to write a line of text to the display as shown in the above sketch. Before writing text to the display, call setTextSize() and setTextColor(). Because this is a monochrome display, setTextColor() must be passed WHITE for the text to be seen on a black background.

Text that is written to the display is positioned by calling setCursor() to move the invisible cursor to the desired position. X and Y coordinates are passed to setCursor() to move the cursor and start of text to these pixel coordinates.

All text and graphics are written to buffer memory in the Arduino. Only when display() (display.display() in the above code) is called is the contents of the buffer displayed on the screen. This means that any text and graphical objects such as lines and circles will not appear on the screen until display() is called.

The number passed to the the Adafruit_SSD1306 constructor as shown in the above code is the number of the Arduino pin used to reset the display for displays that have a reset pin. As the display used in this tutorial does not have a reset pin, -1 is passed to the constructor so that none of the Arduino pins are used as a reset for the display.

If the display() function is called without first calling clearDisplay() as shown in the following code, the Adafruit logo appears on the screen. Where does this logo come from?

Adafruit have provided a short tutorial on using their GFX library. The tutorial explains more about the coordinate system used for displays and shows how to draw graphics primitives such as lines and circles.

oled lcd display module free sample

An import function allows additionally to use Windows fonts. With the FontEditor it is easy to generate for example Cyrillic, Greek and Arabic fonts. The preview function shows immediately the size and style in simulation window. When the testboard EA 9780-2USB is connected to the USB port, you can see the character (or any predefined text) live on the display which is plugged-in!