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:
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)
- 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
| Parameter | Value |
|---|---|
| Resolution | 128 × 64 pixels (8,192 total) |
| Display Size | 0.96" diagonal (typical) |
| Pixel Size | ~0.15mm × 0.15mm |
| Driver IC | SSD1306 or compatible |
| Interface | I2C (2-wire) or SPI (4-wire) |
| Operating Voltage | 3.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)
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:
Binary: 0b0111100 + R/W bit
Transaction Example:
START → Address(0x3C) → ACK → Control(0x00) → ACK → Data → ACK → STOP
Timing:
- Standard mode: 100 kHz
- Fast mode: 400 kHz (common for OLED)
- Fast mode plus: 1 MHz
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
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:
Active Buzzer:
- Contains internal oscillator
- Produces fixed frequency when powered
- Just needs DC voltage (simpler to use)
- Cannot change pitch
- 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
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
| Note | Frequency (Hz) | Wavelength (m) |
|---|---|---|
| C4 (Middle C) | 262 | 1.31 |
| D4 | 294 | 1.17 |
| E4 | 330 | 1.04 |
| F4 | 349 | 0.98 |
| G4 | 392 | 0.88 |
| A4 (Concert Pitch) | 440 | 0.78 |
| B4 | 494 | 0.69 |
| C5 | 523 | 0.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
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
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
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
| Application | Frequency Range | Pattern |
|---|---|---|
| Alarm/Alert | 2-4 kHz | Pulsed or warbling |
| Notification | 1-2 kHz | Short beeps |
| Error/Warning | 500-1000 Hz | Low, continuous |
| Music/Melody | 200-2000 Hz | Tonal sequence |
| Morse Code | 800-1200 Hz | Dot-dash pattern |
Use Cases Summary
OLED Display Applications
- Wearables: Smartwatches, fitness trackers
- Instrumentation: Multimeters, oscilloscopes, sensor readouts
- Embedded Systems: Status displays, user interfaces
- Gaming: Handheld consoles, controller displays
- IoT Devices: Smart home displays, environmental monitors
Passive Buzzer Applications
- User Interface: Tactile feedback, confirmation beeps
- Alarms: Intrusion detection, timer alerts
- Accessibility: Audio cues for visually impaired users
- Toys: Sound effects, musical instruments
- Industrial: Process completion signals, error warnings