Posts Tagged ‘Arduino’

Morse in a New Year

25 January 2018

One of the things I’ve done in the past few weeks is build a new keyboard for this computer. It’s what’s called a straight key in radio circles.

Telegraph key being used as a USB keyboard on my computer.

Yep, it’s real. And it works. I actually used it to type (key?) in some of this blog post. It’s literally just an USB cable, a Teensy 3.1, and a Morse code key. I’m going to mount the Teensy in the bottom of the board, but for now it’s on the protoboard until I get all my code changes done.

So, why? What the heck would I do that for when I have a perfectly good computer keyboard?

At the start of 2018 I was once again thinking I wanted to find a way to really make myself learn Morse Code. A way that would guarantee I would learn it.

Among other times, I want to use my mobile radio when I’m out and about but don’t have the computer with me. Normally, I use PSK-31 which is computer-to-computer via amateur radio. For that, obviously, I have to have a laptop with me. The thing is, I don’t always have one with me and sometimes I will be out in the Owyhees at a spot where I’d like to see if I can have a QSO (conversation) on the radio. No laptop, no QSO.

The obvious question is, why don’t I just sit down and learn it?

Well, I could, but I’m lazy and I know it. Also, I already know about half the alphabet and numbers and a punctuation mark or two. So, what’s the problem? It’s no fun for me just sitting and memorizing the International Morse Code. I can, but that’s boring.

I began to wonder if I could somehow replace my QWERTY keyboard with a straight key. I took the path of least resistance and started searching online to see if anyone had done something like this with an Arduino or Teensy. It turns out several people had and made their code and schematics freely available.

After studying a few of them, I zeroed in on Nomblr’s rebuild of her dad’s old telegraph key. Her code was clean and the schematic about as simple as it ever gets so I leveraged off her work. The good thing was I happened to have a Teensy 3.1 in my “hell box” (as in “where the hell is it?”).

I dug out the Teensy 3.1, connected the straight key to the Teensy, plugged the USB cable into the Teensy and the computer. For testing, I simply downloaded Nomblr’s code to the Teensy, opened up Notepad++, and tried the key. I used the programmer’s holy first test: …. . .-.. .-.. — .– — .-. .-.. -..

To my immense pleasure, the letters started showing up in Notepad++ right away: hello world.

OK, so I had to look up two of those letters. That’s the whole point. I can now use the telegraph key to write on the computer, and to do so, I have to learn the Morse code letters I don’t know. Sure, it’ll be slow for a bit here and there but over the next few days or weeks I’ll be up to speed. And I’ll have learned the International Morse Code much faster than otherwise. Much.

I have already made some tweaks to her code and am in the process of adding some extra bells and whistles that I think will be useful to me. For example, I’ve added in a couple of prosigns like CQ and SOS. Keying in SOS, for example, corresponds to pressing F1 on a QWERTY keyboard. I’ve added in the punctuation from the International Morse Code table, and I’ve set up “……..” which is Morse for “error” to mimic pressing the backspace key on a regular keyboard.

Now I’ve got a fun and productive way to learn Morse code. One that not only ensures I’ll learn it, but also lets me practice sending and have fun doing so.

Soon, I’ll be on the airwaves with CW.

Future tweaks to this setup include adding a way to adjust the words-per-minute of the program. Currently it’s hard-coded and to change it to work smoothly with a faster or slower WPM I have to modify the code and dump it to the Teensy. Not difficult, but also not ideal, especially as my speed improves.

I do want to increase my speed, but one caveat is that I need to ensure that I don’t send faster than I can receive. For that reason, among others, another mod is to add a display to show what my actual WPM is as I use the key.

As to why a straight key instead of an iambic paddle…I’m of German descent, which gives me a Stubborn bonus of +4. 😉

Advertisements

A Long Week

23 January 2013

Last week was a long week. As I’ve mentioned before, I’m completely deaf. I hear nothing. At all. What that means is that when I have a meeting at work, I tend to utilize sign language interpreters to be able to fully follow, as best I can, the meetings I’m attending. Last week, I was in all day meetings for three consecutive days. I found out that I’m not as young as I used to be, that’s for sure. At the end of those three days, I was completely exhausted, mentally, and my eyes were trying to see each other. Heck, they were trying to see if my brain was still in my skull behind them. OK, maybe not literally that bad, but still tiring enough that I didn’t want to touch the computer after work all week. That led to an end result of no writing last week, either on my WIP or blog.

This weekend just past, though, I managed to get some writing in and develop some initial notes for a musical composition I want to do. Not notes as in musical notes on a staff, but rather writing up what I want to put in this composition, where my theme is from, and how I want to go about it. There are times when I wonder what I must have done wrong in my previous life to be punished by being deaf and loving music as much as I do.

