Lightweight ESP32 project that runs a small web portal in Access Point mode and sends Morse code by beeping a buzzer and blinking an LED. A 16x2 I2C LCD shows status and scrolls the message while playing.
Features
- Serves a single-page web UI (AP mode) to enter a message and unit speed
- Plays Morse code through a buzzer and a status LED
- Scrolls playing message on a 16x2 I2C LCD
- Adjustable speed (
unitin milliseconds) from 50 to 1000 ms per unit
Files
sketch.ino— Main Arduino/ESP32 sketch implementing the web server, Morse playback, and LCD UI
Hardware
- ESP32 development board
- Piezo buzzer connected to GPIO 5 (BUZZER_PIN)
- External LED connected to GPIO 4 (LED_PIN)
- On-board LED used on GPIO 2 (ONBOARD_LED)
- 16x2 I2C LCD (default address 0x27) using SDA=GPIO21 and SCL=GPIO22
Wiring summary:
- Buzzer -> GPIO5
- External LED -> GPIO4 (with appropriate resistor)
- LCD SDA -> GPIO21, SCL -> GPIO22 (GND and 5V/3.3V as appropriate)
Software / Libraries
- ESP32 board support for Arduino (select an ESP32 board in the Arduino IDE or PlatformIO)
- Libraries used in the sketch:
LiquidCrystal_I2C(I2C LCD support)Ticker(for blinking the onboard LED)WebServer(provided by ESP32 core)
Install these via the Arduino Library Manager or add to your platformio.ini.
How it works
- The ESP32 starts in Wi-Fi AP mode with SSID
ESP32-Morseand passwordalphazero. - Open a browser and go to the device IP (default AP IP is
192.168.4.1) or simply visithttp://192.168.4.1/. - The web UI accepts a text message and a
unitvalue (ms per Morse unit). The default unit is 100 ms. - Submitting sends a GET request to
/send?text=...&unit=.... The device repliesOKthen plays the Morse code and updates the LCD while playing.
Morse timing (implemented in sketch.ino):
- Dot = 1 unit ON
- Dash = 3 units ON
- Intra-character gap = 1 unit OFF
- Between letters = 3 units total (the code implements small additional gaps)
- Between words = 7 units total
Usage
- Flash
sketch.inoto your ESP32 using the Arduino IDE or PlatformIO. - Power the board; it will create the Wi-Fi AP
ESP32-Morse(passwordalphazero). - Connect your computer or phone to that AP.
- Open
http://192.168.4.1/in a browser, enter a message and optional unit speed, then press Send.
HTTP API
GET /— serves the web UIGET /send?text=<message>&unit=<ms>— trigger Morse playback;unitoptional (50–1000)
Troubleshooting
- If the LCD shows nothing, confirm the I2C address (0x27) and wiring.
- If buzzer/LED don't respond, check pins and wiring and ensure the sketch matches your pin assignments.
- If you can't reach the web UI, verify your device connected to the ESP32 AP and try
http://192.168.4.1/. - Use the Serial Monitor at 115200 baud for debug prints (the sketch prints the AP IP and server start message).
Notes & customization
- Change
unitMsdefault insketch.inoto alter default speed. - Modify pin constants (
BUZZER_PIN,LED_PIN,ONBOARD_LED) to suit your wiring. - The LCD address and I2C pins are set at the top of
sketch.ino— update if your hardware differs.
License This project is provided as-is. Adapt and reuse as you like.