Circuit Simulation In Python

Using SPICE to simulate an electrical circuit is a common enough practice in engineering that “SPICEing a circuit” is a perfectly valid phrase in the lexicon. SPICE as a software tool has been around since the 70s, and its open source nature means there are more SPICE tools around now to count. It also means it is straightforward enough to use with other software as well, like integrating LTspice with Python for some interesting signal processing circuit simulation.

[Michael]’s latest project involves simulating filters in LTspice (a SPICE derivative) and then using Python/NumPy to both provide the input signal for the filter and process the output data from it. Basically, it allows you to “plug in” a graphical analog circuit of any design into a Python script and manipulate it easily, in any way needed. SPICE programs aren’t without their clumsiness, and being able to write your own tools for manipulating circuits is a powerful tool.

This project is definitely worth a look if you have any interest in signal processing (digital or analog) or even if you have never heard of SPICE before and want an easier way of simulating a circuit before prototyping one on a breadboard.

New Circuits With Old Technology

Before the invention of transistors, vacuum tubes ruled the world. The only way to get amplification or switching (or any electrical control of current) back then was to use tubes. But some tube design limitations were obvious even then. For one, they produce an incredible amount of heat during normal operation, which leads to reliability issues. Tubes were difficult to miniaturize. Thankfully transistors solved all of these issues making vacuum tubes obsolete, but if you want to investigate the past a little bit there are still a few tubes on the market.

[kodera2t] was able to get his hands on a few of these, and they seem to be relatively new. This isn’t too surprising; there are some niche applications where tubes are still used. These have some improvements over their ancestors too, operating at only 30V compared to hundreds of volts for some older equipment. [kodera2t] takes us through a few circuits built with these tubes, from a simple subminiature vacuum tube radio to a more complex reflex radio.

Taking a walk through this history is an interesting exercise, and it’s worth seeing the ways that transistor-based circuits differ from tube-based circuits. If you’re interested enough to move on beyond simple radio circuits, though, you can also start building your own audio equipment with vacuum tubes.

Continue reading “New Circuits With Old Technology”

Hexagons – The Crazy New Breadboard

A breadboard is a great prototyping tool for verifying the sanity of a circuit design before taking the painstaking effort of soldering it all together permanently. After all, a mistake in this stage can cost a lot of time and possibly material, so it’s important to get it right. [daverowntree] wasn’t fully satisfied with the standard breadboard layout though, with fixed rows and columns. While this might work for most applications, he tried out a new type of prototyping board based on hexagons instead.

The design philosophy here revolves around tessellations, a tiling method for connecting the various components on this unique breadboard rather than using simple rows. The hexagons are tessellated across the board, allowing for some unique combinations that might make it slightly more complicated, but can have some benefits for other types of circuits such as anything involving the use of a three-wire device like a transistor.

The post is definitely worth a read, as [daverowntree] goes through several examples of this method of prototyping where the advantages are shown, like a voltage follower circuit and some other circuits involving transistor biasing. If you’re OK with the general design of breadboards, though, and just wished you didn’t have to do anything after the prototyping stage, we’ve got some help for you there as well.

Chris Gammell Talks Circuit Toolboxes

Chris Gammell wants to know: What’s in your circuit toolbox?

Personally, mine is somewhat understocked. I do know that in one of my journals, probably from back in the 1980s, I scribbled down a schematic of a voltage multiplier I had just built, with the classic diode and capacitor ladder topology. I probably fed it from a small bell transformer, and I might have gotten a hundred volts or so out of it. I was so proud at the time that I wrote it down for posterity with the note, “I made this today!”

I think the whole point of Chris’ 2018 Hackaday Superconference talk is precisely what I was trying to get at when I made my “discovery” — we all have circuits that just work for us, and the more you have, the better. Most readers will recognize Chris from such venues as The Amp Hour, a weekly podcast he hosts with Dave Jones, and his KiCad tutorial videos. Chris has been in electrical engineering for nearly twenty years now, and he’s picked up a collection of go-to circuits that keep showing up in his designs and making life easier, which he graciously shared with the crowd.

As Chris points out, it’s the little circuits that can make the difference. Slide after slide of his talk had schematics with no more than a handful of components in them, covering applications from dead-simple LED power indicators and switch debouncing to IO expansion using a 74HC595.¬†And as any sensible engineer might, Chris’ toolbox includes a good selection of power protection circuits, everything from polarity reversal protection with a MOSFET and a zener to a neat little high-side driver shutoff using a differential amp and an optoisolator.

