It’s antenna time!

For years, I’ve been a ham without an antenna. My excuse, while I worked in academia, was that I could use the university club station any time, but in truth, I’ve always been the kind of ham who goes through more soldering iron tips than QSL cards. That said, since I’m building a radio, I need an antenna!

As I’m sure you know, a bewildering variety of antenna designs are available. I lusted after a GAP vertical for a while, then over an S9. On a small city lot with inconveniently-placed power lines, there wasn’t much else that would fit. Eventually, though, and with some encouragement from my dear wife who didn’t see the appeal of spending hundreds of dollars on an antenna, I chose a wire vertical. The whole thing, except for the window bulkhead and the rope, came from junkbox parts.

The wire is suspended from the side of the house by a rope poking through a gable vent. The antenna is about 7.5 meters long because that’s how high the vent it, but that should be a decent compromise length for 40, 30, and 20 meters.  The wire lands right at the property line, a few feet from a convenient basement window. I replaced the screen in the window with some polystyrene sheet, in which I cut a hole for a BNC bulkhead feedthrough.

I added a few radials to the bottom of the antenna, and I was in business. (I did learn, as have thousands of hams before me, that cheap soldering irons don’t work well in windy, cold weather.)

Then it was time to hook up a radio. I went for my 40m Sudden receiver first. It’s a simple direct conversion rig with an NE602 as oscillator and mixer and an LM386 as audio amplifier. I plugged it in and quickly found an AM broadcast station, which turned out to be Radio Croatia. That got me an idea of which way to tune to find the ham band. The first station I heard was N6KI, who was running a frequency for the California QSO party.

I was hoping to get down to 7.038 MHz and tune in some PSK31, but for some reason the Sudden didn’t want to tune below the phone band. That’s odd, because when I first plugged it in, I heard a wall of “CQ SS CQ SS” crashing in on multiple frequencies. Yes, I happened to build the on Sweepstakes weekend! I had plenty of stations to listen to.

I got out my NorCal 40A, but alas, the power cord somehow was packed separately from the rig and I had no easy way to power it up. It was the same story for my 30m rig. Maybe this is a sign that I should convert to Anderson Powerpoles.

Anyway, it’s not a great antenna, but it will be enough to get started and make some QSOs. Best of all, it’s mine!

Now, if only I could remember what box I packed that power cord in…

Comments always welcome!

(Credit to Dan Tayloe N7VE for coining the line about soldering iron tips and QSL cards.)

Cool open source hardware demos from OHS 2011

The Open Hardware Summit closed with an evening reception, with hors d’oeuvres tables tucked in amidst dozens of demos strewn around a large room at NYSCI. From an Ethernet-connected Arduino to a visual musical instrument, here are a few that caught my eye.

First up was the Nanode from Wicked Device. This board is an Arduino clone with built-in Ethernet. It would make a great platform for any control tasks that needed to interact with other Internet-enabled devices.

Nanode PCB Nanode concept slide

Right around the corner, an RC car was racing around the floor under the control of a subtly gesturing Jeremy Blum and his SudoGlove.

Jeremy Blum's SudoGlove SudoGlove explanatory slide

This curious device is titled “EaTheremin”. The forks had circuitry concealed inside the conductive handles. When one ate with them, current flowed from tines to handle via the diner’s body, causing a variable pitch to be emitted by a nearby speaker. I have to admit that I don’t quite get it, but I can appreciate the creativity of the EaTheremin’s inventor.

EaTheremin

LittleBits had a table with their long-awaited magnetic circuit construction toy. The idea is to connect a series of small circuit boards to build interesting circuits. The boards hold themselves together with magnets, and keying in the plastic fittings at each end mean that incompatible components cannot connect to each other.  LittleBits founder Ayah Bdeir is one of the OHS organizers.

littleBits boards littleBits in use

The Learning Pet is a cute robot that augments educational games for children, developed by Erin Kennedy, better known as robotgrrl. The Pet can pivot, flap its wings, and change its expression in synchrony with events in a computer game.

