Archive for the 'electronics' Category

Tuesday, February 26th, 2019

New maker project — retro name badge

If you played pinball in the 80s, you know about 16-segment LED displays. They existed in the narrow technology window after mechanical switches and alarm-clock-style 7-segment displays, but before full dot-matrix displays or full video were feasible with off-the-shelf computer hardware. There’s something geekily charming about these old displays.

16 segments allow all alphabetic characters to be rendered…for the most part.

So naturally, I wanted to have a name badge made from these for FOGcon, which was 8 weeks away when I started this project. I would, in 8 weeks, conceive, design, construct, and debug a name badge based on this technology. With a professional printed circuit board. And a custom-programmed 32-bit microcontroller. All powered by a USB power bank.

You can find all kinds of electronic gadgets on Indiegogo and Tindie, but these pitches are always shown in the rosiest light. Seldom do you get a real-time view into a project, including all the little missteps and backtracks that are part of any maker project. Well, watch on.

Check out these videos for progress, starting with the schematic, revising it, creating a printed circuit board in KiCad, and revising it, then sending it off to get created, writing the code, and final assembly and debugging. Fun!

Part 1:
Part 2:
Part 3:
Part 4:
Part 5:

All the parts in a playlist

Since I ordered the PCB in a 10-pack, there are going to be extras to give away to Patreon and YouTube subscribers.

Please subscribe to my channel for the latest progress! -m

Monday, June 11th, 2018

Measuring high voltage the easy and fun way

I picked this up from The Plasma Channel on YouTube (which is worth more than a look)

How to Measure High Voltage with Spheres

A (somewhat) standardized way to measure high voltages is to see how big an arc can be established between two one-inch conductive spheres. The roundness of the spheres normalizes against surface effects that are present in pointier objects.

I grabbed some 1-inch chrome steel bearing balls. Perfect.

Now, how to connect them? It turns out, it is possible to solder copper and stainless steel. Here’s how.

I had some beefy 4 ga. copper ring terminals around from another project. And I had just picked up a Bernzomatic plumbing torch that comes with silver-bearing solder and flux.

  1. Don’t use the sliver-bearing solder. Nobody’s going to eat off this, so go ahead and use regular leaded solder, which is much easier to work with.
  2. Coat at least half the bearing ball with blue-tack. This will help keep it in place, as well as preserve the metal finish.
  3. Using a regular soldering iron, melt a good amount of solder on to the copper terminal. Arrange for it to be upside down, so the bulk of the solder collects on the part that will be in contact with the ball.
  4. Using gritty sandpaper, sand a rough patch on the steel ball. This will remove the invisible outer layer of oxidation.
  5. Immediately apply a dollop of plumbing flux on the sanded steel. For good measure, I used a few drops of really strong acid flux, but this might not be necessary.
  6. Holding the copper terminal in a long-nose pliers and pressing it against the fluxed steel, fire up the torch and gently go over the contact area until the solder melts and adheres.
  7. Let it air cool for some time, then run it under water to wash away any remaining flux or acid.

Voila. Make a second one of these, then stand them up near a plastic ruler, and let the arcs fly.


Sunday, December 10th, 2017

Power Supply build: part 2: component selection

In the previous posting, I went over requirements for a DIY power supply build. Now on to the fun part–shopping!


I wanted something fairly compact, but still nice looking. I ended up going with Jameco ABS Heavy-Duty Instrument Case. It’s a good quality build. In metric, it’s 200mm across, and 64mm tall, which is just about right. I wasn’t looking forward to hand drilling, and worse, cutting rectangular holes in those end-plates though. We’ll come back to that.

This case has a really unusual pattern of mounting holes in the bottom surface. I’m sure there’s ready-made circuit boards that would fit that spacing, but I wasn’t planning on wiring this whole thing up at the component level. So we’ll have to stick a pin in this part too, and revisit later.

AC to DC

I originally sought to get a single board that took 120volts AC in, and came with dual, indepenent outputs. Without reading too closely, I picked up from Jameco a Mean Well “dual” output board. It looks like it was designed to provide both a DC output, as well as a battery charger output. After it arrived, a bit of inspection showed that the two outputs were not independent at all. Trying to (for example) connect them in series would create a short. So for my purposes, I had a high-quality single-ended supply only.

