In the era of zoom calls, messenger and Snapchat, communication across the globe has become trivial. But what if it wasn't? What if one had to laboriously type out their message one beep at a time? With this WIFI telegraph project you can!
Step 1: Assemble HardwareNot much is needed for this project; the star of the show is the ESP8266 NodeMCU module. I decided to make it fancy and got a telegraph key and an audio amp for louder beeps, but one can just as well use a standard button and hook the speaker right up to the pins of the microcontroller.
Here's my custom PCB made in KiCAD. It's not to expensive to order them from JLC PCB, but you can also do this on a breadboard.
The telegraph key is soldered to the holes labeled 'switch' on the PCB and the speaker is soldered directly to the audio amp circuit.
Here's what my telegraphs look like; the PCBs are secured to the key via some M2 screws.
Make sure you can upload code to your board
You'll need the WifiManager and the PubSubClient libraries.
The code can be found here: https://github.com/alexchang0229/WifiMorse
You will need to create an Adafruit IO account and setup the MQTT feeds there.
Add your own username, password and MQTT feed to the code and upload to the board.
i.e. change these variables to reflect your MQTT setup:
#define mqtt_server "io.adafruit.com"
#define port 1883
#define MQTT_id "YOUR ID HERE"
#define MQTT_password "YOUR PASSWORD HERE"
#define keyPin 4
#define LedPin 16
#define channelPin 0
char* station_id = "A"; //Chage this so it's unique for each telegraph module
char* ChannelA = "YOUR ID HERE/feeds/A" ;
char* ChannelB = "YOUR ID HERE/feeds/B" ;
char* ChannelC = "YOUR ID HERE/feeds/C" ;
Once the code is uploaded and the board powered up, you should see a network named 'telegraph'. Connect to it and head to 192.168.4.1 to connect the ESP8266 module to your WIFI network.
If all goes well your board should connect to the internet and subscribe to your MQTT feed on Adafruit IO; you should see a connect message on your feed.
Turn off feed history to allow for larger messages
Build as many telegraphs as you want and connect them. Remember to change the station_id variable in the code for each, as they will use this to determine whether or not to play the message.
In the code I've set it up for three different channels, you can switch between them by hitting the 'flash' button next to the USB port on the board. This lets the telegraph to publish/subscribe to three different MQTT feeds.
This was a really fun project and I actually use the telegraph frequently to sent messages to my friends. I hope you give it a try!
If you run into any problems, you can reach me at alex_chang@live.ca
Comments