ADVERTISEMENT
A simple 433mhz rf module and arduino pro mini as a morse code beacon |
A simple rf module (with three pins, VCC.GND and ATAD(DATA) is used. It generate an rf signal at 433.9mhz when the ATAD pin is high (so the same pin is connected to pin 13 of the arduino board). A simple firmware will control the pin 13 and hence can send a stored message at frequent intervals.
Wiring is very simple. Connect gnd pin to ground or negative, vcc to 5volt (or higher up to 12v, for better range), and the atad pin to pin 13 of the arduino.
Wiring is very simple. Connect gnd pin to ground or negative, vcc to 5volt (or higher up to 12v, for better range), and the atad pin to pin 13 of the arduino.
This can be made even simple with an attiny85. Adding a solar charger is another option. If more power is needed, an extra amplifier (uhf ) with a low pass filter can be added. For the antenna i used a piece of wire (17.3cm) but alternatives like a slim jim can be used for better range.
Here is the source code (change the text string to match your need). This will send a morse code message of the text stored.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 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 | // A simple uhf beacon using 433 mhz rf module // credits to the author of the morse code generator // more details on http://blog.riyas.org struct t_mtab { char c, pat; } ; struct t_mtab morsetab[] = { {'+', 42}, {'-', 97}, {'=', 49}, {'.', 106}, {',', 115}, {'?', 76}, {'/', 41}, {'A', 6}, {'B', 17}, {'C', 21}, {'D', 9}, {'E', 2}, {'F', 20}, {'G', 11}, {'H', 16}, {'I', 4}, {'J', 30}, {'K', 13}, {'L', 18}, {'M', 7}, {'N', 5}, {'O', 15}, {'P', 22}, {'Q', 27}, {'R', 10}, {'S', 8}, {'T', 3}, {'U', 12}, {'V', 24}, {'W', 14}, {'X', 25}, {'Y', 29}, {'Z', 19}, {'1', 62}, {'2', 60}, {'3', 56}, {'4', 48}, {'5', 32}, {'6', 33}, {'7', 35}, {'8', 39}, {'9', 47}, {'0', 63} } ; #define N_MORSE (sizeof(morsetab)/sizeof(morsetab[0])) #define SPEED (13) #define txpin (13) #define DOTLEN (1200/SPEED) #define DASHLEN (3*(1200/SPEED)) void dash() { digitalWrite(txpin, HIGH); delay(DASHLEN); digitalWrite(txpin, LOW); delay(DOTLEN); } void dit() { digitalWrite(txpin, HIGH); delay(DOTLEN); digitalWrite(txpin, LOW); delay(DOTLEN); } void send(char c) { int i ; if (c == ' ') { delay(7*DOTLEN) ; return ; } for (i=0; i<N_MORSE; i++) { if (morsetab[i].c == c) { unsigned char p = morsetab[i].pat ; while (p != 1) { if (p & 1) dash() ; else dit() ; p = p / 2 ; } delay(2*DOTLEN) ; } Serial.print("?") ; } } void sendmsg(char *str) { while (*str) send(*str++) ; } void setup() { pinMode(txpin, OUTPUT); } // the loop void loop() { sendmsg("VVV VVV VVV TESTING TESTING ") ; delay(1500) ; //delay can be increased to save battery } |
hi, can get the result of these project?
ReplyDeletehi,can i get the result of these project?
ReplyDeleteHello, I get this error when I compile in Arduino:
ReplyDeleteC:\Users\USER\Documents\Arduino\UHF_Beacon_433mhz\UHF_Beacon_433mhz.ino: In function 'void loop()':
C:\Users\USER\Documents\Arduino\UHF_Beacon_433mhz\UHF_Beacon_433mhz.ino:123:40: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
sendmsg("VVV VVV VVV TESTING TESTING ") ;
^
Please con you solve this problem, thanks
I got the same issue when compiling as Victor... any ideas please??
ReplyDeleteIs it possible with an attiny13 to ? (Changes in sourcecode?)
ReplyDeleteThe "ATAD" pin is actually the "DATA" pin but, china's QC being what it is, well............
ReplyDeleteany idea how to fix this so it compiles in arduino ver 1-8-2
ReplyDeletepinMode(txpin, OUTPUT);
^
exit status 1
two or more data types in declaration of 'setup'
Sample Morse Code
ReplyDeletehttps://gist.github.com/baojie/4460468
I got this to work, but not sure what I am supposed to hear on my radio end. I get the transmission, but its not a distinguishable dot-dash where it can be decoded. It is just keying up the radio. Any one else successful?
ReplyDeleteSet the radio in cw on lsb/ssb mode to get a tone. A cheap alternativ to a commercial rx with sideband/cw support is to use an rtl sdr. Best regards
Delete