One down, one to go.

It would have been natural to pick up a second identical Mean Well board. But thinking about the requirements, I saw an opportunity to try out something else. The maximum current on the Mean Well was around 3 amps. Perhaps I could do better, at least on one channel? Who knows when I’ll be trying some crazy electroplating experiment and need it. So after more shopping, I settled on the GEREE AC to DC Converter 85 ~ 265v AC to DC 12V 8A Adapter/Industrial Module Switching Power Supply by way of Amazon. This baby can put out up to 8 amps.


These things come from many different overseas manufactuers, under a variety of names, but they all look like this: 5A Constant Adjustable LED Dual Display Amp/Volt. They are actually two boards stacked togetehr with conductive risers. The bottom board is a constant current/constant voltage buck regulator, so it can produce an output anywhere from a bit less than the input, down to a few hundred millivolts. Great. Allegedly, they can handle up to 5 amps. I have my doubts, but we’ll see. (And if I blow one up, it’s easy to replace. Hooray for DIY!)

The top board is a voltage and current display. I started out with grand ideas of replacing the LED displays with larger seven-segment modules, but that quickly got complicated. At least I got a chance to learn how to lay out circuit boards in KiCAD.


OK, spoiler alert. I ended up using separate voltmeter/ammeter modules, like these:DROK Digital Current Tester Multimeter DC 100V Volt 2A Ampere Battery Monitor Gauge 2in1 Red/Blue 2-color LED Display Car Automotive 12V 24V Built-in Shunt. So much for the larger LED display. These are only 0.28 inches, but it’ll have to do. And I like that the LEDs are different colors for voltage vs. current.

So there’s the major pieces. But there remains the significant job of hooking everything together professionally, safely, and upgradibly (if that’s a word). How things connect together is make-or-break on projects like this. Let’s spend some time going over connectors in the next installment.

Monday, November 13th, 2017

Power Supply build Part 1: requirements

Building a power supply is a rite of passage for electronics experimenters. I grew up in an age where all power supplies, even “wall warts,” had heavy iron transformers. In the last decade or two, better power transistors have become available, making possible switching power supplies, which are much lighter. (Think of your laptop power converter, or one of those tiny USB power adapters.)

So, there’s more than a bit of nostalgia in play here. I can build something better than what I’ve gazed at longingly during my school years. It’s also a good example of an end-to-end design process, and a time to reflect on how far along technology–and my life–have progressed.

Every project starts with requirements:

1) I want dual, independent supplies. I like to play around with op-amp circuits, many of which require separate positive and negative power lines.

2) A reasonable maximum current, but with adjustable current limiting and short-circuit protection.

3) Fine adjustment. I want to dial in exact voltages and currents, down to the hundredth of a volt or amp.

4) Digital display. Analog meters look cool, but I want the precision of digital.

5) Prominent earth ground connectors up front. When building radio circuits, you often need an earth ground connection handy. And many components are static-sensitive and require protective equipment, which includes a path to ground to dissipate any charges.

6) Repairability: My prior supply was a (single-ended) cheapo box from Fry’s. One day, it started spewing smoke every time I powered it on. I didn’t get very far in troubleshooting what went wrong. I want something made out of cleanly-separated components, which I’ve hand-picked. I want to be able to upgrade or repair anything, as I wish.

Just satisfying 1-5 would put things in the $4-to-$500 range. And the last requirement can only be met by building something yourself. Add to that the satisfaction of using a tool you designed and built with your own hands. The answer is clear. We’re going to build this thing.

Up next: component selection.

Saturday, March 25th, 2017

Build an electronics lab for under $200

Modern technology has exceeded my wildest dreams as a teenager struggling to build an electronics lab. With an order, one can have an entire electronics lab for next to nothing.

As a teen, I paid a guy $100 for a used oscilloscope that took two adults to lift. These days, you can get a solid state one for under forty bucks. And the component tester listed below is cooler than anything I could have conceived.

So if you want to get started in electronics from scratch, here’s what I’d recommend to get started. I’m not saying this is the best way to go. A single Fluke meter would cost more than $200 but provide a lifetime of quality service. This is aimed at folks getting started on a shoestring budget.

Prices are rounded off and subject to change.

