Hello my dears
I would like to present here my attempts to make a self-contained 7-segment display based on WS2812B colour LEDs, my own PCB and a case printed on a 3D printer.
The display shown here I will test with an Arduino and give full operating codes for download.
Heart of the display - WS2812B LEDs
The display is based on WS2812B 'smart' coloured LEDs, a large number of which can be controlled by a single pin. These diodes only require a power supply (5V and ground) and one signal, they are connected like this:
(in the case of long wires, it is still worth giving a resistor on the data line before connecting to the microcontroller)
Of course, controlling them requires a suitable protocol.
I wrote more about them in the topic PIC18F45K50 as WS2812 LED strip driver , here:
https://www.elektroda.pl/rtvforum/topic3590731.html
Board design
I started the design of my own display by planning the board. For this I used the free version of Eagle software.
The tile represents a single digit. The digits can be connected together and have more digits (controlled by a single pin anyway) by using the WS2812B.
I have tried to make the whole thing no larger than 5cm by 5cm, as most PCB shops will accept panels up to 10cm by 10cm at a cheaper price, which will allow me to order more of my tiles (4 tiles per panel) more cheaply in the future.
There is a small error on the board - the distance from the goldpin connectors on the right and left side to the edge of the board is a bit too large, making it impossible to connect the two boards together with jumpers alone. This is necessarily to be corrected in the future.
I exported the boards to Gerbers and had the board shop make them (as a start without a panel - this is the first version).
Soldering the board
Even before soldering the board itself, it is worth stressing one very important thing. The WS2812B diodes should, of course, be soldered in the correct orientation - you can't flip the diode and confuse the pins. You need to pay attention to the markings. On my board (made in Eagle), the first pin is marked with a dot:
The WS2812B itself, on the other hand, has a truncated corner in place.... third pin:
That is, the dot is supposed to be on the opposite side (diagonally) to the truncated pin on the WS2812B.
Armed with this knowledge we can start soldering:
Appropriately positioned element:
Soldered:
First test with Arduino UNO and "Adafruit Neopixel Library":
In the process of soldering (I soldered the whole thing with the cheapest soldering iron from china):
Finished module:
First digit test:
The 3D design of the display
I then started Blender and took to designing a 3D overlay for the diode board to shape the digit parts. I started by transferring the holes from the PCB (I will use these for assembly):
I then decided on the size of the segments and applied their initial shape:
Then I refined their shape and prepared the final element (in Blender I used the Boolean operation to cut the segments out of the cube):
This is how I gave the whole thing a third dimension (the central two cylinders are the holes; the four on the corners are the tabs):
Display 3D printing and fitting
The component came out right the first time. On the board it looked like this:
But that's not the end of the story, because you still need to make some sort of overlay that diffuses the light at least a little and gives the effect of whole segments (rather than individual LEDs) shining through.
I wasn't sure what was best to use for this, so I used one of the layers from the inside of an old LCD matrix (whose teardown I described recently in the 'device interiors' section). I chose the layer that gives the best effect, white/milky:
I applied it to the printed part using droplet/superglue, as I was no longer planning to change it.
I attached the printed component to the PCB using laptop screws:
Final result:
Combining subsequent panels
I designed the panels so that they could be joined together. Unfortunately, however, they turned out to have slightly too thick edges and I couldn't use the typical 2.54mm jumpers to join them, but I managed in another way. This will be corrected in the next version.
Ultimately I wanted to use the prototypes I made as a temperature display, so I connected the three modules together:
(in the meantime I also switched from Arduino UNO to Nano)
The module in action (highest possible brightness):
Colour test (50% brightness):
Example operating code for Arduino (countdown)
Ultimately, I intend to use my display with the PIC, but nevertheless I thought I'd write some short test code for it on the Arduino and share it with you.
The code supports digit division and you can easily add support for more digits to it.
The code is based on the Adafruit_NeoPixel library.h, from here:
https://github.com/adafruit/Adafruit_NeoPixel
Copy of the repo above to download in .zip:
Code:
Code: C / C++
The 'displayDigit' function sets the display of a given digit to a specific position, and 'displaySimple' displays a three-digit number (more digits can be handled, but the code must be modified). The 'masks' array specifies which parts should be lit for which digit (further elements can be added to this array to display, for example, the letter 'A').
It's worth remembering that just setting the WS2812B colour through the library here doesn't display it on the strip, to display the changes you need to call 'strip.show()'.
The result of the code:
Based on this, you can easily realise a simple thermometer or clock (in the case of the clock, the fourth digit will be useful, you will need to modify the code).
Mistakes made, what could be improved, etc
This was my first attempt at making my own displays based on 3D printing, so a few things could be improved here:
- first of all, you need to improve the edges of the boards so that the goldpins would reach each other (there would be a gap of 2.54mm between them) in order to be able to connect them with ordinary two-pin jumpers
- the number of WS2812B could be doubled to increase the brightness of the segments (although they are now clearly visible)
- you could think about using the other side of the PCB, e.g. give space for the microcontroller there (but of course only use it for the first module, and not solder in the others)
- this 3D printed element could be printed with more infill or thicker, because a little bit of its side walls let the light through and they should not
- a better light diffusing coating could be used, maybe someone has an idea what kind?
- the board from the photos in the topic was obviously missing the description layer, it simply got lost during the export to Gerbers, in the next version you should remember to add it
Summary
The first attempt was essentially successful - I am happy with my display. It is comfortable to use and looks good in a dark room. I will definitely make a second, improved version of it. From the version shown here, I think I will in turn make a thermometer and use the RGB possibilities to somehow also reflect the displayed temperature through the colour of the digits.
Attachments:
Blender file with display model (and some additions):
Eagle file with the display PCB (needs tweaking!):
Cool? Ranking DIY Helpful post? Buy me a coffee.