Over the last two days I’ve managed to tentatively complete the current Pa’adhe short story. Now I need to do my own re-read and editing after which I should be able to send it out to my Alpha readers. That’ll let me know if it’s actually finished and I am ready to start the heavy editing that always happens before I release to my blog. This will be the eighth posted story when it goes live.

Unfortunately, though, that musical composition I mentioned a couple paragraphs ago has been pulling at me to focus on it. I’m excited about the premise and want to get the program going. It’s a juggling act right now to balance my time between this new musical composition program, my writing, prepping for the photography class I start teaching next Wednesday, and finishing the Arduino projects that I have to deal with. Fortunately, the current Arduino projects are almost all done.

I managed to finalize my granddaughter’s Light Harp. A few tweaks with components and checking things on the o‘scope and I was able to adjust the schematic to allow the two photoresistors to properly adjust pitch and volume. I also got some ideas for improving it. Heh! Heh! Now to box it up and deliver her Arduino-based Theremin wannabe. Both she and my wife played with it while it was still in the protoboarding stage and had fun with it, so it clearly works. My daughter confirmed that it sounds a lot like bagpipes.

I have all the necessary parts now, so as soon as I finish the patch cord, I’ll be completing my nephew’s Arduino based light show for his band. Pretty much all that remains is the sketch. That’s going to be fun as I’ll be able to play with it a little bit before handing it off to him. I’m looking forward to watching the audio drive the light string and tweaking the sketch to control the individual lights. I’m really curious about this, because as I’ve mentioned before I’m completely deaf, yet love music. I’m always seeking a way to see, visually, the music hearing people get to enjoy so it’ll be interesting to see just how this reacts to audio input. With RGB LED lights, the full range of colors is available to utilize. There are, of course, various limitations such as what colors I can actually discern a difference between, how it’s processed down the string of Christmas lights, which color is highest, which color is lowest, and so on. Personally, I see white as the highest possible musical note and black as the lowest.

First Post-Apocalypse Entry

9 January 2013

Well, the Christmas break is over and it’s time to get caught up.

The apocalypse came and went, and frankly it was rather boring. If we ever have an apocalypse for reals, I hope it’s more interesting than 12/21/2012 was.

Of course, the only reason it was so boring is that it was really a non-event from the beginning. Somewhat funny to me is that I posted my made-up tongue-in-cheek timeline in an earlier blog entry and danged if one of those items didn’t actually come true! They actually posted somewhere about finding a new glyph. Dang, I’m good!

Well, over the break I did get in some writing. It took the WIP to a point where the end is in sight for our heroes. After getting that far, a few days later something that had apparently been percolating in my subconscious floated to the top. One action scene that I had written ended kind of lamely, I thought. Not lame as in it could be worded better but lame as in it started to seem to me it had a cop-out ending for that bit of action. So, I did a quick and dirty re-write with a completely different action sequence that is nothing like the original to replace it. I still have to flesh it out, but that’s more adding details and furthering the action than having to come up with a new action sequence. We’ll see which of these actually remains in the story.

I also finished a Theremin-like device for my granddaughter. This, too, I’ve mentioned in another post. I did a complete re-design to the amplifier stage to utilize the LM386N chip I had instead of the TDA7052 chip in the original Light Harp project from the book, 30 Arduino Projects for the Evil Genius. This time when we powered it up, my granddaughter got a big grin on her face. Eventually we called my wife in and she, too, had a lot of fun playing with it. Now I just have to solder it up and install it into a box. The box will have a LED to show the device is on, and a USB cable out of the box for power, utilizing one of the many phone charger wall warts with a USB slot. That will also allow for easily making changes to the Arduino sketch later if desired. The two photoresistors that control the volume (slightly) and the pitch (pretty well, apparently) will be mounted flush on the top of the box too, of course. I’ll be using an over-sized plastic BUD box to separate the photoresistors as much as possible than for any other reason. That should give better individual control by each hand. For giggles, here’s a picture of the proto-device before soldering it to the piece of PCB. I’ll include a picture of the completed box later if I remember.

Shows a workbench with an arduino, proto-board, jumper wires, and so forth.

The Theremin/Light Harp prototype.

The black L-shape in the picture is the speaker. It’s a plastic housing plus speaker salvaged from a laptop that broke and was scavenged for parts. It has the advantage of allowing an easy way to mount the speaker to the box with two screws.

The string of Christmas lights, the other Arduino (left edge) and the Spectrum Shield (red board) in the background are for a light show project for my nephew’s band. We managed to round up one of the famous GE G-35 LED Christmas Lights. In researching this, I came across some neat ideas for Arduino controlled LED displays for my son’s home-made bar in his house. Both of these will be controlled by music input via a mic with the ability to run some random or specific patterns instead if desired.

Hey, I’ve already got two more Arduino projects in the wings along with my writing, amateur radio, and photography.

And it’s not even the middle of the first month of 2013 yet.