Workbench $0. You’ve already got a desk, kitchen table or something. Start there.

Lighting $8. I grabbed these LED strips and plugged them into a 12 volt power brick I had laying around. 16.4 foot LED flexible strip

Multimeter $18. This isn’t the greatest, but it gets the job done. Even includes a frequency meter! Tacklife DM02A

Soldering station $22. This is the model I’ve used for years. Works great. Stahl SSVT Soldering Station

Solder ($5). 63/37

Flux ($8). It took me far too long to realize how useful flux is in getting solder to flow onto a connection. If you shop around, be sure NOT to get anything acidic. Flux pen

Component tester $12. This completely blows my mind. Plug in nearly any component, push the button, and get a read of the pinout and operating specs. A good project might be mounting this in a nice case. Mega328 component tester

Oscilloscope $23. Not the greatest bandwidth, but for poking around in Arduino circuits and leaning it’s great. DSO 138 TFT scope

Signal generator $17. Once you start testing circuits, you’ll need to inject signals. This little generator is a good start. XR2206 Signal Generator

Power Supply $31. It’s a rite of passage for electronic experimenters to build their own power supply. A good start might be with an ATX computer supply ($21) which you can hook up to an external current limiting regulator ($7). Another good project is to replace the tiny trimmer controls on this unit with multi-turn potentiometers (2 for $3).

Grab bag of parts $20. Go to Jameco for this one. Sorting through the grab bag is a different experience every time, and an educational experience in itself. Component grab bag (but collecting and dismantling old devices will be your primary source)

Wire strippers $5. Over time you’ll want to try several and see what works for you. But this is a good start. CP-301G

Diagonal cutter $6. CHP-170

Screwdrivers $12. This kit works with lots of unusual screws that you’ll encounter in iPhones and so on. And it includes tweezers and spudger tools to get into modern devices. Pro bit driver kit

Breadboard & wires $18. This set includes lots of components that will be helpful to get you started, including a bare-bones USB power supply. Electronics Fun Kit

So this adds up to a bit over $200, but this (plus a few trips to the library) would be a great start for someone getting started in electronics. Check out the EEVblog which has a huge wealth of informational videos.

Let me know what you think!


Thursday, January 12th, 2017

LED cube: The Ultimate Assembly Guide

Here’s the manual I wish had been included with the 8x8x8 LED cube kit I picked up on Amazon. Technically there’s already a manual available if you know where to look, but it’s poorly translated and difficult to follow in places. There’s several very similar kits out there, but the LED assembly process is the same, as far as I can tell.


I will skip over the details of soldering the board itself. There’s nothing new or particularly difficult about getting all the components on the board. (email me if you’d like to see more in this section.)

The LED grid, though is another matter.

How everything connects

We’re talking about LEDs. The D stands for diode, which means that they only conduct electricity (and hence light up) in one direction. If you look at a factory fresh LED, one lead will be a bit longer than the other. This is the positive (+) or anode lead. The other is the negative (-) or cathode lead. The anode needs to be connected to a more positive voltage than the cathode, by about 3 volts, in order to light up. (How do you remember which one is the longer lead? Easy. A + sign, if taken apart and put back together end-to-end would be a bit longer than just a – sign. So the longer lead is the + lead.)

Imagine a grid of LEDs, say 4×4. You could address any individual LED with only 8 wires, 4 rows and 4 columns. (Schemes with even fewer wires are possible, but this is as dead simple as it gets.) For example, each row could have all 4 cathode leads connected, and each column all 4 anodes. It’s a little more complicated in three dimensions, effectively a 8×64 grid, but the basic principle is the same.

Assembling the grid

We’re definitely going to need a jig to hold each layer in place while we solder the LEDs. The instructions recommend using cardboard or possibly punchboard for this. There might even be some exactly fitting the needed dimensions, which for my kit were an exact 1cm spacing with 3mm holes for the LED. Imagining the horror that would ensue if I tried to hand-drill 64 accurate holes, I ended up 3D printing a jig, based on this design from Thingiverse. Since I don’t have a 3D printer, I used 3Dhubs to find someone nearby print it for me. It worked great, and it’s very precise.

With your jig ready, the next (and possibly most important) part is at hand: the bend. You need to bend evach LED’s leads in just the right way, so that once situated in the jig, the leads will be overlapping their neighbors. Take this part slow and get it exactly right.

