This is an old revision of the document!


Signal Corps — Old School Morse Code Trainer

Introduction

Signal Corps Trainer is an embedded device for training and decoding Morse code, built around the ATmega328P-XMINI microcontroller and a vintage Soviet telegraph key.

What it does:

  • Allows the user to physically send Morse code by pressing the telegraph key, automatically decoding characters in real time
  • Provides a Trainer mode in which the system generates random letters and checks whether the user transmits them correctly
  • Provides a Decoder mode in which any incoming signal is interpreted and displayed on the LCD screen
  • Visualizes the Morse signal waveform on the OLED graphical display
  • Provides audio feedback through a piezo buzzer and visual feedback through colored LEDs

Project goal: The project aims to transform a vintage object — the Soviet telegraph key — into a fully functional educational tool. Morse code is not merely history: it is still actively used in amateur radio, civil aviation, and emergency communications.

Starting idea: A fascination with analogue technology and the desire to understand how radio operators communicated before the digital era. A telegraph key forgotten in a drawer became the starting point for a complete learning system.

Why it is useful: Unlike software-based Morse learning applications, this device provides the authentic mechanical feel of a real telegraph key and the characteristic sound heard by operators 70 years ago. The simultaneous physical and audio feedback accelerates the memorization of the code.

General Description

The system is organized into four functional blocks that interact in real time through the microcontroller's pins:

Block diagram:

┌────────────────────────────────────────────────────────────────┐
│                    Signal Corps Trainer                        │
│                                                                │
│  ┌──────────────┐    I2C (SDA/SCL)    ┌─────────────────────┐  │
│  │  LCD 1602    │◄───────────────────►│                     │  │
│  │  (0x27)      │                     │   ATmega328P-XMINI  │  │
│  └──────────────┘                     │                     │  │
│                                       │   MCU + mEDBG       │  │
│  ┌──────────────┐    I2C (SDA/SCL)    │                     │  │
│  │  OLED 0.96"  │◄───────────────────►│  PC4=SDA  PC5=SCL   │  │
│  │  SSD1306     │                     │  PC0=A0   D2=INT0   │  │
│  │  (0x3C)      │                     │  D6       D7  D8    │  │ 
│  └──────────────┘                     │  D9(PWM)            │  │
│                                       └─────────┬───────────┘  │
│  ┌──────────────┐                               │              │
│  │  KY-037      │──── AO ──────────────── PC0   │              │
│  │  Sound sensor│                               │              │
│  └──────────────┘                               │              │
│                                                 │              │
│  ┌──────────────┐                               │              │
│  │  Morse key   │──── D2 (INT0) ────────────────┤              │
│  │  Vintage USSR│                               │              │
│  └──────────────┘                               │              │
│                                                 │              │
│  ┌──────────────┐                               │              │
│  │  Mode BTN    │──── D6 ───────────────────────┤              │
│  │  Trainer/Dec.│                               │              │
│  └──────────────┘                               │              │
│                                                 │              │
│                      ┌──────────────────────────┘              │
│                      │                                         │
│              D7 ─────►──── R1(220Ω) ──── Green LED             │
│              D8 ─────►──── R2(220Ω) ──── Red LED               │
│              D9 ─────►──── Passive Piezo Buzzer                │
│                                                                │
└────────────────────────────────────────────────────────────────┘

Module descriptions:

  • ATmega328P-XMINI — Central processing unit. Runs the Morse decoding logic, measures pulse durations (dot/dash), manages the I2C displays, and controls all feedback elements. The on-board mEDBG debugger enables direct programming via USB without an external programmer.
  • LCD 1602 (I2C, 0x27) — Displays the decoded text character by character and system status messages (active mode, Trainer score, errors).
  • OLED 0.96” SSD1306 (I2C, 0x3C) — Visualizes the Morse signal waveform in real time (horizontal scroll) and shows feedback animations for correct/incorrect answers.
  • KY-037 Sound Sensor — Monitors the ambient noise level via the analogue output (AO → A0). If the threshold is exceeded, the red LED lights up as a warning.
  • Vintage telegraph key — Primary input interface. Connected to D2 (INT0) for hardware interrupt detection. Generates pulses of variable duration (dot < 150 ms, dash > 150 ms).
  • Mode selector button (SW2) — Connected to D6, switches between Trainer and Decoder mode on each press.
  • Passive piezo buzzer — Generates a 700 Hz tone on D9 (PWM, ``tone()`` function) synchronized with the key signal.
  • Green LED / Red LED — Instant visual feedback: green = correct answer in Trainer mode, red = error or ambient noise detected.

