remix logo

Hacker Remix

I designed my LED matrix PCB with code

95 points by imrishabh18 16 hours ago | 41 comments

synapsomorphy 14 hours ago

Atopile is another thing in the circuits-as-code space: https://github.com/atopile/atopile

As a half EE/half SWE I think there are significant benefits to circuits as code but I'm not impressed with this one. Atopile has a narrower focus (autorouters are really really hard) and doesn't use as many buzzwords. Like why on earth does a "web first approach" matter at all for hardware development?

But also, GUI tools are getting better, Kicad 9 had a lot of changes that made templating / reusing blocks easier. And it works fine if not great with version control.

I don't see circuit-as-code taking off with humans anytime soon, it's much better but not enough better to convince EEs many of which don't code much or at all. But I can see it becoming much more common as LLMs get better at complex circuits.

kev009 8 hours ago

It's probably a simple economics thing. You can hire out a contract PCB design for a reasonable cost and the long poll is getting back physical prototypes. Contrast to HDLs displacing schematic based designs for ASICs and programmable logic, where simulation allows for rapid development.

bb88 10 hours ago

> I don't see circuit-as-code taking off with humans anytime soon

I don't agree with this. Circuits aren't really anything more complex than anything else humanity has had to figure out. Most knowledge in this area seems solvable.

Maxwell's equations have been known for a century.

For whatever reason, Software Engineering and Hardware Engineering even though they rely upon the same fundamental physics, are so very different? And apparently can't be reconciled? No. I don't believe it.

cactacea 10 hours ago

PCB layout is as much art and black magic as it is science. I'm not sure why you dismiss the complexity so easily, this definitely is not just a matter of applying Maxwell's equations.

0_____0 7 hours ago

Layout is a puzzle, especially with particularly high density layouts, but some of this is ameliorated by high layer count and fine trace/space boards becoming cheaper. Definitely not black magic. RF layout is black magic, let's not steal their thunder here.

tuetuopay 3 hours ago

High speed PCBs are RF. At high enough frequencies, traces become waveguides, and the result cannot be predicted analytically. Simulation is your only light in this mess.

bogantech 7 hours ago

> For whatever reason, Software Engineering and Hardware Engineering even though they rely upon the same fundamental physics

Software engineering isn't a thing besides being an ego title.

Software is "ship now, patch later"

Hardware is engineered, it must be correctly designed from the beginning and cannot be easily modified in the field

donkey_brains 2 hours ago

[dead]

mystified5016 13 hours ago

I don't know why anyone wants to shove big heavy applications into browsers. Are they imagining you'd use your phone for this?

Are we not teaching kids how to publish desktop applications these days or what?

imrishabh18 4 hours ago

It's just not that we are imagining that people will be using phone to build PCB's, we also have a cli which perform better than the browser playground!

https://docs.tscircuit.com/intro/quickstart-cli

saidinesh5 7 hours ago

My guess is the cross platform story.

For cross platform development we barely have any decent, free development tools. It's a lot easier to find JavaScript developers in most places than c++/c# developers.

Neywiny 14 hours ago

Wish I could comment on the routing like others but the render is stuck at 96.2% for me. Nothing else on the page shows it on my phone so I assume that's the problem. (And of course nothing in the log of error tabs).

I think just looking at the first code example you can already see the problem. A lot of duplication and hand written or auto generated code. I thought the point was to define it in the code. Put an array of pin functions. For loop the footprint. That kinda thing. This looks like a mess to get started with and even worse is at higher point count parts it looks like it'll balloon in maintainability. Altium has very solid footprint generators with a nice menu. This looks like it's missing an overarching API for creating these long lists of parameters. Doesn't feel like the juice is worth the squeeze on this one. If it's a simple schematic, just do it by hand. If it's complicated, this feels harder to wrangle.

Another example of weird code is the previousLedName. Like like really that variable isn't used and the first term of the && should be that indeed check. But even more so, it should be an if statement not rely on remembering short circuiting (lazy evaluation) tricks. Because that's what you mean. You mean if it's not the first one, connect to the previous one. So, the code should say that. I find it hard to believe such a high level language would prevent it.

I think the pin label lists don't make sense. They're maps where the value is an array where the first element is the key? Why is this not just a list of pin numbers to names or a map of they're not contiguous whole numbers?

And then the icing on the cake: you still have to define where in XY everything is.

So really, in thinking about this, this looks more like a file format than a tool. And maybe that's fine. But I'll stick to the native formats of the tools.

alnwlsn 12 hours ago

