Author Options:

Arduino Morse Code decoder? Answered

I want to make an arduino morse code decoder, which will print the result on a 16x2 LCD. The input will be 3 button, 2 will be the "_" and "." respectively, the 3rd one will be the "space" button, when press will decode the code which was input. If input was wrong then it will display a "?" mark. And it should be able to decode many character at once. Anyone have some idea or code about this? I'm just getting started with microcontroller for about 1 months so I have a bit of knowledge about how they should work, but this prove to be quite challenging for me


Hmm. the problem, as I see it, will be in determining what the length of a "dash" "dot", and pause is, since my automatic thoughts are that one would use a time-based discriminator to determine the three constituent elements used for interpreting Morse code..

You might be able to train such a circuit, ie, write a subprogram that trains the controller to recognize a particular person's style.

Beyond that, it's all look up tables afaik, so if you're not familiar, I'd consider googling the concept of lookup tables.

hm... actually I don't need to train it, since the code is on paper, and the "dot" and "dash" was input from there. The length of the letter is a problem though, that's why I think of a third button to "cut" the code.

Example: input a letter, press "end", input the next letter, press "end" again, all in real time, that's the hard part

or even better, do as I said and google "lookup table"

You could train it with typing SOS on the pad to set the expected dah/dot period ?

True, however, the issue I'd have with using saomethng as simple as SOS is that it's just too easy and would result in a fallacious calibration of a user's typing rate.

There are/were various RS232 devices that auto-bauded with a single character, the '?' was common - '3F', or 00111111, that was pretty reliable with a single character.

"There are/were various RS232 devices that auto-bauded with a single character, the '?' was common - '3F', or 00111111, that was pretty reliable with a single character.":

Yes, but what you're outlining is an automated system oin which two mahine speak to each other.I am trying to encompass the more general case where an operator could actually be human, with a key rate unique to him or her, (ie variance between real live humans) rather than a digital device the puts out a known wave train. SOS is deceptive because it's so simple it can be keyed very quickly without any real thought.It's a poor choice for operator calibration. But if the OP is really jsut talking about a system in which to mahcines are conversing, you're absolutely right.

I was thinking that training with SOS might be enough variance to get a reasonably low-noise result, but I agree, its the one code "everyone" knows.

...what's morse for '?' ;-)

No doubt, it could be used to ensure a workable S/N if the transmission path was noisy. My point is more that SOS can be done very quickly, in contrary to more complex characters or words. ... _ _ _ ... is just too easy to fire off at a rapid rate that would not reflect a person's real keyrate when sending messages that contain non-emergency code. (like this one)

And bingo, yes, that second post of yours about an onscreen message and the operators keying it in is the sort of thing I was thinking of.

Hmm. Show a message on the screen, and get the operator to type it. The MCU can judge a full suite of letters that way.