Brian Lovin
/
Hacker News
Daily Digest email

Get the top HN stories in your inbox every day.

SN74H74N

The site of the creator of the simulator has a newer version: http://www.falstad.com/circuit/

I love this tool because you can export links or export circuits as text files.

Clock circuit I made that uses faster and slower buttons to adjust the speed: https://tinyurl.com/2nvlulfl

8-bit binary multiplier (LSB on top): https://burlette.net/multiplier.txt

alphabetter

Yes, Paul did the original as a Java Applet. I did the port to run in the x-compile to allow it to run in the browser. After that we cooperated on it for a while. I stepped back a few years ago to focus on other things, but he's kept up with improvements. Kudos.

alphabetter

I posted that rather quickly, so a bit more information for those who are interested (inspired by some of the comments on the thread).

I found Paul's sim by chance and really liked it because it was the first electronics sim that I had seen that was properly interactive and visual in its approach. I thought it was a great tool for building intuition about circuits. However, at a certain point it became clear that Java in the browser was on its way out, and this really needed to become a plug-in free experience if it was going to continue to be useful.

This was about the time that V8 was coming along and revoluationizing the performance of JS. Originally there was no license attached to the project, so I asked Paul if he was OK in me trying to port it to run on JS using the GWT framework. He was fine, but said he'd done old experiments with some of his other sims and found that JS wasn't performant enough, but with the strides in JS performance I was more optimistic.

I took the Jave code and commented just about everything out to get a minimal implementation of the standard LRC circuit just to see the performance. Once I was comfortable with that working I started adding every feature and every component back. Most of the work was replacing the Java graphics primitives with the equivalents from GWT.

Once the initial version JS version was out I did quite a lot of work mostly on UI features, especially the 'scopes. They were rather weak in the original and still not as good as I would really like, but much improved.

I have thought about monetizing and extending with EDA features, socials, etc. but its never been enough of a priority to do it. I kind of like its simplicity as it is.

It has been used a lot in education and a couple of teachers have contributed to the code to support their uses in classrooms.

It's kind-of amazing that it still has a very distinctive niche that nobody else has really gone after in quite the same way. I think a lot of that is because Paul's original vision and work on the Java version was so good.

There is a bit more context and some tutorials here: http://lushprojects.com/circuitjs/

petespeed

Thank you.

For person trying to learn circuit theory and logic design, would you recommend a resource that can be followed along?

Also, any recommendation for kids? I think this area can be explored by kids in the same way programming.

BMc2020

That's what you say now, how do we know you won't flip flop?

ggeorgovassilis

umvi

Yeah, I got the joke. I was (and still am) tempted to downvote though because puns and pun chains are low effort and reddit-esque. "What you posted didn't register at first", "I'll have to think about that for a bit", "Why can't we post flip flop puns? This community is too gated", etc.

SN74H74N

So you are saying they should have ended the post with JK?

etimberg

Many years ago I helped write https://www.multisim.com

It's a full SPICE based simulator done entirely clientside

ubavic

Cool, thank you for sharing.

I am interested in simulators, especially in simulators of analogue circuits. Do you have any recommendations on where to start reading about algorithms that lie at the core of simulators?

Also, how was the experience developing such product with JS?

compumike

Author of the CircuitLab https://www.circuitlab.com/ (YC W13) mixed-mode (analog and digital) simulation engine here. The "core algorithm" is probably LU decomposition on a sparse matrix: https://ultimateelectronicsbook.com/systems-of-equations/#lu... .

I answered a similar question on Electronics StackExchange where someone asked about how to build a circuit simulator: https://electronics.stackexchange.com/a/394069

From a software developer perspective: lots and lots and lots of automated tests, each of which builds a circuit, runs a simulation, and makes sure we don't see any behavior regression. More lines of code in tests than in the core simulation engine or device models!

atoav

I have been using the falstad sim for years in the developement of analog synthesizer stuff. There are some circuits that work in practise that do not work in practise (e.g. relaxation oscillators with a schmitt-trigger inverter). The model oscillates, but it is not really controlable.

Outside of that most simpler stuff (e.g. analog math using opamps, discrete stuff) works perfectly fine. I love it for education and quick "sanity check" simulations.

etimberg

As /u/compumike mentioned the core spice algorithm is an LU decomposition and solve of a large matrix. Not sure what a good resource these days would be; it's been many years since I worked on this.

The JS experience wasn't great. We used emscripten and the tooling barely worked for the simulator core. The rest of the app wasn't bad, but we used polymer / webcomponents which was a big mistake IMO

rhodin

Continuous System Simulation by Cellier/Kofman [0]. The focus is mainly on Modelica, but analog circuits are a "special case" of this.

[0] https://www.amazon.com/Continuous-System-Simulation-François...

mox111

The source code has the following comment:

For information about the theory behind this, see Electronic Circuit & System Simulation Methods by Pillage

farkanoid

https://www.ni.com/en-au/shop/electronic-test-instrumentatio...

It looks nice but Jesus... $1550AUD a year for the designer edition?

flaviut

Library curation is a massive amount of work. Pretty much the reason I end up using falstad instead of a SPICE is because I end up spending all day tracking down and debugging issues with simulation models.

etimberg

Yeah, these kinds of tools aren't cheap. I know really high end stuff can be > $100,000 per seat per year

genmud

I'm super stoked that hardware / EE is getting so much more focus and interest from software engineers. It really feels like there is so much room for improvement / optimization in that space and for so many years, it was like this black box that nobody wanted to look inside.