Finally, Ryan Raffa’s RhythmSynthesis musical instrument was always surrounded by a crowd. By placing colored geometric shapes on the lightbox, one can compose repeating rhythm tracks. The color of each shape sets the pitch, the area selects the octave, and the outline, position, and possibly the rotation of the shape change other aspects of the sound. The sounds from each shape are played as if by an old-fashioned radar beam sweeping out a circle under the light table. Ryan developed RhythmSynthesis for his MFA in Design Technology, so plenty of details are in his thesis paper.

OHS attendees enjoying RhythmSynthesis Ryan Raffa demonstrating RhythmSynthesis

Here is a video of RhythmSynthesis in action, from the RhythmSynthesis web site:

These are but a few of the many tables at the reception, all with abundant creativity.

Open Hardware Summit 2011

Last week I took a trip to New York to attend the Open Hardware Summit. The talks were outstanding, and it was great to be in a crowd of extraordinarily creative people. While the open hardware world has its share of engineers, both amateur and professional, it also has artists, which makes for some interesting fusion.

Furthermore, the presentation skills of the speakers ranged from good to outstanding. It was a pleasant shock to watch one excellent talk after another. I must have been lulled into complacency by having seen too many boring talks at scientific conferences.

The Summit was held at the New York Hall of Science, which two days later hosted Maker Faire. As I walked down the street from the train station to the museum, I knew I was getting close when I saw these over the trees. That’s a Mercury and a Gemini capsule perched high on their boosters.

Rockets at the New York Hall of Science

Why the Hall of Science, one might ask? Eric Siegel, the Director and Chief Content Officer, welcomed us to the conference by explaining that NYSCI is about getting people interested in science, and he sees the open hardware movement as doing the same.

The keynote talk was from 4/5 of the Arduino team, who were entertaining and engaging speakers. A few memorable quips:

  • (When starting an open hardware business) “Hire a lawyer. You don’t know why but she does.”
  • “If you have a company with 5 people in 3 countries, you are a multinational corporation.”
  • (On the popularity of names ending in -duino) “We named the Arduino after our favorite bar. … The worst one was one morning when I found in my e-mail an announcement of a board called “Sanguino”. If you get the accents right, in Italian, that means ‘I am bleeding’.”

Bunnie Huang (of Chumby fame) gave a great talk on the end of Moore’s Law and what he sees as the future of open hardware. Moore’s law drives a very short market cycle for new designs, which means that by the time an individual hacker can build something interesting, it has been obsoleted by products from big corporations. In places like Shenzhen, though, the use of trailing-edge technology means small shops can innovate and still be competitive. Once Moore’s law runs into fundamental physical limits, Bunnie believes market cycles will slow and small innovators participating in the open hardware world will be able to compete more and more effectively with the big guys.

Bunnie was the first presenter to use his own hardware on stage.  He funneled his presentation through NeTV, an HDCP video overlay board. Bunnie had it set up so that people in the audience could text or tweet messages, in real time, to a scrolling banner at the top of his slides.

At lunch, OpenROV‘s Eric Stackpole and David Lang took up a strategic position next to the catering line with some of their underwater robots.

Open-source underwater robots

After lunch were more great talks. Surprising to me was the talk by Bruce Perens, the founder of the Open Source Initiative and one of the key players in the emergence of the widely-used open source software licenses used today. I thought he would have something to say about hardware licensing, but instead he talked about the ham radio satellites and what AMSAT and TAPR have done to develop and release open-source hardware designs.

James Bowman followed up with a great talk about the Gameduino, a board that can be used to play video games with an Arduino or other small microcontroller. His talk was about the development of Gameduino, which went from Kickstarter to a shipping product in three months. More than demonstrate his product, James used it as the sole device for presenting all of his slides. Here’s a Gameduino, as seen on a Gameduino:

The Gameduino uses James’s impressive J1 Forth CPU as part of its hardware. The J1 is on my list of things to try out.