A lot of deserved criticism in the comments here tonight, but more generally, I have to ask - what's the deal with all these code/text to CAD/PCB things?

There's a half dozen of them in any category, they are all different, they all seem to struggle badly with anything outside of simple examples, none of them appear to consider how things fit together in the real world, you almost never see any of them used for anything more complicated than a keyboard layout or an LED matrix, they all have reinvented the wheel instead of using industry standard formats, and they all talk about the "difficulty of using traditional tools" as though placing each XY point in space in your head is easier than dragging things around the screen like in MS Paint. You also never see any serious hardware people use them. Every one wants to do it all from keyboard to finished product instead of being satisfied as a intermediate tool that does one thing well.

But, they all have very polished documentation, they come with examples, they have nice looking websites, and it's obvious someone put a decent amount of thought into making them. It's not like they are useless either. Making a big grid of things? It's nice to be able to write an algorithm to do that instead of entering them by hand.

I brought this up in that post about the LLM to CAD thing the other day. It's like people keep saying "hardware is hard" but then keep trying to solve it like they would work on software problems.

LiamPowell 7 hours ago

At a high level I think a lot of it is simply hubris from software engineers who see the basics of electrical engineering or 3D CAD and think that the basics are all there is to the field. It's the same as when people see a hello world or fizzbuzz program and think that's representative of software engineering before proposing no-code solutions.

Anecdotally as someone who studied mechatronics: Software engineers are far worse than any other engineering field in assuming that everything is trivial compared to SE.

vbezhenar 8 hours ago

When I'm using Fusion 360, I can't stop thinking that this whole experience would be much better with code. It has awesome underlying engine, but GUI UX is just terrible. I'd prefer to describe objects in code, observing code output in real-time on adjacent panel, using proper text editor to apply changes.

I've used OpenSCAD, it's not the thing I want, it doesn't have constraint solving, the key is using constraint solving with feedback to highlight warnings, etc.

Now maybe I'm not talking about complete replacement of GUI with code, but rather an alternative view, where you can either use GUI to model objects, or switch to code where everything is synchronized.

buescher 11 hours ago

They're aiming to recapitulate the success of HDL design in the IC world. The jitx folks are pretty clear about that. There are a lot of problems with that that could be a medium-sized think piece, but some things folks are doing in the space are neat. PCB-level EDA is overdue for better design checks, for example.

snops 5 hours ago

I think the most recent surge is due to LLMs, the only way to (easily) apply them is to have some form of code like textual representation of your problem domain so "circuits as code" is the obvious way to wedge them into electronic engineering.

Kicad also makes it easier to make such startups as it has an open file format with several different free viewer tools and lots of content (schematics/footprints). If that ecosystem didn't exist I don't think you would see as many of these startups around, but with that you can launch one of these tools within a initial VC funding

crote 14 hours ago

I'm genuinely surprised by how awful the resulting PCB is. A trivial LED matrix like this is pretty much the best-case scenario for tooling like this. Not being able to handle this is a pretty damning - although a decent bunch of the blame should probably be placed on whatever third-party autorouter they are calling out to.

Even with better results, the big issue with tools like these is that they simply don't match with the kind of development style that's needed for the problems at hand. You see the same issue with those drag-and-drop visual programming languages, or scripted modeling like OpenSCAD: they end up making fairly trivial details slightly easier, while significantly complicating the meat-and-potatoes. Nobody cares about a neat little part placement for-loop if it generates a living hell of autorouted spaghetti you can't possibly interpret and fix manually.

In reality the low-hanging fruit has already been covered by existing tooling. Automatically generating symbols and footprints from textual descriptions is routine practice, and software like KiCad already has a reasonably usable scripting API and a well-documented file format. A lack of code-based code-based EDA hasn't stopped projects like Ergogen[0] from popping up. The main limitation for additional automation is a lack of reliable input data, and user-side tooling can't fix that.

[0]: https://docs.ergogen.xyz/

seveibar 14 hours ago

(tscircuit maintainer here) It might be easier to think of tscircuit as an electronics CAD kernel. We're MIT licensed and web-compatible, so we would make a great foundation for people building new EDA tools or people who would like to generate electronics (think domain-specific tools, e.g. a website that allows you to quickly build a custom keyboard)

FWIW In this case I think this board called out to freerouting for the routing. Companies have reached out to us with autorouting APIs, so we'll support different vendors and hopefully allow enough constraint-specification for people to get good results. Autorouting is important for reusability, even if it's routing between manually-routed sections (e.g. fanouts)