Display and HMI
EDA-Piano: 12-Key Touch Piano (ESP8266 + SC12B)
A low-cost 12-key touch piano based on ESP8266 and SC12B, with chord support, OLED display, and WiFi control.
Display and HMI
touchaudiooledwifi
ESP8266, SC12B, TP4056
Official path: https://oshwhub.com/course-examples/eda-piano2
01 Overview
EDA-Piano is an ESP8266-based 12-key touch piano project designed for low cost and easy learning.
Core components are the ESP8266 module and the SC12B touch controller; the TP4056 charger is optional.
It supports simultaneous 12-key detection, chord playing, real-time OLED feedback, and WiFi-based web control.
It replaces mechanical keys with touch electrodes, simplifying assembly and reducing cost.
Ideal for electronics courses, maker education, and music introduction; also a prototype for IoT audio interaction.
It is not a professional instrument—the buzzer produces simple tones—but it demonstrates touch sensing, chord logic, and IoT control.
02 Hardware
MCU: ESP8266 module, providing WiFi and GPIO interfaces.
Touch sensing: SC12B chip, communicates via I2C, supports 12-key simultaneous detection with high accuracy for chords.
Audio output: buzzer driven via PWM or GPIO; for richer tones, an I2S DAC and speaker can be added (extra circuitry required).
Display: OLED screen (I2C interface, e.g., SSD1306) showing current keys and note information.
Power: TP4056 Li-ion charging module (optional), provides charging and protection for 3.7V Li-ion; if removed, use USB 5V directly.
Touch electrodes: 12 copper pads on PCB, routed to SC12B inputs; layout must avoid interference.
Total BOM cost is low, dominated by the ESP8266 and SC12B.
03 Software flow
Flash firmware: use Arduino IDE or ESP-IDF, select ESP8266 board, verify GPIO assignments before flashing.
Initialize: power-on, init I2C (for SC12B and OLED), configure WiFi (STA or SoftAP).
Touch scan: periodically read SC12B key state registers to detect presses and releases.
Chord logic: based on simultaneous key combinations, generate note frequencies and output via PWM to buzzer.
OLED display: update current keys and note names, show chord type (e.g., C major, Am).
Web control: start HTTP server, provide web page to remotely view key states or trigger notes.
Error handling: if WiFi fails, enter AP mode; if touch chip unresponsive, retry I2C communication.
Low power: optional sleep mode, enter deep sleep when idle, wake on touch (requires hardware support).
04 Core points
SC12B I2C address and register map must be checked in the datasheet; minor variations may exist.
Touch electrode layout affects sensitivity; follow SC12B design guidelines, avoid long or parallel traces.
Buzzer tone is simple; for multi-timbre or chord mixing, use I2S DAC and amplifier.
WiFi communication may introduce latency; for real-time play, reduce web polling or disable it.
TP4056 charging module requires battery protection; if removed, ensure stable power supply.
ESP8266 has limited ADC pins; for additional analog inputs, watch pin multiplexing.