{"id":2336,"date":"2020-09-01T11:10:32","date_gmt":"2020-09-01T11:10:32","guid":{"rendered":"https:\/\/wordpress-634681-2064240.cloudwaysapps.com\/?p=2336"},"modified":"2020-09-01T12:51:33","modified_gmt":"2020-09-01T12:51:33","slug":"an-esp8266-based-morse-code-decoding-telegraph","status":"publish","type":"post","link":"https:\/\/www.petecodes.co.uk\/an-esp8266-based-morse-code-decoding-telegraph\/","title":{"rendered":"An ESP8266 based, Morse Code Decoding Telegraph"},"content":{"rendered":"\n

In my recent talk – A Short History of IoT<\/a> – I discussed the various inventions, back in time, that led us to where we are with modern IoT.<\/p>\n\n\n\n

I began with the Electric Telegraph as I believe it to be the first IoT Device. I explained some of the scientific discoveries which led to the invention of the Telegraph in a previous post<\/a>.<\/p>\n\n\n\n

To close out the talk, I finished with a show-stopper demo of a recreated Electronic Telegraph that I’d connected to an ESP8266 which would trigger a tweet to be sent with the decoded Morse Code Message.<\/p>\n\n\n\n

This post details how I connected the ESP8266 to the Telegraph. In the next post I’ll dig in to how I then hooked the whole thing up to Azure and had it tweet out a message.<\/p>\n\n\n\n

The Electric Telegraph<\/h2>\n\n\n\n

As part of the talk I created a Samuel Morse<\/a> style Electric Telegraph;<\/p>\n\n\n\n

Electric Telegraph<\/figcaption><\/figure>\n\n\n\n

This was a relatively straightforward build, in that there were only a few components;<\/p>\n\n\n\n

\"\"<\/figure><\/div>\n\n\n\n

Bringing the Telegraph into the 21st Century<\/h2>\n\n\n\n

As I was giving an IoT Talk, I wanted to bring the telegraph right up date. So, I decided to hook the Telegraph up to an ESP8266 so that I could decode the Morse Code Signals and squirt them out to the Terminal.<\/p>\n\n\n\n

The Circuit<\/h2>\n\n\n\n

I modified my circuit to add the ESP8266;<\/p>\n\n\n\n

\"\"
ESP8266 Connected Telegraph<\/figcaption><\/figure><\/div>\n\n\n\n

Here I’ve connected the positive end of the 3v Battery Pack through the Nail Receiver, onward through a Piezo Sounder and to the ESP8266 on input D0. I’ve pulled the input down to ground through a 220 Ohm resistor, as the circuit will pull the input up to a high value when activated.<\/p>\n\n\n\n

The other side of the circuit is connected out through the GND pin the ESP8266 and back to the Battery pack’s negative terminal.<\/p>\n\n\n\n

Arduino IDE Setup<\/h2>\n\n\n\n

Before you can get started with the ESP8266, you need to add the board to the Arduino IDE.<\/p>\n\n\n\n

Open the Arduino IDE Preferences Dialog by clicking the Preferences Menu Item under File;<\/p>\n\n\n\n

\"\"
Arduino IDE Preferences Menu Item<\/figcaption><\/figure><\/div>\n\n\n\n

Once the Preferences Dialog is open, click on the Additional Board Manager URLs window button;<\/p>\n\n\n\n

\"\"
Arduino IDE Preferences Dialog<\/figcaption><\/figure><\/div>\n\n\n\n

Add the following line to the Additional Board Manager URLs;<\/p>\n\n\n\n

http:\/\/arduino.esp8266.com\/stable\/package_esp8266com_index.json<\/a><\/p>\n\n\n\n

\"\"
Additional Board Manager URLs Dialog Window<\/figcaption><\/figure><\/div>\n\n\n\n

Next up, you can choose the “Generic ESP8266” option from the list of boards;<\/p>\n\n\n\n

\"\"
Select the Generic ESP8266 Module<\/figcaption><\/figure><\/div>\n\n\n\n

Finally, choose the correct COM port for your ESP8266;<\/p>\n\n\n\n

\"\"
Select ESP8266 COM Port<\/figcaption><\/figure><\/div>\n\n\n\n

The Basic Morse Decoding Software<\/h2>\n\n\n\n

I did some searching around and found a nice starting guide over on Instructables by Pinaki_91<\/a>; https:\/\/www.instructables.com\/id\/Morse-Code-Decoder\/<\/a> <\/p>\n\n\n\n

It needed some tidying up… It wasn’t working too well for the ESP8266, as it kept resetting the watchdog. It also didn’t have any decoding for numbers, so I fixed that up and I was good to go;<\/p>\n\n\n\n

\"\"
IoT Telegraph Flowchart<\/figcaption><\/figure>\n\n\n\n