arduino morse code Fox hunt beacon
DISCLAIMER:
Please note that broadcasting data on the CW (morse code) network requires a valid amateur radio license. In the United States, this typically entails obtaining at least a Technician Class license from the Federal Communications Commission (FCC).
Legal Requirements:
Amateur radio operators are subject to regulations set forth by their respective national regulatory authorities. These regulations govern the allocation and usage of radio frequencies, as well as the permissible modes of communication.
License Requirement:
To legally transmit on the CW network, you must hold an appropriate amateur radio license. In the United States, the Technician Class license is the entry-level license that grants privileges to operate on certain frequencies and modes, including those used for CW (Morse code) communication.
Compliance with Regulations:
It is essential to comply with all applicable regulations and licensing requirements when operating amateur radio equipment. Failure to do so may result in legal consequences, including fines and penalties.
Responsibility of Operators:
As licensed amateur radio operators, we have a responsibility to operate our equipment in a manner that promotes safety, professionalism, and respect for the radio spectrum. This includes adhering to established operating procedures and respecting the privacy and rights of other users.
Get Licensed:
If you're interested in becoming an amateur radio operator and gaining access to the exciting world of CW and other radio communication technologies, we encourage you to pursue obtaining your amateur radio license. Resources and study materials are available to help you prepare for the licensing exam and embark on your journey into amateur radio.
Disclaimer Acknowledgment:
By accessing or using the information provided on this website related to CW and amateur radio, you acknowledge and agree to abide by all applicable regulations and licensing requirements governing the operation of amateur radio equipment.
This Arduino sketch is designed to control a Baofeng UV-5R handheld transceiver for a fox hunt, where participants search for a hidden transmitter by following its signal. The program sends a Morse code representation of the user's call sign followed by a message and a long tone, making it easier for participants to locate the transmitter.
How the Program Works:
PTT Control: The transmitter's Push-to-Talk (PTT) is controlled by a 2N2222 transistor. The Arduino pin PTT_PIN is set to HIGH to activate the transmitter.
Morse Code Transmission: The program uses a buzzer to generate Morse code for the call sign and an optional message. The sendMorse() function handles converting the string into Morse code, and sendMorseCharacter() breaks down each character into dots (dits) and dashes (dahs).
Fox Hunt Beacon: After sending the Morse code, a long tone is generated by the buzzer for 5 seconds, which serves as a beacon in the fox hunt.
Delay: After the sequence, the program waits for 1 minute before repeating the process.
Customization:
Call Sign and Message: You can easily change the callSign and foxHuntMessage variables to update the transmitted content.
Timing: Adjust the DIT_DURATION and delay values to change the speed of the Morse code and the duration of the tones.
Circuit Requirements:
PTT Control: A 2N2222 transistor is required to control the PTT of the Baofeng UV-5R.
Protection Diode: A diode is recommended across the transistor to protect against voltage spikes.
Buzzer: A buzzer is connected to the Arduino for generating the Morse code and tones.
The Circuit
Demonstration
Parts List
Schematic
The Arduino code
#define PTT_PIN 2#define BUZZER_PIN 3#define TONE_FREQUENCY 1000 // Frequency in Hz for the Morse code#define LONG_TONE_FREQUENCY 500 // Frequency in Hz for the fox hunt tone#define DIT_DURATION 100 // Duration of a dot in milliseconds
String callSign = "kb3won"; // Your call signString foxHuntMessage = " fox hunt beacon"; // Fox hunt message
void setup() { pinMode(PTT_PIN, OUTPUT); pinMode(BUZZER_PIN, OUTPUT);}
void loop() { // Key up the transmitter digitalWrite(PTT_PIN, HIGH);
// Send Morse code for the call sign and fox hunt message sendMorse(callSign); sendMorse(foxHuntMessage);
// Send a long tone for fox hunting tone(BUZZER_PIN, LONG_TONE_FREQUENCY); delay(5000); // Adjust the duration as needed noTone(BUZZER_PIN);
// Unkey the transmitter digitalWrite(PTT_PIN, LOW);
// Wait before repeating the sequence delay(60000); // Wait for 1 minute before repeating the sequence}
void sendMorse(String text) { for (int i = 0; i < text.length(); i++) { sendMorseCharacter(text[i]); }}
void sendMorseCharacter(char c) { switch (c) { case 'a': sendDit(); sendDah(); break; case 'b': sendDah(); sendDit(); sendDit(); sendDit(); break; case 'c': sendDah(); sendDit(); sendDah(); sendDit(); break; case 'd': sendDah(); sendDit(); sendDit(); break; case 'e': sendDit(); break; case 'f': sendDit(); sendDit(); sendDah(); sendDit(); break; case 'g': sendDah(); sendDah(); sendDit(); break; case 'h': sendDit(); sendDit(); sendDit(); sendDit(); break; case 'i': sendDit(); sendDit(); break; case 'j': sendDit(); sendDah(); sendDah(); sendDah(); break; case 'k': sendDah(); sendDit(); sendDah(); break; case 'l': sendDit(); sendDah(); sendDit(); sendDit(); break; case 'm': sendDah(); sendDah(); break; case 'n': sendDah(); sendDit(); break; case 'o': sendDah(); sendDah(); sendDah(); break; case 'p': sendDit(); sendDah(); sendDah(); sendDit(); break; case 'q': sendDah(); sendDah(); sendDit(); sendDah(); break; case 'r': sendDit(); sendDah(); sendDit(); break; case 's': sendDit(); sendDit(); sendDit(); break; case 't': sendDah(); break; case 'u': sendDit(); sendDit(); sendDah(); break; case 'v': sendDit(); sendDit(); sendDit(); sendDah(); break; case 'w': sendDit(); sendDah(); sendDah(); break; case 'x': sendDah(); sendDit(); sendDit(); sendDah(); break; case 'y': sendDah(); sendDit(); sendDah(); sendDah(); break; case 'z': sendDah(); sendDah(); sendDit(); sendDit(); break; case '1': sendDit(); sendDah(); sendDah(); sendDah(); sendDah(); break; case '2': sendDit(); sendDit(); sendDah(); sendDah(); sendDah(); break; case '3': sendDit(); sendDit(); sendDit(); sendDah(); sendDah(); break; case '4': sendDit(); sendDit(); sendDit(); sendDit(); sendDah(); break; case '5': sendDit(); sendDit(); sendDit(); sendDit(); sendDit(); break; case '6': sendDah(); sendDit(); sendDit(); sendDit(); sendDit(); break; case '7': sendDah(); sendDah(); sendDit(); sendDit(); sendDit(); break; case '8': sendDah(); sendDah(); sendDah(); sendDit(); sendDit(); break; case '9': sendDah(); sendDah(); sendDah(); sendDah(); sendDit(); break; case '0': sendDah(); sendDah(); sendDah(); sendDah(); sendDah(); break; case ' ': delay(7 * DIT_DURATION); break; // Word space } delay(3 * DIT_DURATION); // Character space}
void sendDit() { tone(BUZZER_PIN, TONE_FREQUENCY, DIT_DURATION); delay(DIT_DURATION); noTone(BUZZER_PIN); delay(DIT_DURATION); // Inter-element space}
void sendDah() { tone(BUZZER_PIN, TONE_FREQUENCY, 3 * DIT_DURATION); delay(3 * DIT_DURATION); noTone(BUZZER_PIN); delay(DIT_DURATION); // Inter-element space}
Contact Us
For inquiries or more information about the project, please feel free to contact Douglas Fessler at fessler.douglas@gmail.com or through the contact page on this website.
Donate
If you've enjoyed exploring my projects and want to see more amazing creations, your support can make a big difference! By contributing, you're helping me continue to innovate and bring even more exciting projects to life. Together, we can explore the endless possibilities of DIY electronics! Don't forget to like, subscribe, and follow for updates on the latest developments. Thank you for being a part of this journey!
Click here to make a difference with your donation today!