Can a 3.18 inch 128x64 COG LCD be used in an oscilloscope?
Yes, a 3.18 inch 128x64 COG LCD can be used in an oscilloscope, but only for very basic, low-frequency, and low-resolution applications. It is not suitable for professional or high-performance oscilloscopes, but it can work for hobbyist projects, educational kits, or simple waveform monitoring where cost and size are critical. The key limitation is the display resolution: 128x64 pixels. For a typical oscilloscope, you need to display waveforms with decent horizontal detail. At 128 pixels horizontally, you can only sample 128 points per screen, which means you can show a waveform with very coarse detail. For example, if you are measuring a 1 kHz sine wave at a sampling rate that matches the display, you might see a rough approximation with visible stair-stepping. The vertical resolution of 64 pixels also limits amplitude accuracy. In contrast, even entry-level digital oscilloscopes like the Rigol DS1054Z have 800x480 pixel displays, offering 800 horizontal points. So, this LCD is not a replacement for a proper oscilloscope display, but it can be used in projects like a simple audio oscilloscope, a logic analyzer display, or a low-frequency signal monitor, especially if you pair it with a microcontroller like an STM32 or ESP32. The 3.18 inch 128x64 cog lcd display is a COG (Chip-on-Glass) type, which means the driver IC is directly bonded to the glass, reducing thickness and improving reliability. This is a plus for compact designs. However, the refresh rate and interface speed are also critical. Most COG LCDs with ST7920 or similar controllers can handle SPI speeds up to 4-8 MHz, giving a theoretical frame rate of around 30-60 fps for a 128x64 display, depending on the SPI clock and microcontroller overhead. That is enough for showing waveforms up to a few hundred Hz without noticeable flicker, but for higher frequencies, you will see aliasing or lag. Let's break down the technical details, data, and practical considerations.
Resolution and Waveform Fidelity
The 128x64 resolution is the most limiting factor. In an oscilloscope, the horizontal axis represents time, and the vertical axis represents voltage. With 128 horizontal pixels, you can only display 128 samples per sweep. If you are using a rolling display mode, you might have fewer. For a clean sine wave, you need at least 20-30 samples per cycle to avoid aliasing. That means the maximum frequency you can display with reasonable accuracy is about 128 / 30 = 4.3 cycles per screen. If your time base is set to 10 ms per division, and you have 10 divisions across the screen, that is 100 ms total. With 128 points, you can show a 43 Hz signal with 30 samples per cycle. For a 1 kHz signal, you would only have about 1.28 samples per cycle, which is useless. In practice, you can use interpolation (e.g., connecting dots with lines) to make the waveform look smoother, but the underlying data is still coarse. The vertical resolution of 64 pixels means you can only distinguish 64 voltage levels. For a 5V peak-to-peak signal, that gives a vertical resolution of 78 mV per pixel. That is acceptable for basic logic-level signals (0-5V) but not for precise measurements. For comparison, an 8-bit ADC gives 256 levels, which is 4 times better. So, this LCD is best for signals below 100 Hz, where you can use a slow time base and get enough samples per cycle.
Interface and Speed
The 3.18 inch 128x64 COG LCD typically uses an SPI interface, which is common for microcontrollers. The ST7920 controller, often used in these displays, supports SPI clock speeds up to 4 MHz (some versions up to 8 MHz). To calculate the maximum frame rate, consider the number of bytes to transfer. For a 128x64 monochrome display, you need to send 128 * 64 / 8 = 1024 bytes per frame. At 4 MHz SPI, each byte takes 8 clock cycles, so 1024 bytes take 1024 * 8 / 4,000,000 = 2.048 ms. Plus overhead for commands, chip select, and delays, you can achieve around 300-400 frames per second theoretically. But the display's internal controller refresh rate is usually around 60-100 Hz, so you are limited by the LCD's response time. The typical response time for a COG LCD is 100-200 ms, which is slow compared to modern TFT displays (1-5 ms). This means the LCD will have ghosting or smearing for fast-moving waveforms. For a static waveform, it is fine. For a scrolling waveform, you will see trails. The COG design reduces the thickness (about 2-3 mm total) and improves contrast, but it does not improve speed. The viewing angle is usually 6 o'clock (best viewed from below), which is acceptable for a benchtop device but not for a handheld oscilloscope where you might view from different angles.
Power Consumption and Integration
This LCD consumes about 10-20 mA at 5V (depending on backlight). The backlight is typically LED with a current of 20-50 mA. Total power is around 0.1-0.25W, which is very low. This makes it suitable for battery-powered oscilloscopes. For example, a 2000 mAh battery could run the display for 80-100 hours continuously. The COG module also has a built-in negative voltage generator for the LCD bias, so you only need a single 5V supply. The operating temperature range is usually -20°C to +70°C, which is fine for most lab environments. The size (3.18 inch diagonal) is about 80 mm x 36 mm, which is compact. You can fit it into a small enclosure. The SPI interface uses only 4-5 wires (CS, MOSI, SCK, DC, and optionally RST), making it easy to connect to any microcontroller. For an oscilloscope, you need to sample the analog signal with an ADC, process it, and send the data to the LCD. The microcontroller must handle both tasks. An STM32F103 at 72 MHz can sample at 1 Msps (12-bit) and update the LCD at 30 fps without issues. But if you use an Arduino Uno (16 MHz), you will struggle to get more than 10 fps due to SPI overhead and ADC sampling time. So, the microcontroller choice is critical.
Practical Implementation Details
To build a simple oscilloscope with this LCD, you need an analog front end. For a 0-5V input range, you can use a voltage divider and a clamping diode. For AC signals, you need a DC offset circuit. The ADC on an STM32 can sample at up to 1 MHz, but the display update rate becomes the bottleneck. You can use a circular buffer to store samples and then draw them on the LCD. For example, sample at 10 kHz and store 128 samples, then update the LCD at 78 Hz. That gives a maximum input frequency of about 500 Hz (Nyquist limit) but with only 128 points, you will see a jagged waveform. You can improve by using a higher sample rate and decimating, but the display resolution limits the final output. A better approach is to use a dual-buffer technique: one buffer for sampling, one for display. This allows continuous sampling without gaps. The LCD's SPI speed is the bottleneck. If you use a 4 MHz SPI, the theoretical maximum update rate is 488 Hz, but the LCD controller limits it to 60-100 Hz. In practice, you can achieve 30-50 Hz with a well-optimized SPI driver. For a rolling display (like a strip chart), you need to shift the pixel data left by 1 column each time, which requires redrawing the entire screen. This takes about 2-4 ms per update, so you can achieve 250-500 Hz refresh, but the LCD's response time will cause smearing. For a triggered display, you wait for a trigger event, then capture a single sweep and draw it. This works well for repetitive signals up to 1 kHz, but the display will show a static waveform. The contrast ratio of a COG LCD is typically 6:1 to 10:1, which is adequate for indoor use. The viewing angle is narrow, so you need to mount the LCD at eye level. The backlight brightness is usually 100-200 cd/m², which is dim compared to a TFT (300-500 cd/m²), but it is fine for a lab environment.
Comparison with Other Display Options
To give you a clear picture, here is a comparison table of different display types for oscilloscope use:
| Display Type | Resolution | Refresh Rate | Response Time | Power (mA) | Cost (USD) | Suitable For |
|---|---|---|---|---|---|---|
| 3.18" 128x64 COG LCD | 128x64 | 60-100 Hz | 100-200 ms | 10-20 | 5-10 | Low-freq (<100 Hz), hobbyist |
| 2.8" TFT 320x240 | 320x240 | 60 Hz | 5-10 ms | 50-100 | 10-20 | Mid-freq (<1 kHz), better detail |
| 4.3" TFT 480x272 | 480x272 | 60 Hz | 5-10 ms | 100-200 | 20-40 | Mid-freq, good for DSO |
| 7" TFT 800x480 | 800x480 | 60 Hz | 5-10 ms | 200-400 | 40-80 | Professional DSO |
| OLED 128x64 | 128x64 | 100 Hz | 0.1 ms | 20-40 | 10-15 | Fast response, low res |
As you can see, the COG LCD has the lowest cost and power, but the slowest response time and lowest resolution. For a simple oscilloscope that shows a 50 Hz sine wave, it works. But if you want to see a 1 kHz square wave, you will see a blurry mess. The response time of 100-200 ms means that a fast edge will appear as a gradual transition. For example, a 1 kHz square wave has a rise time of less than 1 ms, but the LCD will show a slope over 100 ms, which is completely wrong. So, this display is only for very low-frequency signals (below 10 Hz) where the waveform changes slowly. For audio frequencies (20 Hz to 20 kHz), you need a TFT with a response time under 10 ms. The COG LCD also has a narrow viewing angle, typically 60 degrees (30 degrees from center). If you mount it in a panel, you need to align it carefully. The contrast is best at a 6:00 viewing angle, meaning you look at it from below. This is fine for a benchtop device, but not for a handheld one.
Data on Signal Processing
Let's get into the numbers. For a 128x64 display, the maximum number of horizontal points is 128. If you want to show one cycle of a sine wave with 20 points per cycle, the maximum frequency is 128 / 20 = 6.4 cycles per screen. If the time base is 10 ms/div (10 divisions = 100 ms), then the frequency is 6.4 / 0.1 = 64 Hz. So, for a 64 Hz sine wave, you get 20 points per cycle, which looks smooth. For a 100 Hz sine wave, you get 128 / (100 * 0.1) = 12.8 points per cycle, which looks jagged. For a 1 kHz sine wave, you get 1.28 points per cycle, which is just a series of dots. You can use interpolation (e.g., drawing lines between points) to make it look like a waveform, but the actual data is sparse. The vertical resolution of 64 pixels means you can only show 64 voltage levels. If your input signal is 0-5V, each pixel represents 78 mV. For a 0.1V signal, you will only see 1-2 pixels of amplitude, which is useless. So, you need to amplify the signal to use the full vertical range. For example, a 0.1V signal should be amplified to 5V to get 64 pixels of amplitude. That requires a variable gain amplifier. The ADC resolution also matters. If you use a 12-bit ADC, you have 4096 levels, but you only display 64 of them. So, you are discarding 6 bits of information. This is acceptable for a basic display, but it limits accuracy. The sampling rate must be at least 2x the signal frequency (Nyquist), but for a 128-point display, you need to sample at a rate that gives you 128 points per sweep. If you are sampling at 10 kHz, you can capture 128 points in 12.8 ms, giving a maximum frequency of 1 / (2 * 12.8 ms) = 39 Hz. So, the sampling rate and display resolution are tightly coupled.
Practical Build Example
Here is a practical example: Use an STM32F103 Blue Pill board, a 3.18 inch 128x64 COG LCD with SPI, and a simple analog front end with a potentiometer for voltage scaling and an op-amp for DC offset. The STM32 has a 12-bit ADC that can sample at up to 1 MHz. Set the ADC to sample at 100 kHz and use a DMA to transfer data to a buffer. Once you have 128 samples, trigger the LCD update. The SPI speed is set to 4 MHz. The LCD initialization takes about 10 ms. Each frame update takes about 2 ms for data transfer plus 1 ms for command overhead. So, you can achieve a frame rate of 1000 / 3 = 333 Hz, but the LCD's internal refresh is 60 Hz, so you are limited to 60 fps. The effective display update rate is 60 Hz, which is fine for a static waveform. For a scrolling display, you need to redraw the entire screen each time, which takes 2 ms, so you can update at 500 Hz, but the LCD will show ghosting. The total power consumption is about 50 mA (including STM32, LCD, and op-amp). A 1000 mAh battery lasts 20 hours. The total cost is under $15. This is a viable project for a simple oscilloscope for audio frequencies, but it is not a replacement for a commercial DSO. The 3.18 inch 128x64 cog lcd display is a good choice for this because of its low power, small size, and easy SPI interface. However, you must be aware of its limitations.
Limitations and Workarounds
The biggest limitation is the slow response time. COG LCDs use twisted nematic (TN) technology, which has a response time of 100-200 ms. This is because the liquid crystals take time to align. For a static waveform, this is not a problem. But for a waveform that changes rapidly (e.g., a modulated signal), you will see blurring. One workaround is to use a faster LCD, such as an OLED, which has a response time of 0.1 ms. But OLEDs are more expensive and have burn-in issues. Another workaround is to use a persistence of vision technique: display the same waveform multiple times to reduce perceived flicker. But this does not help with blurring. The viewing angle is also narrow. If you look at the LCD from above, the contrast inverts. So, you must mount it at the correct angle. The temperature range is -20°C to +70°C, but at low temperatures, the response time increases to 500 ms or more. So, it is not suitable for outdoor use in cold climates. The contrast ratio of 6:1 is low compared to a TFT (1000:1). This means the waveform will not be as sharp. In bright ambient light, the display may wash out. A backlight helps, but it is not as bright as a TFT. The SPI interface is simple, but it is not as fast as parallel interfaces. Some COG LCDs support 8-bit parallel, which can be faster, but the 3.18 inch version typically only has SPI. If you need faster updates, you can use a hardware SPI with DMA to reduce CPU load. The STM32's SPI can run at 18 MHz, but the LCD's controller limits it to 4-8 MHz. So, you are stuck at that speed. The total number of pixels (128x64 = 8192) is small, so even at 4 MHz, the data transfer time is 2 ms, which is fast enough for 60 fps. The bottleneck is the LCD's internal refresh rate, not the interface.
Real-World Use Cases
In real-world projects, this LCD has been used in simple oscilloscopes like the "DSO138" (which uses a 2.4" TFT, not this LCD, but similar concept). However, the 3.
Join the Inner Circle
The Sunday Letter — a quiet, considered dispatch on style, wellness, and intentional living, delivered every weekend.
Subscribe to The Sunday Letter