OLED Physics and Operation

OLED (Organic Light-Emitting Diode):
Unlike LCD displays that require backlighting, OLEDs emit light when electric current passes through organic compounds. Each pixel is self-illuminating.

Structure:
  • Cathode (negative electrode)
  • Emissive organic layers
  • Conductive organic layer
  • Anode (positive electrode, transparent)
Advantages:
  • True black (pixels completely off)
  • High contrast ratio (>100,000:1)
  • Wide viewing angles (170°)
  • Low power (only active pixels consume power)
  • Fast response time (<1μs)
  • No backlight needed

128x64 OLED Specifications

ParameterValue
Resolution128 × 64 pixels (8,192 total)
Display Size0.96" diagonal (typical)
Pixel Size~0.15mm × 0.15mm
Driver ICSSD1306 or compatible
InterfaceI2C (2-wire) or SPI (4-wire)
Operating Voltage3.3V - 5V
Current Draw~20mA (typical), ~40mA (max)
Refresh Rate~60 Hz

Memory Organization

Display RAM Structure:
128 columns × 8 pages × 8 bits = 8,192 pixels

Each page is 8 pixels tall (vertical byte-oriented):
- Page 0: rows 0-7
- Page 1: rows 8-15
- ...
- Page 7: rows 56-63

Memory Size:
128 bytes/page × 8 pages = 1,024 bytes (1KB)

Pixel Addressing:
Each bit controls one pixel (1=ON, 0=OFF)
Byte at column X, page Y controls pixels at (X, Y×8) through (X, Y×8+7)

I2C Communication

I2C Protocol: Two-wire serial interface (SDA=data, SCL=clock)

Timing:
  • Standard mode: 100 kHz
  • Fast mode: 400 kHz (common for OLED)
  • Fast mode plus: 1 MHz
Address: 0x3C (common) or 0x3D
Binary: 0b0111100 + R/W bit

Transaction Example:
START → Address(0x3C) → ACK → Control(0x00) → ACK → Data → ACK → STOP

Power Consumption Analysis

Current Draw vs Display Content:

All pixels OFF: ~2mA (driver IC only)
50% pixels ON: ~20mA
All pixels ON: ~40mA

Energy per Refresh (60 Hz):
At 5V, 20mA average:
Power = V × I = 5V × 0.02A = 0.1W
Energy/frame = 0.1W / 60 = 1.67mJ

Battery Life Estimate:
AA battery: 2000mAh @ 1.5V = 3Wh
Runtime = 3Wh / 0.1W = 30 hours

🔊 Passive Buzzer Technology

Buzzer Physics and Operation

Passive vs Active Buzzers:

Active Buzzer:
  • Contains internal oscillator
  • Produces fixed frequency when powered
  • Just needs DC voltage (simpler to use)
  • Cannot change pitch
Passive Buzzer:
  • No internal oscillator
  • Requires external square wave signal
  • Frequency of input = frequency of sound
  • Can produce different tones (musical)
  • More versatile for melodies

Sound Wave Physics

Sound Generation:
Passive buzzers contain a piezoelectric element that vibrates when alternating voltage is applied. The vibration creates pressure waves in air.

Key Relationships:
Frequency (f) = Speed of sound (v) / Wavelength (λ)
v ≈ 343 m/s at 20°C

Human Hearing Range: 20 Hz - 20,000 Hz
Buzzer Effective Range: 100 Hz - 10,000 Hz
Most Pleasant Range: 500 Hz - 5,000 Hz

Musical Note Frequencies

NoteFrequency (Hz)Wavelength (m)
C4 (Middle C)2621.31
D42941.17
E43301.04
F43490.98
G43920.88
A4 (Concert Pitch)4400.78
B44940.69
C55230.66

PWM Generation for Tones

Arduino tone() Function:
Generates square wave at specified frequency

Example: tone(pin, 440, 1000)
- Pin: Output pin
- 440: Frequency in Hz (A4 note)
- 1000: Duration in ms

Square Wave Characteristics:
50% duty cycle (equal HIGH and LOW time)
Period (T) = 1 / frequency

For 440 Hz:
T = 1/440 = 2.27 ms
HIGH time = LOW time = 1.14 ms

Sound Pressure Level

Decibel Scale (dB SPL):
dB = 20 × log₁₀(P / P₀)

Where:
- P = Measured sound pressure
- P₀ = Reference pressure (20 μPa, threshold of hearing)

Typical Buzzer Output:
80-95 dB at 10cm distance

Distance Effect:
Sound intensity follows inverse square law:
I₂ = I₁ × (d₁/d₂)²

Doubling distance reduces intensity by 6 dB

Circuit Design

Basic Passive Buzzer Connection: Arduino Pin 8 ---[100Ω]--- BUZZER(+) | GND Protection resistor (100Ω) limits current and reduces voltage spikes from inductive kickback. Alternative with transistor (for louder output): Pin 8 ---[1kΩ]---┐ | ┌───┴───┐ │ NPN │ │2N2222 │ └───┬───┘ | BUZZER(+) ──┘ | GND

Resonant Frequency

Piezoelectric Resonance:
Each buzzer has a resonant frequency where it's loudest and most efficient. This is typically 2-4 kHz for small buzzers.

Quality Factor (Q):
Q = f₀ / Δf
Where f₀ = resonant frequency, Δf = bandwidth

Higher Q = narrower bandwidth = louder at resonance but quieter elsewhere

Practical Applications

ApplicationFrequency RangePattern
Alarm/Alert2-4 kHzPulsed or warbling
Notification1-2 kHzShort beeps
Error/Warning500-1000 HzLow, continuous
Music/Melody200-2000 HzTonal sequence
Morse Code800-1200 HzDot-dash pattern

Use Cases Summary

OLED Display Applications

Passive Buzzer Applications