Bryan Newbold gave an insightful talk about the economics of small-quantity price breaks. Being at Octopart, Bryan has access to a massive component price database, which he used to illustrate a number of points about small-run manufacturing, as is typical for an open source hardware startup. One of his most striking slides was this, which illustrates the effects of the hidden costs of various funding sources. In order to get the same cost per unit if selling 175 units with cash funding, a startup might have to sell 5000 units with Kickstarter funding. That’s a sizeable difference, and it’s caused by the interaction of quantity price breaks with the direct and indirect costs of various sources of funding.

Chart

Mitch Altman brought the plenary session to a close with a talk about his experiences turning the TV-B-Gone into a product. Mitch is an outstanding and entertaining speaker. One of his gems: “Hi, I’m Mitch Altman. I turn off TV’s for a living, and I LOVE MY JOB.”

The day finished with cocktails and demos from dozens of hackers and makers. I’ll have more on the creative things I saw there in my next post.

Want to share your thoughts about open source hardware? Were you at OHS? Comments are welcome!

Choosing a high-performance audio ADC

As I discussed two weeks ago, it is time to refocus my efforts on the DSP-based ham radio project that started this blog. Let’s take a look at the architecture I had in mind originally:

Block diagram of a near-zero IF receiver with I and Q paths

This is a popular topology for radios that put their intermediate frequency at or near 0 Hz. It is also very similar to the most popular ham software-defined radio topology. In fact, those ham SDRs simply substitute a PC sound card for the ADC and the PC’s CPU for the FPGA. Here, though, I don’t want to bring a PC into the picture yet. Radios that require a PC don’t feel like “real radios” to me. I want to end up with a self-contained box, though I won’t mind if it optionally integrates with a PC.

For simplicity, I want to implement the receiver’s automatic gain control (AGC) functional digitally, after the ADCs. This means that with a well-designed front end, the ADC dynamic range will become the radio’s dynamic range.

With that in mind, I went looking for the best dynamic range audio ADC I could find, or at least the best one I could afford. I have identified seven manufacturers of 24-bit audio ADCs. Here is the best that they have:

Part SNR, A-weighted THD+N Package Price
TI PCM4222 123 dB -108 dB TQFP-48 $29.99 D*
TI PCM4220 123 dB -108 dB TQFP-48 $19.10 M
AKM AK5388 123 dB (Note 1) -110 dB LQFP-44 $10.93 D
AKM AK5394A 123 dB -110 dB SOP-28 $22.00 D
Cirrus CS5381 120 dB -110 dB SOIC-24, TSSOP-24 $32.22 D/M
Wolfson WM8786 111 dB -102 dB SSOP-20 $3.48 M
ADI AD1974 105 dB -96 dB LQFP-48 $10.03 D
NXP UDA1361 100 dB -88 dB SSOP-16 $1.37 M
Notes: 

Figures are typical values as shown in the manufacturer’s data sheet. All are for two channels active and 24-bit PCM output. Prices are quantity 1 from the cheaper of Digi-Key or Mouser.

1. The AK5388 is a four-channel ADC with 120 dB SNR. The 123 dB SNR requires the use of “mono mode”, which connects each stereo pair in parallel with a single input, effectively creating a two-channel ADC with 3 dB better SNR.

* Non-stock item, but a limited number of units are currently in stock.

The AK5388 looks like the price/performance winner, at $10.93 for 123 dB SNR and the best THD+N. One catch is figuring out the mono mode, which didn’t have crystal-clear documentation in the data sheet. On the other hand, even in four-channel mode it has 120 dB SNR, which still puts it at an excellent price/performance point.

