LED Matrix part 2: NextPCB boards in detail

Nov 13, 2020 17:48 · 1681 words · 8 minute read example pin headers simplest case

In my second video on how an LED matrix works, I would like to go into more detail about the circuit boards that I received from my sponsor NextPCB. For me, this cooperation is the entry into the world of professional circuit board production with new design possibilities. As well as my hand-soldered circuits are suitable to illustrate the functionality, they are just as bad in practical use: During the video recordings, soldering points broke and pins came loose from the GPIO headers on the Arduino UNO board. All of that is history with these professional boards. The first step to my first industrially manufactured circuit board was to create the layout on my computer.

00:51 - The software of my choice is KiCAD, an open source program with good documentation that makes it easy to get started with this topic. I then exported all needed files in Gerber format, sent them to NextPCB and waited for the finished boards to arrive. A PCB layout with only 2 layers is sufficient for the matrix circuits that are quite simple. All copper traces have sharp edges - I used the standard size of 0.25mm given by KiCad for almost all of them. Only the large 8x8 LED matrix board has 0.5mm traces. The places where a trace changes from the front to back can be recognized by the 0.8mm diameter pads with central 0.4mm holes. All boards are designed for through-hole assembly, the necessary holes are 0.9mm in diameter and these are surrounded by 1.8mm, tin-plated copper pads. The boards have solder masks on top of front and back side. This is a plastic film coating that ensures that the solder is kept on the pads, not flowing onto the traces or making unwanted bridges between elements. Furthermore, the plastics provides electrical insulation that allows higher voltage traces to be placed nearer to each other and finally protects the traces from corrosion.

02:20 - Solder masks are a critical for wave soldering that is used in mass production, but they also make manual soldering much easier. In addition to blue or red shown here, other colors are also available for the solder masks when ordering the circuit board. Component labels or other graphics can be printed on top of the solder mask - this is my 18x20 mm large Tux mascot. In order to keep assembly simple, I opted for through-hole assembly of all components for the layout of the boards. For my first version of an 8x8 matrix I use 5mm LEDs, an ATmega328P as central brain, components for an infrared interface, and several small parts.

03:06 - The labeling of all components on the boards reduces the error rate to a minimum with manual assembly. By default, KiCad numbers all components, but it is also possible, for example, to specify the values ​​for the resistors instead, something I haven’t done here. A look at the circuit diagram is therefore necessary in order to position these components correctly. Thanks to the solder mask, the assembly works very quickly - even with my pretty old soldering iron, whose tip was replaced by a thick copper wire at some point in history. The board with the 3mm LEDs, which is designed as a shield for an Arduino UNO, is significantly smaller.

03:49 - As with the large version, an infrared interface is also implemented here. Soldering is not a problem here either - to ensure that all pins fit exactly on the Arduino UNO later, I put them on the pin headers during the soldering process. The third circuit board is a clock in which the LED matrix is ​​not arranged as a square grid: Arranging the components on a circle is no big deal in the age of computer aided design - the wiring of the LEDs is identical to that of a square matrix in order to be able to control the 60 LEDs with only 16 GPIOs. 4 more LEDs are located inside the circle, next to 3 buttons for setting the time. The outer shape of the boards can also be designed with KiCad: While my first version forms a simple rectangle with the dimensions 108x81mm,… …

the corners of the 73x55mm Arduino Shield are capped to avoid sharp edges. And finally the board of the LED clock is a disc with a diameter of 131mm. The edges on all three boards are smooth, the dimensions are correct - there is nothing to complain about here either. Let’s take a closer look at the fully assembled boards: From the first version I made a total of 6 pieces - one each with yellow,… …red,… … green,… … blue… … and white LEDs,… … as well as one version with 4 colors on one board. The ATmega328P used to control the LEDs, that is like an Arduino UNO without an Arduino board, is plugged into a socket so that it can be removed for programming.

05:47 - There is a built in infrared interface, composed of a TSOP4838 receiver module and an infrared LED. A second interface is meant to be plugged into pin headers on the board - the receiver part is a microphone module that is available for the Arduino. It is essential to ensure that this module is not plugged in the wrong way round - there is no reverse polarity protection. Through jumpers you can chose if the analog or digital output of the microphone module is to be used. A buzzer that can be plugged into a second pin header row, serves as an acoustic sender - note the polarity of that component as well.

06:31 - The boards can also be wired directly to one another via those sockets in order to exchange data. For safety reasons, a 1 kiloohm resistor should be soldered to the data cables. The power is supplied via a reverse polarity protected plug system - 5V DC voltage is required, with which a power bank or the USB socket of a laptop, for example, can be used. The board draws a current of approximately 13mA in idle mode,… …which increases to 32mA if all 64 LEDs are activated through multiplexing,… …

and to 36mA if all LEDs are switched on at the same time without multiplexing. The idea is to shoot a video on data transmission with these boards, for which I still have to write a few lines of code. For now, the LED screens respond to simple acoustic signals: With the help of knocking on the table, letters can be displayed - in the simplest case, the number of received sound signals equals the position of the letter in the alphabet. If you use an infrared remote control, the boards can be addressed via number combinations and so messages can be transmitted. A 3-digit code is used here, in which the first digit represents the number of the addressed board,… …

while the last two digits transmit the character to be displayed. Here I have transmitted the character “E” to board number 1, on which an “X” was previously displayed. The other two boards fall back to their old character after the transmission is complete. The shield for the Arduino UNO has the same functionality. The big advantage of this version is that the ATmega microcontroller does not have to be removed to reprogram the matrix. The power supply comes directly from the Arduino UNO board. Thanks to the USB interface on the Arduino board, graphics or messages can be received directly from a PC. As soon as the text line is terminated by the “Enter” key, the serial interface gets disabled and the text appears on the matrix. The boards can also communicate with each other via the infrared interface - with that, a text can be transmitted from the PC to the Arduino shield and from there to the large circuit boards. An LED matrix is ​​great for learning basics in coding such as loops, arrays, the bit wise manipulation of data or time-controlled processes.

09:17 - The peripherals are inexpensive to set up, so you don’t get a chance to destroy expensive hardware whenever an Oups! happens, which is quite common when writing software. The LED clock has no interface - the time is set using 3 buttons on the front. If you have decided on through-hole assembly for the layout, as I did, the components can in principle be placed on the front,… … as well as being on the back of the boards - the pads have a conductive link through center the hole. While you can solder simple components such as resistors on one side or the other,… …

for example the polarity of diodes has to be taken into account when soldering on the side other than indicated by the labels. The socket of the ATmega microcontroller must be soldered on the intended side, otherwise the assignment of the pins will become wrong - with the clock this is the back of the circuit board. The time is displayed similarly to an analog clock: The LED for the current hour lights up continuously, the one for the minute flashes asymmetrically every second and the LED displaying the seconds can be identified without further explanation. The LED circle is divided into four colors and the buzzer plays the melody of a well-known tower clock in London every quarter of an hour. These are the projects that resulted from my first contact with NextPCB, more ideas grow in my brain almost every day - stay tuned to see future projects.

11:09 - The KiCad layouts of the circuit boards shown here, as well as the software used, can be downloaded from my website. There, as well as in the description box below this video you will find links to NextPCB, where you can order these boards or start your own projects. During special promotions, for example, new customers can get free or at least specially priced boards - have a click to learn more! Thanks for watching and: “I’ll be back!” .