Modular Display Element
In a previous project "Segment Display", I designed a LEGO compatible tile that could be arranged into text based on a seven segment display or inconjunction with other bricks.
The seven segment form lends itself to dynamic and static forms and as a result it seemed to be perfect for an illuminated seven segment display.
The illuminated seven segment display can be used in a number of different ways by simply adding more display units.
The segments are thin enough to allow light to pass through and the light would be provided by Neopixel LED's
Each segment would have 2 x Neopixels for a total of 14 per display with each LED lining up with the outer tubes on the brick.
The standard assembly baseplate on to which the tile attaches have no holes to allow the light to pass through, this therefore necessitates that holes are made in the baseplate.
White tiles are the most versitle with respect to lighting as they are suitable for any colour LED whilst diffusing the light.
However, coloured tiles can be added to highlight a specific colour or to suit a particular situation. Either way the tiles can be easily rearrange as they simply clip in place.
Downloads
Supplies
Kitronik Edge Connector Breakout
Jumper Jerky Junior F/M - Qty 3
470R resistor
WS2812Neopixel Button LED's - Qty 14.
Enamelled Copper Wire 21 AWG (0.75mm dia.), or other insulated wire.
Right Angle Header 2 x (3 ways x 1 row) required.
Stripboard
M2 screws 6mm - Qty 4
May prove more cost effective to buy a range of values rather than individual values unless you already have them available. Some components may also have a MOL greater than the quantity specified in the component list.
3D Printer
White Filament - For the greatest display flexibility.
Black Filament - For the supporting boards.
2mm drill bit
Drill
Saw
Pliers
Wire cutters
Soldering Iron
Solder
Sanding paper
Screwdrivers
Know your tools and follow the recommended operational procedures and be sure to wear the appropriate PPE.
No affiliation to any of the suppliers used in this project, feel free to use your preferred suppliers and substitute the elements were appropriate to your own preference or subject to supply.
Links valid at the time of publication.
Design
In the absence of a build plate with holes to support the tiles there are two options.
1: Take an existing baseplate and drill holes between alternate groups of 4 stubs with 4mm holes and 2mm holes between the other group of 4 stubs.
2: 3D print a baseplate complete with holes.
The size of the baseplate required is 96 mm (W) x 144 mm (L) or 12(W) x 18(L) stubs.
The design for the 3D printed baseplate was completed in BlocksCAD.
In addition to the baseplate there needs to be support for the Neopixels, this is also 3D printed and attached to the baseplate with 2mm self tapping screws.
3D Printing
The baseplate and the Neopixel support board are printed in black PLA.
Print settings:
Quality: 0.15mm
Infill: 100%
Base Adhesion: Skirt
Assembly
Once the parts are printed assembly is required.
Place the Neopixel support board against the baseplate with the flat surfaces facing each other.
Using four M2 x 6mm screws one in each of the 2mm holes in the corners secure the two boards together.
A commercially available baseplate could be used but would require cutting to the required size and holes drilled to allow the parts to fit together and light from the LED's to pass through.
Wiring
The Neopixels need to be mounted to enable a seven segment display to be realised.
This is achieved using 14 Button LED's with 2 per segment all wired in series.
Each LED is connected together using 21 AWG enamelled copper wire these are cut to the required length, stripped and tinned prior to soldering to the solder pads
With the castellations of the Neopixel support board uppermost, place an LED with the PCB uppermost into the pocket.
Orientate the LED's to enable direct connection to 5V, 0V and DO to DI.
Make the connections to each LED in turn (refer to diagram), 2 LED's per segment.
Some melting of the plastic will occur during soldering of the wires and this will hold the completed assembly in place.
However, a little hot glue at the back of the LED's will help if required to hold things in place.
Soider 3 wires to the input LED to enable connection to Edge Connector Breakout and connect to 5V, 0V and P0 by the CR circuit on the stripboard.
Coding
The code is created in Makecode.
'on start' procedure.
Initializes the Neoplxel strip of 14 LED's
Initializes the segment_list which contains segment designations per number to be displayed.
Number 0 stored in element [0] = 01111110
Number 1 stored in element [1] = 00001101
.....
Number 9 stored in element [9] = 11011119
Additionally, alphanumeric characters are stored in the rest of the array.
Calls 'Time_split' which takes the index value.
Calls 'pixel_time'
Digit contains the value in segment_list referenced by segment_value.
(If segment_value = 0 then digit = element [0] = 01111110)
Inc = index x (LED_SEG) x 7). Where index = which of the 4 characters is referenced, LED_SEG = number of LED's per segment, 7 = number of segments in a digit.
This specifies the start of the LED's to be controlled for the appropriate character.
The for element assigns in turn each number in digit to value.
If value =1 then the pixel assigned by inc is set to red and turned on otherwise it is turned off.
As two LED's per segment are required this process is repeated LED_SEG times.
(E.g. If Hours unit is 9, index = 0,
digit = 10111119 [value = 1, inc = 0 & inc = 1], [value=0, inc = 2 & inc = 3] .... [value=1, inc=12 & inc = 13])
Hours tens [Index =1, inc range 14 to 27], Minutes unit [index =2, inc range 28 to 41], Minutes tens [index =3, inc range 42 to 55].
Once each of the 7 values have been processed and sent to the strip the changes are shown.
The eighth character is displayed on the Microbit to enable comparison of the processed and required character.
A delay is introduced to prevent flicker.
This process is repeated for each element in the segment_list array.
Testing
Test the display by connecting it to the Microbit via the CR circuit (1000uF across 5V & 0V and 470R in series with DI).
Running the code will display the numbers 0-9 and alphabetic characters whilst simultaneously displaying the regular characters on the Microbit display for comparison.
Due to the limited number of segments formation of all characters can prove problematic and therefore some of the alphabetic characters have been restructured to try and maintain uniqueness even if this makes them initially unfamiliar.
However, feel free to change the format for the characters that are difficult to realise to suit your own requirements .
Finally
Hope you found this of interest.