|
Arduino Nano R3 |
x 1 | |
|
128x64 LCD with ST7565 driver chip |
x 1 | |
|
ps/2 keyboard female connector |
x 1 | |
|
LEDGeneric
|
x 1 | |
|
Buzzer |
x 1 |
![]() |
arduino IDEArduino
|
|
![]() |
Soldering Iron Kit |
How to make Arduino Morse Code Generator
Morse code is a method used in telecommunication to encode text characters as standardized sequences of two different signal durations, called dots and dashes.
Morse code is named after Samuel Morse, one of the early developers of the system adopted for electrical telegraphy. HAM Operators typically use a telegraph key or paddle to manually input Morse code, which is then transmitted via radio waves.
In one of my previous videos I described a device that automatically decodes Morse code characters into letters, whereby we can follow this type of communication without knowing the Morse code. In order to be able to communicate completely in this way, we also need a device that will convert plain text into a Morse code signal, which is compatible with the radio transmitter. Exactly such a device is described in the project that follows.
The text is entered through a standard ps/2 keyboard, and a 5V relay module is placed at the D7 output, through whose contacts the generated morse signal is sent to the transceiver. The relay contacts behave identically to the telegraph key.
There is also a small piezo buzzer for audio presentation. Specifically, in this case, instead of a relay, I put an LED that visually presents the signs. The typed text is displayed on the LCD display.
The device is really simple to make and consists of only a few components:
- Arduino Nano mikrocontroller board
- LCD Dispaly 128x64 dots with ST7565 driver chip
- ps/2 keyboard female connector
- Led (or 5V relay board
- and small Buzzer
And now let's see how the device works in real conditions.
The text that we type on the keyboard appears on the display. At the same time, we can edit or correct it, and then by pressing Enter, a Morse code is generated from that text, which we simultaneously hear on the buzzer. While the signal is being sent, we can enter new text. The transmission speed can be changed from 1-30 words per minute, and that speed can be changed using the PgDn and PgUp keys.
The device is built into the corresponding housing made of PVC material, and covered with self-adhesive colored wallpaper.
And finally a short conclusion. learning to transmit Morse code with a manual key, and decode it, seems to be an anachronism in the age of computers. In this and the previous project, I presented you a very simple and easy way to enter the world of DX communications without learning Morse code, which requires a lot of time, skill and effort.
/* Arduino morse Encoder * *PS2Keyboard library example PS2Keyboard now requries both pins specified for begin() keyboard.begin(data_pin, irq_pin); Valid irq pins: Arduino Uno: 2, 3 Arduino Due: All pins, except 13 (LED) Arduino Mega: 2, 3, 18, 19, 20, 21 Teensy 3.0: All pins, except 13 (LED) Teensy 2.0: 5, 6, 7, 8 Teensy 1.0: 0, 1, 2, 3, 4, 6, 7, 16 Teensy++ 2.0: 0, 1, 2, 3, 18, 19, 36, 37 Teensy++ 1.0: 0, 1, 2, 3, 18, 19, 36, 37 Sanguino: 2, 10, 11 for more information you can read the original wiki in arduino.cc at http://www.arduino.cc/playground/Main/PS2Keyboard or http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html Like the Original library and example this is under LGPL license. Modified by Cuninganreset@gmail.com on 2010-03-22 Modified by Paul Stoffregen <paul@pjrc.com> June 2010 */ #include <PS2Keyboard.h> #include <U8g2lib.h> #include "Lewis.h" #include <TimerOne.h> U8G2_ST7565_ERC12864_1_4W_SW_SPI u8g2 ( U8G2_R0, /* scl=*/ 13 , /* si=*/ 11 , /* cs=*/ 10 , /* rs=*/ 9 , /* rse=*/ 8 ) ; const int DataPin = 3; const int IRQpin = 2; char* znak; char* wiersz[10]; //char workline* char* wiersz1[10]; //top line char* int wiersz_M[10]; //workline in ASCII code int wiersz_M1[10]; //top line in ASCII code byte k; int d, e, i; //helper variables byte isnm = 7; //number of words per minute char isnm_str[2]; byte kursor; const byte index_key = 48; //number of characters in the array const char* KeyChar[index_key] = { "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s", "t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"," ", "!","(",")","+",",","-",".","/","=","?","_"}; const int ASCII[index_key] = { 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115, 116,117,118,119,120,121,122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 32, 33, 40, 41, 43, 44, 45, 46, 47, 61, 63, 95}; PS2Keyboard keyboard; Lewis Morse; void setup() { delay(1000); keyboard.begin(DataPin, IRQpin); Serial.begin(9600); // u8g2.begin (); // u8g2.setContrast(20); //Morse.begin(rx_pin, tx_pin, words_per_minute, use_interrupts) Morse.begin(7,7, isnm, true); u8g2.begin (); u8g2.setContrast(40); //use the TimerOne library for a 100Hz timer interrupt Timer1.initialize(1000); Timer1.attachInterrupt(MorseISR); } void loop() { PS2(); //reading characters from the keyboard if (znak == "enter" ) { Send_Morse();} //sending the line to broadcast Display(); //display the line Display(); //display the line } void PS2() { if (keyboard.available()) { // read the next key char c = keyboard.read(); d = int(c); // check for some of the special keys if (c == PS2_ENTER) { znak ="enter"; // } else if (c == PS2_TAB) { // Serial.print("[Tab]"); // } else if (c == PS2_ESC) { // Serial.print("[ESC]"); } else if (c == PS2_PAGEDOWN) { isnm--; if (isnm < 1 ) {isnm = 1;} Morse.begin(7,7, isnm, true); } else if (c == PS2_PAGEUP) { isnm++; if (isnm > 30) {isnm = 30;} Morse.begin(7,7, isnm, true); // } else if (c == PS2_LEFTARROW) { // Serial.print("[Left]"); // } else if (c == PS2_RIGHTARROW) { // Serial.print("[Right]"); // } else if (c == PS2_UPARROW) { // Serial.print("[Up]"); // } else if (c == PS2_DOWNARROW) { // Serial.print("[Down]"); } else if (c == PS2_DELETE) { znak = "back"; i--; znak = " "; wiersz[i] = znak; wiersz_M[i] = d; } else { // otherwise substitute a regular letter getKeyChar(); //converting char to char* wiersz[i] = znak; wiersz_M[i] = d; if (i > 9) {i = -1;} if (znak == "enter"){i = -1;} if (znak != "back" && znak != "enter") {i++;} //increase character counter } } } void Display() { //display data on the LCD kursor++; if (kursor >20){ kursor = 0;} sprintf(isnm_str,"%d", isnm); //converting a number to a string u8g2.firstPage(); do { u8g2.setFont(u8g2_font_10x20_tr); u8g2.drawStr(0, 15, "Morse"); u8g2.drawStr(75, 15, isnm_str); u8g2.drawStr(98, 15, "w/m"); for (k = 0; k < 10; k++){ u8g2.drawStr(k*10, 40, wiersz1[k] ); u8g2.drawStr(k*10, 60, wiersz[k] ); } if (kursor<15){u8g2.drawStr(i*10, 60, "_" );} //display the cursor if (kursor>5){u8g2.drawStr(i*10, 60, " " );} //cursor blinking } while ( u8g2.nextPage() ); } void Send_Morse(){ znak = " "; for (int k = 0; k < 10; k++) { wiersz1[k] = " "; //cash wiersz1[k] = wiersz[k]; //rewriting characters from the working line to the top wiersz[k] = " "; //delete work line wiersz_M1[k] = 32; //delete ASCII top line wiersz_M1[k] = wiersz_M[k]; //rewrite ASCII from the working line to the top line wiersz_M[k] = 32; //delete ASCII worklineroboczego } for (int k = 1; k < 10; k++){ e = wiersz_M1[k]; Morse.write(e); //morse the contents of the top line } i = 0; } void MorseISR(){ Morse.timerISR(); //function triggered by interrupts (keyboard) } void getKeyChar() { //converting a key code into a letter and an ASCII code for (k = 0; k <= index_key; k++){ if (ASCII[k] == d) { znak = KeyChar[k];} //convert key code to letter } k = 0; }
How to make Arduino Morse Code Generator

Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW
ESP32-S3 4.3inch Capacitive Touch Display Development Board, 800×480, 5-point Touch, 32-bit LX7 Dual-core Processor
BUY NOW
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(1)

-
SERGEJS LUDZISS Sep 13,2024
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Mirko Pavleski
-
DIY ESP32 Bioresonance Rife Machine with ZAPPER function Rife machine therapy is an alternative treatment developed by Dr. Royal Raymond Rife in the 1930s. H...
-
Arduino VFO Project with a Large LCD Display A Variable Frequency Oscillator (VFO) is an electronic oscillator whose output frequency can be adj...
-
Exploring the Tesla Coil Driver Board, Full Review & Test Results Some time ago I presented you a video in which I analyzed a super cheap Tesla Coil driver that cost...
-
Arduino Eatrthquake alarm and protection system with D7S seismic Sensor Earthquakes are extremely common events around the world. On average, there are fifty earthquakes a...
-
Review and Comparison of Three Inexpensive Metal Detector Kits A metal detector is a device used to detect the presence of metal objects in the ground or other ma...
-
How to make simple Arduino RGB Led strip VU Meter VU meter or volume unit meter is a device intended for visual presentation of the audio signal. It ...
-
Arduino 3D Printed self Balancing Cube Self-balancing devices are electronic devices that use sensors and motors to keep themselves balanc...
-
OpenWebRX - Simplest Rasprberry Pi + RTLSDR Web SDR Radio Software-Defined Radio is a radio communication system where components that have traditionally bee...
-
Colorful Arduino Tetris Game - WS2812B LED Matrix Tutorial Tetris is a puzzle video game created in 1985 by Alexey Pajitnov. Players manipulate falling geomet...
-
Ultra cheap Ultrasonic levitation Device - functionality and testing Ultrasonic levitation is phenomenon where objects are suspended in mid-air using the power of sound ...
-
DIY -Spirit PI- ESP32 + Smartphone Sensitive Metal Detector Pulse Induction (PI) metal detector operates on a principle based on sending short pulses of electr...
-
ESP32 Analog style VU meter with GC9A01 Round Dispalys + Peak Meters A typical VU meter measures audio signals and displays them with a visual indicator. In the classic...
-
Arduino two weel self Balancing Robot Self Balancing Robot is device that can balance itself from falling to the ground. Its function is ...
-
ELECROW CrowPanel ESP32 4.2” E-paper Wi-Fi Info-Dispaly Project An e-paper display (also known as an electronic paper display or E Ink display) is a type of screen...
-
ESP32 Fluid simulation on 16x16 Led Matrix Fluid simulation is a way of replicating the movement and behavior of liquids and gases in differen...
-
Simple GU50 VTTC Tesla Coil with MOT (25+cm Spark) Vacuum Tube Tesla Coils are a common choice for homebuilders for several practical reasons. At Soli...
-
Hourglass ESP8266 Code A hourglass, also known as an sand clock, is a device used to measure the passage of time. It consi...
-
Tug of War Arduino Game on WS2812 Led strip A Tug of War is a classic team-based game where two opposing teams compete to pull a rope in opposi...
-
DIY ESP32 Bioresonance Rife Machine with ZAPPER function Rife machine therapy is an alternative treatment developed by Dr. Royal Raymond Rife in the 1930s. H...
-
Arduino VFO Project with a Large LCD Display A Variable Frequency Oscillator (VFO) is an electronic oscillator whose output frequency can be adj...
-
Exploring the Tesla Coil Driver Board, Full Review & Test Results Some time ago I presented you a video in which I analyzed a super cheap Tesla Coil driver that cost...
-
Arduino Eatrthquake alarm and protection system with D7S seismic Sensor Earthquakes are extremely common events around the world. On average, there are fifty earthquakes a...
-
Review and Comparison of Three Inexpensive Metal Detector Kits A metal detector is a device used to detect the presence of metal objects in the ground or other ma...
-
How to make simple Arduino RGB Led strip VU Meter VU meter or volume unit meter is a device intended for visual presentation of the audio signal. It ...
-
Arduino 3D Printed self Balancing Cube Self-balancing devices are electronic devices that use sensors and motors to keep themselves balanc...
-
OpenWebRX - Simplest Rasprberry Pi + RTLSDR Web SDR Radio Software-Defined Radio is a radio communication system where components that have traditionally bee...
-
Colorful Arduino Tetris Game - WS2812B LED Matrix Tutorial Tetris is a puzzle video game created in 1985 by Alexey Pajitnov. Players manipulate falling geomet...
-
Ultra cheap Ultrasonic levitation Device - functionality and testing Ultrasonic levitation is phenomenon where objects are suspended in mid-air using the power of sound ...
-
DIY -Spirit PI- ESP32 + Smartphone Sensitive Metal Detector Pulse Induction (PI) metal detector operates on a principle based on sending short pulses of electr...
-
ESP32 Analog style VU meter with GC9A01 Round Dispalys + Peak Meters A typical VU meter measures audio signals and displays them with a visual indicator. In the classic...
-
-
-
-
Modifying a Hotplate to a Reflow Solder Station
999 1 6 -
MPL3115A2 Barometric Pressure, Altitude, and Temperature Sensor
543 0 1 -
-
Nintendo 64DD Replacement Shell
443 0 2 -
V2 Commodore AMIGA USB-C Power Sink Delivery High Efficiency Supply Triple Output 5V ±12V OLED display ATARI compatible shark 100W
1269 4 2 -
How to measure weight with Load Cell and HX711
760 0 3