ESP32 Morse Tutor Update and Pinout

On http://w8bh.net‘s site there are instructions to build your own morse tutor. There are step by step instructions using a popular STM32 microcontroller. He also has included an updated build guide using an ESP32 otherwise known as a NodeMCU. Unfortunately, he doesn’t show how to breadboard this project.

My biggest problem was that I didn’t know how to connect the rest of the wires to the display. I read that the LED pin was supposed to be the backlight so connect it to +. But there were 3 or 4 empty holes that were the key to making it all work right.

When I booted it up (with the display not completely connected), the buzzer played R and if I randomly did stuff with the encoder and cw paddle it would obviously go into one of the practice modes – I just couldn’t see on the screen what I was doing!

I recently figured it out, and here are the pin connections how I built it:

ESP32 GPIO # (see above diagram)Connected to…
GNDGround (-) Rail on breadboard
23 aka VPSMOSISDI(MOSI) pin on display
22CS pin on display (CS=chip select?)
21DC pin on display
18 aka VSPI SCKSCK pin on Display
17RESET pin on Display
16CLK pin on Encoder
4DT pin on Encoder
15SW pin on Encoder
VIN3.3vPositive (+) rail on breadboard
32Dit on CW key
33Dah on CW key
13Positive (really either) pin on Buzzer
Other Connections
Buzzer negative pinnegative rail on breadboard
Encoder + pinpositive rail on breadboard
Encoder – pinnegative rail on breadboard
CW paddle commonnegative rail on breadboard
Display VCC pinpositive rail on breadboard
Display LED pinpositive rail on breadboard (or hole right behind VCC pin)
Display GND pinnegative rail on breadboard

Thats it! Now you have to modify the code so that the software and pins are in sync with each other.

Again, note I didn’t setup the SD card, because I didn’t care about that functionality.

Also note that if you connect a 2nd set of wires into your CW key, you should unplug it from your radio while using the morse tutor. And when you’re using your CW paddle for real, then unplug the wires from the breadboard. This was only 1 thing – the morse tutor or your ham radio will have voltage running through/grounding as you key your paddle.

The original sketch for the ESP32 is here:

https://github.com/bhall66/morse-tutor/blob/master/MorseTutor_ESP32/MorseTutor_ESP32.ino

When you look at the code, you’ll notice that there are only 2 constants set for the display – the DC pin and the CS pin.

Well, on the circuit board traces there are other connections. Looking at the photos located in this folder, I wasn’t able to trace them myself to see where they went. This was the hardest part

https://github.com/bhall66/morse-tutor/blob/master/MorseTutor_ESP32/PCB/rev%202B/MorseTutorESP32_rev2B_front.JPG

So what you need to do, since you’re not using this PC board, is to now figure out (which I’ve done above) how to wire them, but also how to tell the code where those pins are attached.

Here are my changes. Basically I had to tell the software where the RST, SCK, and MOSI pins were attached to the ESP32.

I also had to modify how we initialize the display to also add where we had the displays reset pin connected.

#define TFT_DC             21                     // Display "DC" pin
#define TFT_CS             22                     // Display "CS" pin
#define TFT_RST            17
#define TFT_SCK            18
#define TFT_MOSI           23
#define SD_CS              5                     // SD card "CS" pin

... further down ...

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

All this stuff might be obvious to you if you know how to use this type of display, but it wasn’t to me. I don’t know the significance of these connections. I’ve only used an I2C display before which is just 2 wires outside of power/ground.

73,

KV0N

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.