Bending. So much bending.

The bend is one of the most critical parts of a quality assembly. You’re going to do this 512 times, so take your time and get things exactly right. In short, you need to do this:

Click to zoom. In all three cases, the longer anode lead is on the right.

In the middle LED, the anode lead is bent at a crisp 90 degree angle, pointing right into the camera. The bend is close to the LED body, only the width of the needle node pliers seen at the bottom. (I don’t like to make the bend flush against the plastic case, because that makes it too easy to damage the LED.)

On the right, the cathode is bent 90 degrees pointing left, but the bend is farther up the wire. There’s a little crimp mark on the lead that I use as a guideline. If you looked at it from a top down view, it would make a perfect L shape. Since the bends are at different distances from the LED body, this will allow the anode and cathode grids to cross over without touching. (Which would short out the display.)

Make sure all the bends are crisp and exactly right angles, including from the top-down view. This will make the next step easier.

Soldering. So much soldering.

Starting from the bottom-right of your jig, place the first LED so that the leads are sticking out post both sides of the corner. Continue placing LEDs up the entire column. The anode wires should loosely overlap. If you haven’t already checked your LEDs, right now would be an excellent time to do so. (In my kit, if found one dead LED, and one shorted one, which would have caused havoc for the whole display.)

Here’s the trick to soldering quickly. In normal situations, making a good solder joint would involve heating the entire connector, while feeding in a bit of fresh rosin core solder. This is how it’s normally done, but in this case, you’re probably going to need one extra hand free to hold the wires in place. And we need to work extra quickly to not fry our LEDs.

So solder this way: with the wires snug up against each other for the entire length of their overlap (tweezer-assisted as needed) use a toothpick to apply a very small amount of flux to the junction between the two wires. We’re talking less than the volume of a sesame seed here.

Look at the image above. The layer of flux is there, but so thin you might’ve missed it without looking closely.

Wipe off the tip of your soldering iron so it’s clean and shiny. Melt a small blob of solder on the tip, and briefly press it to the fluxed, overlapping wires. The flux will make the solder wick between the wires, nearly instantaneously. PROTIP: you should be able to do this so quickly that even if you’re steadying the wire with your bare finger, a few centimeters away, you don’t get burned.

Remove heat and make sure everything stays absolutely still until the solder hardens. It should look like this, with the first column soldered, and the second column placed but not yet soldered:

Continue on with the rest of the columns. Once you’ve finished all eight, congratulations. You’ve finished the first layer. Now do seven more layers.

Final assembly

Recall that electrically, the 8x8x8 grid is really more like a 64×8 array. On the board you’ll see the 8×8 grid, plus 8 more connectors close by. These extra eight are the return wires. We’ll call that side of the cube the front.

Carefully position one of your layers with anodes facing downward, and cathodes facing the front. Use your needle-nose pliers to slide all eight wires all the way into the connector. This will be frustrating. You’ll get all the way to the end and find one wire that didn’t go in. When you try to back things out a bit, several more wires will pop out, etc. Keep working on it until you have one layer fully connected on the bottom. Now–and this is important–test to make sure everything’s connected properly.

If you apply power without the return wires, nothing should light up. (After all, all those LEDs are so far only connected on one end.) If something does light up, that means you have a defective LED in that layer, and it’s leaking current in the reverse direction. If this happens to you, pull that layer off and replace the bad LED–generally the one that didn’t light up.

Connect a wire from one of the return terminals into any one of the front connectors, and power up your unit. Depending on the exact sequences it’s running through, at some point you should see some LED action.

Photo: It’s alive! Click to zoom.

Be on the lookout for any LEDs that don’t seem to ever light up, and replace them as needed.

Bit in all 8 layers this ways so that all 64 wires on the bottom are fully seated. Nearly there!

You’ll still have 64 wires sticking out the front. What do we do with these? Each horizontal row of 8 wires needs to be connected together. Maybe you could bend the LED leads to do this, but it would be hard to make it look good. I ended up using some tinned uninsulated bus wire. The conventional soldering method works here. Once you have 8 horizontal wires (each connecting to one side of 64 separate LEDs), hook up the return wires. Each layer goes to one of remaining 8 return wire sockets. It’s a good idea to do this in a temporary fashion, with jumper wires, to make sure everything’s fine. When it is, solder away.