hollandays

In my opinion, the next step is to figure out a good way to combine something like gnu octave with nice modern GUIs.

Old tools were inaccessible to use because there's nothing to look at with a text-based tool, and inaccessible for engineers to develop because programming was so arcane. Look at Berkeley spice written in C. It's a lot of old-school parsing and implementing matrix methods.

The new stuff that's more accessible to use is more accessible for a software engineer to develop, but it's arguably even less accessible to other engineers and scientists to add their contributions. This creates an issue where the tools remain as good-looking toys that never get any serious technical chops.

Splitting the implementation is the way to go, but neither side would be happy about the interface. There's also the issue of platform because good engineering tools only run locally.

I don't know what the answer is, but it's not Python. We already have python, and yet, there isn't an explosion of collaboration to make great tools for the physical sciences and engineering. It's too much of a compromise for both sides.

genmud

> I don't know what the answer is, but it's not Python. We already have python, and yet, there isn't an explosion of collaboration to make great tools for the physical sciences and engineering. It's too much of a compromise for both sides.

I would argue that python is actually ideally suited as a solution for many if not most things, just because there isn't large adoption in a subgenre of engineering, doesn't mean it isn't the right solution.

The primitives are there, its easy to comprehend, and there is a large amount of adoption in the scientific community outside EE.

I see lots of stuff that used to be done in things like matlab or mathmatica being done in python directly these days. At least at one of the places that I worked at, where we were a huge matlab shop for doing model design / algorithm simulation, has migrated most of their stuff to python.

Things like antenna design, RF simulation and a number of other things have a lot of of folks writing python code.

hollandays

Are any of those examples successful open-source projects with both the computation and the GUI written in Python? I don't know of anything in any field like that.

I think you misunderstood me. The choice of tools for front and backend have to be independent. The only really successful projects implemented in one language are all in C++, and that's difficult for everyone to approach.

amelius

Circuit simulators are awesome, but they never go the next step such that they work with actual purchasable components. The user always has to read datasheets and translate everything into spice parameters.

Also, they typically don't allow the user to specify maximum power for every component and check that the voltages and currents are within safe limits.

picture

This "next step" is really on the vendor/manufacturer instead of simulator developers. It won't be addressed, either, because it's extra development and cost for the vendor to bare when a lot of low cost/generic applications won't benefit from having simulation files. Additionally, it's a lot more work for the vendor to characterize and also guarantee that their products are close in value after years of production. Some datasheets are very sparse not by mistake - they promise you exactly as much as the datasheet, no more no less (for reputable vendors anyway).

The Micro-Cap simulator has the smoke test feature, for example. It's now abandoned and free for download.

squarefoot

> The Micro-Cap simulator has the smoke test feature, for example. It's now abandoned and free for download.

The website however is now dead, but thanks to the Internet Archive we can still access it to download the software.

https://web.archive.org/web/20220117133700/http://www.spectr...

That software would be a great candidate for a crowdfunding campaign to purchase the source rights from the author and release it as Open Source.

Edit: and it works great with WINE under Linux.

amelius

> This "next step" is really on the vendor/manufacturer instead of simulator developers. It won't be addressed

Which is exactly why the simulator/community should address it.

atoav

It depends on the circuits. Some are highly dependent on certain characteristics of the part that might differ between different series of the actual part.

With time you gain the experience to know which circuits are problematic and which are easy-going.

namibj

If you buy modern power electronic semiconductors, you can usually find so m spice models from the manufacturer (though they do indeed typically not model thermals).

amelius

Spice models are not easy to find, in my experience. Given some random transistor on Digikey, I'd say the odds are less than 20% that I can find the corresponding spice model.

namibj

Fair, but that should generally not be so restrictive that it causes a problem with "having SPICE models for actually purchasable components".

laveur

I've used the one on falstad.com many many times to design op-amp circuits quickly so I could see exactly changing each component would do.

mastax

Yeah it turns out that convenience and observability is more important than accuracy most of the time. Someone should tell the SPICE software vendors.

imjonse

I sometimes wanted an OCR-like tool to transform an image of a schematic into one importable to Spice or other tools. That would save a lot of time entering it. Although I wonder if there is still a time for such a specialized tool since soon GPT-4.X may be able to explain and simulate circuit schematics.

mastax

I think I remember one of the expensive SPICE or CAD tools having a feature like that.

dang

Related:

JavaScript Circuit Simulator - https://news.ycombinator.com/item?id=9896436 - July 2015 (22 comments)

Tade0

I used this app in college back when it was a Java Applet - it helped me greatly in overcoming gaps in my intuition about analog circuits, even though the models used are relatively simple.

eternityforest

I've used this so many times on professional projects, if I'm in a computer without any other sims.

It's not accurate enough to 100% rely on, but it's good enough for simple stuff that I could do without a sim, but prefer to have at least some kind of review on my work before I actually send off for board.

mittermayr

Absolutely amazing! I feel like this could be nicely packaged into a proper product, along with a teacher's guide and then sold to schools. I feel like a lot of people have given up on fundamental electronics as there's just so much other stuff to spend time on, stuff like this could make it a tiny bit more approachable again.

compumike

We do something like this at CircuitLab https://www.circuitlab.com/ -- lots of universities are customers. :)

freeone3000

I remember using this as an applet in college! Nice to see it updated for the modern age.

madmax108

A similar project in the circuit-sim space which is also part of GSoC every year: https://circuitverse.org/

Daily Digest email

Get the top HN stories in your inbox every day.