Aray leds around board outline

Good evening guys, I’m new to Ki Cad, I have been previously using easy eda.

What I want to do is somewhat automate the layout of leds on my custom letter PCBs the way I assume it could work is a script that follows either a board outline or dxf ? and you just set the pitch. I’m currently doing this via fusion360 to create boxes in an array then importing the dxf then manually placing and rotating the leds which takes up to 7 days just to do that is there anyone who can help me?

Regards
Chris

Can you give some more info of what you are trying do do?
If it takes 7 days to place and rotate your LED’s, then it must be a lot of leds, in some serial / parallel combination. From your post I’m guessing you’re making letters of maybe half a meter high or higher with thousand’s of LED’s in each letter. Am I close? Anyway, the rest of my post is based on that assumption.

Drawing a schematic of very big LED arrays is not so difficult, because you can double the amount of LED’s each step with a bunch of Copy & Paste cycles, but it’s manual labor, and if you want different sized arrays you have to repeat the work.

SkiDL is a project to automate such tasks:

In essence it is a Python library in which you can create schematic components, assign footprints and make connections, and then export it as a KiCad netlist. In Python you have all the tools of arrays & loops, etc available, so a LED array of any size is just two nested loops.

For placing that many LED’s on the PCB, a scripted approach is also preferable. KiCad itself is not great in graphics capabilities. With KiCad you can import .DXF files and you can run scripts directly in Pcbnew, but I have no experience with that. With scripts in Pcbnew itself you also may have some trouble with transitioning from the current stable KiCad V5, to the coming (expected this year) KiCad V6.

Maybe others have better ideas, but my best guess is to use external tools. I don’t know what your design looks like, but I suppose it’s some line-based drawing which can be exported as a .DXF or .SVG file.

I think that tools for post-processing drawings to generate CNC tool paths may be a reasonable fit here. An example of such a program is bCNC. bCNC is an Open Source project, written in Python, and it has a bit of a weird and un-cohesive feature set, but it does have a bunch of very neat functions. I’m guessing that “special functions” get added by people who have a use for such a special feature.

One of those neat functions in bCNC is a “driller” script. A few screenshots to show you what it can do. In the first screenshot I’ve opened a .dxf file:

This “top” view hides all Z-axis info, so in this second screenshot, I’ve changed the viewscreen to “ISO2” (just right of the big red “Not connected” bar)

And then it’s a single mouse click to select a “contour” (which is extracted from DXF line and arc segments with matching endpoints), and with bCNC / CAM / Driller you can set some parameters such as distance between holes and depth, and then it drills holes along the selected contour. in the “ISO2” view it looks like:

(To be fair: It seems to be missing the straight line segments, I guess this is a bug in bCNC).
From bCNC you can export your modifications in different file formats. such as .dxf, .svg and in gcode itself of course. From there it should be a simple step to write a script and change each “drilled hole” into a footprint location for a LED. bCNC drills the holes in order (as you can see in the simulation, but that needs “GRBL hardware”). Because the holes are in order, it’s also relatively easy to create angle information for your LED’s.

The PCB can also be generated from a Python script.
A worked out example can be found at the link of the “studio clock” below.
By combining that with the coordinates & rotation info from above should automate most of the work.


Another approach could be to use the StepUp workbench in FreeCAD. The StepUp workbench in FreeCAD acts as an interface between KiCad and FreeCAD and it is a tool that can be used for making 3D models, or for importing and exporting KiCad PCB’s in FreeCAD. FreeCAD apparently also has a quite extensive interface for Python scripting. FreeCAD does have quite a steep learning curve though.

So the projects are related to letters I make with addressable leds around the board perimeter I try to get as many letters into one panel as possible and every time a make a set they are always unique, which is annoying it’s always the same schematic pretty much.

I like the idea of the python script but I’m not sure how to use it are there guides? can you help?

So it’s a single row of LED’s around the perimeter. But how big are these boards that it takes days just to place the LED’s?
And this is a repeating project, each time different sizes or fonts, or specific text strings, presumably for advertising?

I do have a bit of a programming background, so I know what sort of thing can be done with a programming language, but It’s (almost) all in C and C++ and for microcontrollers. I have very little experience with Python, and close to none with Python as a scripting language inside another program, so I can’t help there.

Learning to program and learning a programming language are two different things, and in the beginning you have to learn them both at the same time, and this is quite an investment in time and effort. But it probably is much better than spending days upon days to manually pace and rotate LED’s.

Where do you get your letters from, and the outlines to place the LED’s on?
Several CAD programs have the ability to place items along a line, and also rotate them to follow the contour. If you start with something like that, and export it in some easily parse-able vector format that would probably make your scripting attempt a lot easier.

so yes a perimeter of leds each letter has 120 ish dependent on size and font and yes you are correct regarding the different sizes and fonts. its for boats etc sizes are usually around 120mm high led count can vary with density as well. i machine everything etc i design them in cad specifically fusion 360
duration is just due to the clunky nature of easy eda at the moment, i used that because it is easy and i just order the boards from them but lately they have let me down regarding components etc so i have bought a pick and place machine etc

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.