Congratulations, you’ve finished your LED cube, and constructed a project more complicated than 99.99% of people in the world. Enjoy!

Monday, January 2nd, 2017

Signal generator

Another blast from the past, from the same era. This was a general-purpose gadget: a 5V power supply, plus bouncelsss switch, plus a variable frequency TTL square wave generator. This was one of my experiments with making my own circuit boards, starting with copper cladded boards, drawing on the circuit paths with an inert ink, then etching the rest away in acid. Oh, and hand drilling tiny holes. Lots of tiny holes.

Look at all those scrounged parts! -m

Sunday, January 1st, 2017

Frequency Counter

A blast from the past! While going through old stuff, I found this device, which I designed and assembled maybe 25 years ago. I never used it. I think it didn’t work on the first try, and I got distracted by other shiny things. Story of my life. I thoughtfully left my future self a schematic diagram.

Click to embiggen.

I don’t recall getting this out of a magazine. I came up with the design on my own, though I wouldn’t be surprised if either of these specialized ICs have a usage note with a similar circuit. It’s a pretty straightforward design. There’s a simple power supply, a JFET op amp input stage, a seven decade LED driver, a timebase, and a good old 555 timer driving the multiplexing.

The construction of the circuit is nothing to be proud of. (notice no pictures here!) It nicely fits on one of those pre-made circuit boards the same size and shape as a wireless breadboard.

Any electronics folks care to comment on this design? I’m more than tempted to fire it up and see if I can get it working. -m

Update: the more I look, more more odd the 555 section seems. There are two pin 3s marked on the 7208. I’m pretty sure that’s not how MUX is supposed to work. Time to pore over some old data sheets…

Update2: I removed the 555 circuit, and instead fed the existing MUX signal from pin 12 of the 7207a to pin 19 (MUX1) of the 7208. And wouldn’t you know, the thing works. I now have a fully functioning frequency counter.


Thursday, June 16th, 2016

Antennas and photons

In the previous article I described how antennae work in terms of EM waves. But EM isn’t exactly a wave. Quantum aspects require modeling as particles. Photons. But I can’t really figure out how a photon traveling through space gets converted into an electron current in a wire. There are some cases where treating EM as waves really seems simpler.

But there are probably places where considering it as particles matters too. Like, maybe, the EM drive. Multiple independent tests have confirmed that this device, simply by bouncing microwaves around inside a specially-shaped resonator, produces thrust. Huh?

A new paper suggests a theoretical model where this doesn’t violate Newton’s 3rd law. But the explanation involves paired up out-of-phase photons. Are there existing technologies or experiments where this phenomonon takes place?

I wonder if it’s analogous in any way to how electrons pair up to manifest superconductivity… Would love to hear from the Physics crowd. Add your comment below.


Sunday, May 8th, 2016

The antenna project

A layman’s description of how antennas work, plus some related experiments. Physics is strange when you think about it.

I’ve been working with electronics since I was about five. (Not an exaggeration. I “fixed” one of my two-battery-requiring cars with one good battery and some wire.) I sailed through high school electronics, and went on to get professional training in the field. But I’m still pretty mystified by radio waves.

So here’s my set of experiments and a written journal of my learning process. I’m going to figure out Radio, RF, antennas, wave propagation, and be able to explain it to a beginner. My goal is to create a device that harvests ambient RF from the air and illuminates (possibly intermittently) an LED.

First off, DC circuits. Most people have seen something like this, or can figure it out just by looking. (Schematic diagrams courtesy of the iCircuit simulator on OS X)


Due to a chemical reaction, the nine volt battery produces a constant potential of 9 volts. The longer side in the diagram is the + terminal. The squiggly line is a resistor, a device that slows the flow of electricity. The arrow is a LED, a light emitting diode. In this configuration, it would light up, though not terribly brightly. In a circuit like this, the wires can be treated as if they have no resistance at all, because compared to anything else in the circuit, they effectively are zero resistance. So measuring the voltage, say at the top of the battery terminal, is within a rounding error of the measurement on the left-hand side of the resistor.