Lurking in the SNR specification is A-weighting, which is a specification used for audio that isn’t much seen in the measurement world. The idea behind A-weighting is to reflect the human ear’s varying perception of noise at different frequencies by doing a weighted sum of the noise in the SNR measurement. Thus, frequencies where noise is more audible count worse than frequencies where it isn’t. A-weighting is not quite the right measurement for a near-zero IF ADC, first because a communications receiver’s bandwidth is quite a bit smaller than the 20 kHz used for the A-weighted measurement, and second because the communications signal being digitized is not necessarily at its final audible frequency yet.

I used A-weighting for the comparison because all of the ADCs were specified that way. Some of them also had an SNR in 20 kHz bandwidth specification, which does not weight the noise spectrum. For those ADCs, the 20 kHz SNR was 3 dB lower than the A-weighted SNR. , I decided to compare the A-weighted SNR to put the ADCs on equal ground, even though the 20 kHz bandwidth SNR is closer to what I would like to know for a communications receiver.

It’s worth mentioning that I looked at precision ADCs as well. I couldn’t find any 24-bit precision ADCs from Analog Devices or Linear Technologies that had a high-enough sample rate to be usable. In contrast, TI offers the single-channel ADS1281 and ADS1282, which offer a stunning 130 dB SNR (unweighted) at 250 samples per second. These might be reasonable for a Morse code receiver with a 100 Hz passband. When used for sideband, these ADCs would have to be operated in their 4000 SPS mode, at which their SNR drops to 118 dB. When one considers that filtering the output of the audio ADCs down to 100 Hz would provide an extra 6+ dB of SNR (because less bandwidth means less noise power), the ADS1281/1282 no longer has such an advantage. Worse, a pair of ADS1281 (two are needed because they are single-channel) will set you back $108 at Digi-Key.

In the end, I’ve found a combination of excellent performance and a good price. The AK5388 it is. The next step is to build or buy a board for it so I can start experimenting.

QST performance measurements side-by-side in a table

PA1HR's QST review measurements tableHans Remeeus PA1HR has compiled QST‘s performance measurements for dozens of recent rigs into a single, easy-to-read table. It’s perfect for anyone shopping for a new rig. It’s also great for numerically inclined homebrewers. I have been wishing for something like this so I have an idea of what kind of goals to set for a design. Have a look!

(via Hans Brakob K0HB and the Twin Cities DX Association e-mail list)

Humbled by a sine wave oscillator

The old saw goes, “oscillators don’t, amplifiers do”, but that’s an analog saying.  It doesn’t apply to the digital world.  After all, digital is easy, while analog is hard, right?  (Be careful not to answer too quickly!)

For the last few weeks, I’ve spent my tinkering time on adding sine wave sidetone to the Verilog iambic keyer. As you may recall, sidetone is audio feedback for the keying, in other words, audible Morse code.  My thinking was that while this would appear to be a side trip on the way to FPGA-DSP radio nirvana, it would actually be valuable.  My vision for the radio will require sine wave synthesis in a couple of places.  Also, to have sine wave sidetone, I will need a digital-to-analog converter (DAC), so why not put theory into practice and build a delta-sigma DAC?

I looked around a bit to find a good way to synthesize a sine wave.  I didn’t want to do a simple ROM lookup table, because the radio will need memories for storing filter data and coefficients.  Instead, I settled on an algorithm that uses two integrators and a multiplier.  For some ratios of clock to output frequencies, the multiplication by -m can be reduced to a simple right-shift, which is always appealing to a hardware designer because it can be implemented without any gates.  The negation can then be absorbed into the first adder, costing little more than a set of inverters and a carry input.

Two-integrator sine wave oscillator

Then I found this elegant topology in Delta-Sigma Modulators: Modelling, Design, and Applications, by Bourdopoulos et al:

Digital sine wave oscillator with delta-sigma feedback

