RC2024 – Part 5 – Building And Testing The PCB

Rotary Encoder Module for RC2014

My prototype PCBs from JLCPCB has arrived!

Rotary Encoder for RC2014

The parts I needed to solder onto the board have also arrived from AliExpress and CPC Farnell.

I found one very annoying mistake try to solder up the board. I had forgotten to add a sensible spoke width to my copper ground plane. This means the ground plane is soaking up the heat from my soldering iron anytime I try to solder any pin connected to ground. I was able to solder up the board, but those pins took between 10 and 20 seconds to solder. I’m not confident the connection will last.

In the next iteration of the board I will set the spoke width in the EasyEDA CopperArea properties to 0.3mm. This should still give a good ground connection, but also be easy to solder.

I’m not happy with the position of some of the text on the board. Once wired up, pins obscure the Port 1 and Port 2 text. The debug port is also obscured. I will move these so they are visible when connected.

The debug port is a bit too high so the pins are clear of the top of the board. I will move them down.

I also realised that Spencer calls all his PCBs “modules”, so I will call mine “Rotary Encoder Module”.

Rotary Encoder for RC2014

It was with great excitement I plugged the module into my RC2014 and turned it on. The LEDs for Port 1 were all off, but the LEDs for Port 2 were all on. That didn’t seem right, but then I realised I had only plugged a rotary encoder into Port 1. As Port 2 is returning logic 0, the 74HCT14 was inverting this to logic 1 so the LEDs lit. So it was working as expected. Adding another rotary encoder to Port 2 fixed that.

The address was set to 0 on the address switches. This meant I could use the same BASIC program I used before to test the rotary encoders.

Turning the encoders the LEDs were flashing in the expected order. The BASIC program was returning “Left” and “Right” depending how I turned the encoder. It was working!

I decided to test the address switches and so set it them to 01111011, which is hex DE, and decimal 222.

I modified the BASIC program to read address DE instead of 0.

30 LET IN = INP(&HDE)

Running the BASIC program, the module now responds to address DE as expected.

One final test was to plug in my RC2014 Digital IO module. This is set to address 3. I modified the BASIC program so the OUT statement used address 3.

40 OUT 3,2^COUNTER

I can now use my rotary encoder module to successfully move the LEDs on the Digital I/O module.

Despite the issues with soldering to the ground plane, my module works as I hoped. I am going to tweak the layout and order replacement PCBs from JLCPCB.