This circuit is static and simple. In particular, there’s no energy storage anywhere. Current is always proportional to voltage divided by resistance (Ohm’s Law). Compare with this circuit:


Same 9 volt supply and a limiting 1k resistor. But also two more branches on the right. The rightmost one is a capacitor. As the diagram indicates, it is essentially two metal plates separated by an insulator. This has the ability to store energy in the form an electric field. Notice that the voltmeter still reads the full 9 volts, even though the switch in the lower-left is open. The battery has been disconnected from the circuit, but it’s still live. (This, by the way, is why old CRT-style TV sets can be dangerous to poke around inside, even after they’re unplugged.)

As further evidence that energy is being stored, when the circuit is first turned on, the voltmeter doesn’t instantly snap up to 9 volts. It gradually builds up, because the capacitor is charging.

The other branch in the circuit is an inductor, or a a coil. This can store energy in the form of a magnetic field. (The 10 ohm resistor is to model the inevitable resistance in the windings of the coil. Without it, this simulator assumes a perfect conductor which throw things off a bit.)

What would happen if we closed the switch on the inductor circuit? Well, the energy from the capacitor would suddenly gush through the inductor, which stretch out a magnetic field around the coil, like a rubber band. Then the magnetic field would collapse, sending a new burst of energy into the capacitor, and so forth. Current will slosh back and forth in the circuit until the losses through the resistor diminish the impulse. The circuit would ring like a tuning fork, though with the values here, the frequency is only around 5 cycles per second.

Within the coils of the inductor, we can no longer assume that all voltages and currents will be equal, because it is interacting with the outside world through a magnetic field. Because there is more going on than simple DC, the simplifying assumption from the first circuit no longer holds. Voltage and current may not be directly proportional, because we have to account for stored energy.

So what in the world is a radio wave then? How is visible light, or an X-Ray, the same as an AM radio broadcast? We need more theory to get there.

Every wire that conducts electricity produces a magnetic field (and every moving magnetic field produces current in a conductor) like this:


(image: Wikimedia Commons)

If you put iron filings on paper, ran a wire through perpendicularly as shown here, and put a strong current through the wire, you’d get a nested donut pattern. (Incidentally, this is why inductors are coils. That shape makes all the magnetic donuts on every turn of the wire point the same way and sum together.) My electric toothbrush uses magnetic induction to charge. But this still isn’t a radio wave.

A closely related concept is an electric field. While the magnetic field is caused by current (flow), an electric field is caused by voltage (potential). Every charged particle exhibits a field like this:


(image: Wikimedia Commons)

When you combine an electric field with a magnetic field, amazing things can happen. Like in the circuit above where energy sloshed back and forth, electric and magnetic fields can support each other and propagate, that is, travel through space at the speed of light.

Probably the most straightforward math comes from a “dipole” antenna, which we can make by taking twin-lead wire and separating out the ends. This is most efficient when each end of the T is half a wavelength of the signal. (For example, the speed of light ~= 300M m/sec. So your 2.4Ghz wifi signal has a wavelength of ~ 300M / 2400M = 0.125 m, or a hair under 5 inches.)

If you drive this antenna at its resonant frequency, you could measure the current along various points of either side of the dipole, and you’d measure different values. This isn’t a simple DC circuit! It took me a while to figure out how to visualize this, but you need to start with the current. At the extreme end of the wires, the current will always be zero. Think of a long, arterial one-way street. At the very end, there will always be no traffic, but the farther you get toward the main road, the more traffic there will be coming and going. You can visualize it like this. The black represents the physical wires of the antenna, and blue is a graph of the current at a given point along the wire.

Remember that current flow means there’s a magnetic donut circling the wire, proportional in strength to the amount of current flow.

This flow means that electric charge will accumulate, being strongest at the very ends of the wires. Which in turn means there will be an electric field that looks very much like our diagram above.


The applied signal, being a sine wave, drops to zero a quarter of a cycle later, and these electric fields, supported by the donut magnetic fields, slosh back and detach from the wire to become closed loops in space, and then proceed to propagate. The cycle repeats, switching polarity each time.


The wikipedia page for dipole antenna has some animated gifs which may or  may not help you visualize this.

I welcome your feedback. Coming up next: some experiments. If you have suggestions, I’d love to hear them. -m