Archive for the 'electronics' Category

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