In this design, the multiplier has been replaced by a delta-sigma modulator and two constants.  This is gorgeous!  First of all, the multiplier is gone, replaced by a few adders and a mux.  Secondly, the delta-sigma bitstream is a built-in output for a DAC. There are a couple of wrinkles. First of all, there needs to be a scaling by 2^{-b} before and 2^b after the delta-sigma modulator. Otherwise, the modulator will see signals outside of its stable range. (Stability is a topic for a future tutorial in the How Delta-Sigma Works series.) Second, I’m not sure about putting the delay of the delta-sigma converter into the loop. It seems to me that the two integrators should be non-delaying. Third, are the two integrators sufficient filtering to remove the delta-sigma’s high-frequency noise, or is there a risk of high-frequency feedback making the loop unstable?

It sounds great, but when I coded it up in Verilog I couldn’t get it to be stable.  I fiddled with constants and bit widths for a while and couldn’t get it going. I also tried two non-delaying integrators in the loop. That didn’t work, either, and I couldn’t figure out why. Rather than do any stability analysis or model it in Octave, I decided to cut my losses and go to a more direct approach.

I took the original sine wave oscillator topology, which I easily got working, and tacked on a delta-sigma modulator to the output.  I decided to increase the clock rate in order to get a better signal-to-noise ratio (SNR) out of the DAC.  The oscillator blew up – unstable again!  After some more fiddling, I realized I was going to have to run with 24 or more bits of precision if I stuck to the design in the first figure.  To reduce the precision I needed to carry, I instead split the scaling between both integrators:

Sine wave oscillator followed by delta-sigma DAC

I fiddled with fewer bits, but with the clock-to-output frequency ratio I was working with (1 MHz clock, 800 Hz output), I needed all 16 bits to see a pretty sine wave in the ModelSim waveform viewer.

It looked great in the waveform viewer, so I burned it onto the FPGA and… noise. There is a brief tone buried in the noise, then it turns to all noise, and a little later, to a high-pitched whine without noise. The sine wave buried in the noise might mean I need better filtering between the FPGA and the audio amp (I didn’t use any, relying solely on the audio amp’s rolloff), but the all-noise and whining stages tell me that the oscillator or modulator is unstable. I probably didn’t run the testbench long enough in simulation to see it.

Meanwhile, at work, I’ve been having a great time introducing Test-Driven Development (TDD) into our firmware development process. The process was tedious at first, but now that I’ve been doing it long enough to see the results, I love it!  My code is better organized, better tested, and more solid than ever before.

That, combined with my frustration with the sine wave project, led me to think about applying Agile software engineering techniques to Verilog development.  I did some Google searches to see if anyone else is applying TDD or full Agile to hardware.  They are!  (agilesoc.com: Why Agile is a good fit for FPGA and ASIC development)

I learned some technical things while working on the sidetone. More importantly, though, I was reminded that methodical, well-tested development is not only better than seat-of-the-pants hacking, it is faster as well. Hobby projects benefit from discipline just as much as professional ones. I am going to set aside the sidetone project for a while and look at some other things.  Meanwhile I am going to think a bit about how to apply TDD and some other Agile concepts to my humble basement tinkering.

Soldering is Easy comic book is now in 12 languages

Soldering Is Easy cover, English versionThe Soldering is Easy one-page comic has grown to an eight-page comic book, and it’s available in 12 languages! Mitch Altman, Andie Nordgren, and Jeff Keyzer created the original, and the translations were done by volunteer translators. It’s a great idea and well worth a read.

Here is every translation so far, all from Jeff’s MightyOhm blog:

Soldering is Easy (English)

ПАЯТЬ ПРОСТО (Russian)

Soldering is Easy (Simplified Chinese)

Solder É Fácil (Portuguese)

Menyolder Itu Gampang (Indonesian)

Soldar es Fácil! (Spanish)

… — .-.. -.. . .-. .. -. –. .. … . .- … -.– (Morse code)

Soldering is Easy (Japanese)

Οδηγός Για Εύκολη Συγκόλληση (Greek)

Löten ist einfach (German)

Souder c’est Facile (French)

Soldering is Easy – Traditional Chinese

Lutowanie Jest Proste (Soldering is Easy – Polish Translation)

Thanks, Mitch, Andie, Jeff, and translators for your great work!