Hardware Design

Bill of Materials

Reference Component Role Qty
U1 ATmega328P-XMINI Main microcontroller x1
U2 LCD 1602 with I2C interface 16×2 text display x1
U3 OLED 0.96” SSD1306 128×64 graphical display x1
SEN1 KY-037 sound sensor Analogue acoustic input x1
SW1 Vintage telegraph key Haptic Morse input x1
SW2 Push-button Trainer/Decoder mode selector x1
BZ1 Passive Piezo Buzzer Morse audio output x1
LED1 Green LED 5mm Correct answer indicator x1
LED2 Red LED 5mm Error / noise indicator x1
R1, R2 220Ω resistor LED current limiting x2
R3 10kΩ resistor External pull-up (optional) x1
C1 100nF capacitor Power supply decoupling x1
Breadboard + jumper wires Prototype wiring

Electrical Connections — Pinout

MCU Pin Type Connected to
PC4 (A4) SDA LCD 1602 + OLED SSD1306 (shared I2C bus)
PC5 (A5) SCL LCD 1602 + OLED SSD1306 (shared I2C bus)
PC0 (A0) Analog KY-037 analogue output (AO)
D2 INT0 Telegraph key (hardware interrupt)
D6 Digital Mode selector button
D7 Digital Green LED via R1 (220Ω)
D8 Digital Red LED via R2 (220Ω)
D9 PWM Passive Piezo Buzzer — tone() function
5V Power Power supply for all components
GND Power Common ground

Technical Notes

The I2C bus is shared between the LCD and the OLED. Both devices coexist on the same SDA/SCL bus thanks to their different addresses: LCD = 0x27, OLED = 0x3C.

  • Pull-up: SW1 and SW2 use the MCU's internal pull-up resistors (INPUT_PULLUP). The external 10kΩ resistor is optional.
  • Decoupling: Capacitor C1 (100nF) should be placed as close as possible to the MCU's VCC/GND pins for effective power supply noise filtering.
  • Power supply: The entire system is powered at 5V via USB from the X-MINI board.

Electrical Schematic

The circuit was assembled on a breadboard using male-to-male and male-to-female jumper wires. The detailed schematic includes:

  • The I2C bus with both displays connected in parallel
  • Protection resistors R1 and R2 in series with the LEDs
  • Decoupling capacitor C1 between VCC and GND
  • The telegraph key connected directly between D2 and GND (internal pull-up active)

Software Design

TODO — to be completed in a future update.

Results

  • The Soviet telegraph key works correctly as a simple switch — detected via INPUT_PULLUP on D2
  • The piezo buzzer generates a 700 Hz tone synchronized with key presses, with no perceptible latency
  • The OLED display shows the current state and signal waveform in real time
  • The shared I2C bus between the LCD and OLED operates stably with addresses 0x27 and 0x3C
  • The green/red LED feedback system responds correctly to commands on pins D7/D8

Conclusions

The project demonstrates that vintage technology can be reinterpreted in a modern educational context. The Soviet telegraph key, far from being a mere collector's item, becomes an authentic tactile interface and a bridge between 20th-century analogue communication and contemporary microelectronics.

The primary value of this project lies in the learning experience: the user does not learn Morse code through an abstract application, but through a physical object with history, a distinctive mechanical feel, and the characteristic sound heard by radio operators 70 years ago.

Challenges encountered:

  • Correctly configuring the ATmega328P-XMINI board in Arduino IDE (mEDBG driver)
  • Sharing the I2C bus without address conflicts
  • Calibrating dot/dash timing thresholds to match the user's keying speed

Download

The project archive contains:

  • Complete source code (.ino)
  • Electrical schematic (PDF)
  • README.md file with installation and usage instructions
  • ChangeLog with version history

Files are uploaded to the wiki using the Add Images or other files facility.

Journal

TODO — to be completed as the project progresses.

Bibliography / Resources

Hardware Resources

Software Resources

pm/prj2026/cezar.zlatea/rodion.balaniuc.1778184781.txt.gz · Last modified: 2026/05/07 23:13 by rodion.balaniuc
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0