My favorite part of the talk was the “Codeless” section — things you can do with discrete components that make microcontroller circuits better. We see the “You could have used a 555!” comments from readers all the time, and Chris agrees, at least to a point. He aptly notes that microcontrollers can wake up with their IO pins in unknown states, and offered several circuits to keep the potential for mischief at bay, such as Schmitt trigger power-on reset or the simple addition of a pull-down resistor to default a MOSFET to a safe state. There’s a lot that code can accomplish, but adding just a few parts can make a circuit much safer and useful.

Chris acknowledges that in any audience, everyone is always at different places with regard to their hardware learning curve, so what’s old hat to someone might be a fresh revelation to another. Still, everything is new to someone at some point, and that’s often the best time to write it down. That’s what I did all those years ago with that voltage multiplier, and it never left me as a result. It’s good advice, and if you haven’t started building your own circuit toolbox, now’s the time.

Continue reading “Chris Gammell Talks Circuit Toolboxes”

The Embroidered Computer

By now we’ve all seen ways to manufacture your own PCBs. There are board shops who will do small orders for one-off projects, or you can try something like the toner transfer method if you want to get really adventurous. One thing we haven’t seen is a circuit board that’s stitched together, but that’s exactly what a group of people at a Vienna arts exhibition have done.

The circuit is stitched together on a sheet of fabric using traditional gold embroidery methods for the threads, which function as the circuit’s wires. The relays are made out of magnetic beads, and the entire circuit functions as a fully programmable, although relatively rudimentary, computer. Logic operations are possible, and a functional schematic of the circuit is also provided. Visitors to the expo can program the circuit and see it in operation in real-time.

While this circuit gives new meaning to the term “wearables”, it wasn’t intended to be worn although we can’t see why something like this couldn’t be made into a functional piece of clothing. The main goal was to explore some historic techniques of this type of embroidery, and explore the relationship we have with the technology that’s all around us. To that end, there have been plenty of other pieces of functional technology used as art recently as well, but of course this isn’t the first textile computing element to grace these pages.

Thanks to [Thinkerer] for the tip!

 

Agilent LCR Meter Teardown

Since 1999, one of the more popular manufacturers of test equipment has been Agilent, the spun-off former instrument division of Hewlett-Packard. From simple multimeters to fully-equipped oscilloscopes, they have been covering every corner of this particular market. And, with the help of [Kerry Wong] and his teardown of an Agilent LCR meter, we can also see that they’ve been making consistent upgrades to their equipment as well.

The particular meter that [Kerry] took apart was an Agilent U1731B, a capable LCR (inductance, capacitance, resistance) meter. He had needed one for himself and noted that while they’re expensive when new, they can be found at a bargain used, but that means dealing with older versions of hardware. For example, his meter uses an 8-bit ADC while the more recent U1733 series uses a 24-bit ADC. The other quality of this meter that [Kerry] made special note of was how densely populated the circuit board is, presumably to save on the design of a VLSI circuit.

While we don’t claim to stump for Agilent in any way, it’s good to know that newer releases of their equipment actually have improved hardware and aren’t just rebadged or firmware-upgraded versions of old hardware with a bigger price tag attached. Also, there wasn’t really any goal that [Kerry] had in mind besides sheer curiosity and a willingness to dive deep into electronics details, as those familiar with his other projects know already.

Open-source Circuit Simulation

For simple circuits, it’s easy enough to grab a breadboard and start putting it together. Breadboards make it easy to check your circuit for mistakes before soldering together a finished product. But if you have a more complicated circuit, or if you need to do response modeling or other math on your design before you start building, you’ll need circuit simulation software.

While it’s easy to get a trial version of something like OrCAD PSpice, this software doesn’t have all of the features available unless you’re willing to pony up some cash. Luckily, there’s a fully featured free and open source circuit simulation software called Qucs (Quite Universal Circuit Simulator), released under the GPL, that offers a decent alternative to other paid circuit simulators. Qucs runs its own software separate from SPICE since SPICE isn’t licensed for reuse.

Qucs has most of the components that you’ll need for professional-level circuit simulation as well as many different transistor models. For more details, the Qucs Wikipedia page lists all of the features available, as does the project’s FAQ page. If you’re new to the world of circuit simulation, we went over the basics of using SPICE in a recent Hack Chat.

Thanks to [Clovis] for the tip!