Python Code from My Articles Now Online in IPython Notebooks

Jason Sachs May 1, 2015

Ever since I started using IPython Notebooks to write these articles, I’ve been wanting to publish them in a form such that you can freely use my Python code. One of you (maredsous10) wanted this access as well.

Well, I finally bit the bullet and automated a script that will extract the Python code and create standalone notebooks, that are available publicly under the Apache license on my bitbucket account:

This also means they...

Ten Little Algorithms, Part 2: The Single-Pole Low-Pass Filter

Jason Sachs April 27, 201512 comments

Other articles in this series:

I’m writing this article in a room with a bunch of other people talking, and while sometimes I wish they would just SHUT UP, it would be...

Ten Little Algorithms, Part 1: Russian Peasant Multiplication

Jason Sachs March 22, 20155 comments

This blog needs some short posts to balance out the long ones, so I thought I’d cover some of the algorithms I’ve used over the years. Like the Euclidean algorithm and Extended Euclidean algorithm and Newton’s method — except those you should know already, and if not, you should be locked in a room until you do. Someday one of them may save your life. Well, you never know.

Other articles in this series:

  • Part 1:

Two Capacitors Are Better Than One

Jason Sachs February 15, 20155 comments

I was looking for a good reference for some ADC-driving circuits, and ran across this diagram in Walt Jung’s Op-Amp Applications Handbook:

And I smiled to myself, because I immediately remembered a circuit I hadn’t used for years. Years! But it’s something you should file away in your bag of tricks.

Take a look at the RC-RC circuit formed by R1, R2, C1, and C2. It’s basically a stacked RC low-pass filter. The question is, why are there two capacitors?


My Love-Hate Relationship with Stack Overflow: Arthur S., Arthur T., and the Soup Nazi

Jason Sachs February 15, 201551 comments

Warning: In the interest of maintaining a coherent stream of consciousness, I’m lowering the setting on my profanity filter for this post. Just wanted to let you know ahead of time.

I’ve been a user of Stack Overflow since December of 2008. And I say “user” both in the software sense, and in the drug-addict sense. I’m Jason S, user #44330, and I’m a programming addict. (Hi, Jason S.) The Gravatar, in case you were wondering, is a screen...

Voltage Drops Are Falling on My Head: Operating Points, Linearization, Temperature Coefficients, and Thermal Runaway

Jason Sachs January 19, 2015

Today’s topic was originally going to be called “Small Changes Caused by Various Things”, because I couldn’t think of a better title. Then I changed the title. This one’s not much better, though. Sorry.

What I had in mind was the Shockley diode equation and some other vaguely related subjects.

My Teachers Lied to Me

My introductory circuits class in college included a section about diodes and transistors.

The ideal diode equation is...

Important Programming Concepts (Even on Embedded Systems) Part V: State Machines

Jason Sachs January 5, 20158 comments

Other articles in this series:

Oh, hell, this article just had to be about state machines, didn’t it? State machines! Those damned little circles and arrows and q’s.

Yeah, I know you don’t like them. They bring back bad memories from University, those Mealy and Moore machines with their state transition tables, the ones you had to write up...

Optimizing Optoisolators, and Other Stories of Making Do With Less

Jason Sachs December 15, 20144 comments

It’s been a few months since I’ve rolled up my sleeves here and dug into some good old circuit design issues. I started out with circuit design articles, and I’ve missed it.

Today’s topic will be showing you some tricks for how to get more performance out of an optoisolator. These devices — and I’m tempted to be lazy and call them “optos”, but that sounds more like a cereal with Greek yogurt-covered raisins — are essentially just an LED...

Book Review: "Turing's Cathedral"

Jason Sachs November 20, 20146 comments

My library had Turing’s Cathedral: The Origins of the Digital Universe by George Dyson on its new acquisitions shelf, so I read it. I’d recommend the book to anyone interested in the history of computing.

Turing’s Cathedral primarly covers the period in early computing from 1940-1958, and bridges a gap between a few other popular books: on the historic side, between Richard Rhodes’s

Important Programming Concepts (Even on Embedded Systems) Part IV: Singletons

Jason Sachs November 11, 20142 comments

Other articles in this series:

Today’s topic is the singleton. This article is unique (pun intended) in that unlike the others in this series, I tried to figure out a word to use that would be a positive concept to encourage, as an alternative to singletons, but

How to Build a Fixed-Point PI Controller That Just Works: Part II

