Skip to content

Test bench for U8g2 version

Alexander Spiridonov edited this page Sep 27, 2021 · 2 revisions

The following basic configuration can be prepared in order to follow along with the examples provided with the library.

About

Test bench for U8g2 version of library consists of 128x64 Graphic LCD screen (with addition of one potentiometer to control contrast of the screen) and 6 push-buttons (momentary switches) used to navigate through the menu: four directional controls, one Cancel, and one Ok.

Parts List

  • Arduino UNO or compatible
  • 128x64 Graphic LCD based on KS0108 chipset or compatible (e.g.)
  • Six momentary switches
  • Six 10kOhm resistors
  • One 10kOhm potentiometer

Schematic

Each switch is connected to the input pin 2 to 7 of Arduino using pullup resistor (so the LOW means that the button is pressed). Note, that this is different from how test bench for AltSerialGraphicLCD or Adafruit GFX version is wired. You may wish to implement additional debounce filtering to minify chances of false readings at the moment of button press.

LCD screen is wired as described below.

LCD pin # LCD pin name Arduino pin
1 Vcc 5V
2 GND GND
3 Vo 10kOhm potentiometer to Vee
4 DB0 8
5 DB1 9
6 DB2 10
7 DB3 11
8 DB4 12
9 DB5 13
10 DB6 18
11 DB7 19
12 CS0 A3
13 CS1 A2
14 RES RESET
15 R/W GND
16 D/I (DC) A1
17 E (Enable) A0
18 Vee 10kOhm potentiometer to Vo
19 A 5V
20 K GND

Breadboard

Connect one terminal of each momentary switch both to its corresponding Arduino input pin (2, 3, 4, 5, 6, 7) and to 5V through 10kOhm pullup resistor. Connect the opposite terminal to ground.

Connect LCD screen to an Arduino board as shown below (with one terminal of 10kOhm potentiometer connected to Vo pin of LCD screen and the other two to Vee and ground).

Use

This test bench is compatible with the U8g2 examples supplied with the GEM library (if not stated otherwise). After compiling and uploading sketch to Arduino, wait while LCD screen boots and menu is being initialized and drawn to the screen. You now may use push-buttons to navigate and interact with the menu. See description of the specific example for details.