Jason Sachs March 25, 20122 comments

In Part I we talked about some of the issues around discrete-time proportional-integral (PI) controllers:

  • various forms and whether to use the canonical form for z-transforms (don't do it!)
  • order of operation in the integral term: whether to scale and then integrate (my recommendation), or integrate and then scale.
  • saturation and anti-windup

In this part we'll talk about the issues surrounding fixed-point implementations of PI controllers. First let's recap the conceptual structure...

Ten Little Algorithms, Part 4: Topological Sort

Jason Sachs July 5, 20151 comment

Other articles in this series:

Today we’re going to take a break from my usual focus on signal processing or numerical algorithms, and focus on...

How to Read a Power MOSFET Datasheet

Jason Sachs September 15, 20158 comments

One of my pet peeves is when my fellow engineers misinterpret component datasheets. This happened a few times recently in separate instances, all involving power MOSFETs. So it’s time for me to get on my soapbox. Listen up!

I was going to post an article on how to read component datasheets in general. But MOSFETs are a good place to start, and are a little more specific. I’m not the first person to write something about how to read datasheets; here are some other good...

How to Estimate Encoder Velocity Without Making Stupid Mistakes: Part II (Tracking Loops and PLLs)

Jason Sachs November 18, 201310 comments

Yeeehah! Finally we're ready to tackle some more clever ways to figure out the velocity of a position encoder. In part I, we looked at the basics of velocity estimation. Then in my last article, I talked a little about what's necessary to evaluate different kinds of algorithms. Now it's time to start describing them. We'll cover tracking loops and phase-locked loops in this article, and Luenberger observers in part III.

But first we need a moderately simple, but interesting, example...

Important Programming Concepts (Even on Embedded Systems) Part II: Immutability

Jason Sachs September 14, 2014

Other articles in this series:

This article will discuss immutability, and some of its variations in the topic of functional programming.

There are a whole series of benefits to using program variables that… well, that aren’t actually variable, but instead are immutable. The impact of...

Oscilloscope Dreams

Jason Sachs January 15, 20125 comments

My coworkers and I recently needed a new oscilloscope. I thought I would share some of the features I look for when purchasing one.

When I was in college in the early 1990's, our oscilloscopes looked like this:

Now the cathode ray tubes have almost all been replaced by digital storage scopes with color LCD screens, and they look like these:

Oscilloscopes are basically just fancy expensive boxes for graphing voltage vs. time. They span a wide range of features and prices:...

Lost Secrets of the H-Bridge, Part IV: DC Link Decoupling and Why Electrolytic Capacitors Are Not Enough

Jason Sachs April 29, 20147 comments

Those of you who read my earlier articles about H-bridges, and followed them closely, have noticed there's some unfinished business. Well, here it is. Just so you know, I've been nervous about writing the fourth (and hopefully final) part of this series for a while. Fourth installments after a hiatus can bring bad vibes. I mean, look what it did to George Lucas: now we have Star Wars Episode I: The Phantom Menace and

Byte and Switch (Part 2)

Jason Sachs May 7, 20116 comments

In part 1 we talked about the use of a MOSFET for a power switch. Here's a different circuit that also uses a MOSFET, this time as a switch for signals:

We have a thermistor Rth that is located somewhere in an assembly, that connects to a circuit board. This acts as a variable resistor that changes with temperature. If we use it in a voltage divider, the midpoint of the voltage divider has a voltage that depends on temperature. Resistors R3 and R4 form our reference resistance; when...

The CRC Wild Goose Chase: PPP Does What?!?!?!

Jason Sachs October 23, 20142 comments

I got a bad feeling yesterday when I had to include reference information about a 16-bit CRC in a serial protocol document I was writing. And I knew it wasn’t going to end well.

The last time I looked into CRC algorithms was about five years ago. And the time before that… sometime back in 2004 or 2005? It seems like it comes up periodically, like the seventeen-year locust or sunspots or El Niño,...

10 More (Obscure) Circuit Components You Should Know

Jason Sachs February 5, 20121 comment

The interest in my previous article on obscure but useful electronics parts, "10 Circuit Components You Should Know" was encouraging enough that I thought I would write a followup. So here are another 10:

1. "Ideal Diode" controllers

Load-sharing circuits use diodes tied together at their cathode terminal to take the most positive voltage among the sources and connect it to a load. Works great: you have a DC/DC power supply, a battery, and a solar cell, and it will use whichever output is...