Archive for category Amateur Radio

Squidwrench Electronics Workshop: Session 3

Ex post facto notes from the third Squidwrench Electronics Workshop.

Exhibit various 50 Ω resistors, including my all-time favorite, a 600 W 3 GHz dummy load:

600 W Dummy Load Resistor

600 W Dummy Load Resistor

… down to a 1/8 Ω metal film resistor.

The dummy load’s N connector triggered a regrettable digression into RF, belatedly squelched because I wasn’t prepared to extemporize on AC concepts like reactance which we haven’t covered yet.

Discussion of resistor applications, power handling, power derating with temperature, etc:

Whiteboard - Session 3 - Resistor power derating

Whiteboard – Session 3 – Resistor power derating

Why you generally won’t find 50 Ω load resistors in Raspberry Pi circuits. Cartridge heaters for 3D printers, not aluminum power resistors, although everyone agrees they look great:

Power resistors on heat spreader

Power resistors on heat spreader

Discussion of voltage vs. current sources, why voltage sources want low internal resistances and current sources want high resistances. Bungled discussion of current sources by putting diodes in parallel; they should go in series to show how added voltage doesn’t change current (much!) in sources driven from higher voltages through higher resistances:

Whiteboard - Session 3 - Voltage vs Current Sources

Whiteboard – Session 3 – Voltage vs Current Sources

Use Siglent SDM3045X DMM in diode test mode to measure forward drop of power / signal / colored LEDs, discuss voltage variation with color / photon energy. Measure 1.000 mA test current for all forward voltages.

Compute series resistor (500 Ω) to convert adjustable power supply (the digital tattoo box, a lesson in itself) into reasonable current source; roughly 10 V → 20 mA. Find suitable resistor (560 Ω) in SqWr junk box parts assortment, digression into color band reading.

Wire circuit with meters to measure diode current (series!) and voltage (parallel!), measure same hulking power diode (after discovering insulating washers now in full effect) as before in 1 mA steps to 10 mA, then 15 and 20 mA, tabulate & plot results:

Whiteboard - Session 3 - Diode current vs forward drop

Whiteboard – Session 3 – Diode current vs forward drop

Discover warm resistor, compute power at 20 mA, introduce cautionary tales.

Lesson learned about never returning parts to inventory, with 560 Ω resistor appearing in diode drawer. Cautionary tales about having benchtop can of used parts as front-end cache for inventory backing store.

Another intense day of bench work!



Leave a comment

QRPme Pocket Pal II: RF Waveforms and Meter Test

The QRPme Pocket Pal II produces RF test signals in the 20 meter and 40 meter bands, both square-ish waves derived from its 14.31818 MHz oscillator-in-a-can:

QRPme 20 meter - clip leads

QRPme 20 meter – clip leads

That’s the 20 meter signal, seen through the twisted pair test lead with alligator clips clamped on the scope probe, thusly:

QRPme Pocket Pal II - clip leads to probe tip

QRPme Pocket Pal II – clip leads to probe tip

When you’re working with RF signals, the “ground” part of the probe circuit matters:

QRPme 20 meter - probe tip gnd

QRPme 20 meter – probe tip gnd

That’s with the probe and its short spring ground jammed directly into the header:

QRPme Pocket Pal II - probe tip gnd

QRPme Pocket Pal II – probe tip gnd

Well, in this case, signal quality doesn’t matter very much, as you’re using the Pocket Pal II at a hamfest (or your bench) to determine if an HF radio is completely dead.

Here’s the 40 meter output, with the J3 jumper in place and the probe jammed into the header:

QRPme 40 meter - J3 on - probe tip gnd

QRPme 40 meter – J3 on – probe tip gnd

Pulling the J3 jumper off doubles the test signal amplitude:

QRPme 40 meter - J3 off - probe tip gnd

QRPme 40 meter – J3 off – probe tip gnd

Nothing wrong with those signals! In a pinch, those edges probably produce harmonics up in the UHF bands.

For completeness, here’s the 250 μA DC output driving a contestant chosen from the Box o’ Meters:

QRPme Pocket Pal II - 250 uA meter test

QRPme Pocket Pal II – 250 uA meter test

Eyeballometrically, the meter wants to see 1 mA for full-scale deflection, which is the whole point of the tester.

Recommended, with some early notes.


1 Comment

QRPme Pocket Pal II

A QRPme Pocket Pal II could be a suitable project for a Squidwrench “advanced soldering” class:

QRPme Pocket Pal II - front

QRPme Pocket Pal II – front

Yes, it comes with a tin case:

QRPme Pocket Pal II - tin case

QRPme Pocket Pal II – tin case

You must fit your own insulating sheet under the PCB; polypropylene snipped from a retail package works fine.

It’s intended as a “mint tin sized tester for all kinds of hamfest goodies”, but it seems like a nice source of small currents, voltages, and signals suitable for stimulating all manner of circuitry one might encounter in later sessions of a beginning electronics class.

Before using it, of course, one must solder a handful of small through-hole parts into the PCB, a skill none of us were born with.

For completeness, the back side, hot from the soldering iron:

QRPme Pocket Pal II - rear

QRPme Pocket Pal II – rear

The kits (always buy two of anything like this) arrived minus a few parts, which I suspect was due to an avalanche of orders brought on by a favorable QST review. Fortunately, I (still) have a sufficient Heap o’ Parts to finish it off without resupply, although a hank of 9 V battery snaps will arrive in short order.


RF Controlled Area Warning

Spotted this at the top of a motel stairwell:

RF Controlled Area - roof access warning

RF Controlled Area – roof access warning

More detail:

RF Controlled Area - detail

RF Controlled Area – detail

The antennas face away from the hatch, so it’s not as if the RF would shear you off as you climbed through:

Hampton Inn - RF Controlled Area - cell sector antennas

Hampton Inn – RF Controlled Area – cell sector antennas

I wonder if the hatch atop Vassar Main sports a similar warning …


FM DDS: SPI Mock 3

Running some serial I/O in the background adds jitter to the timer interrupt pacing the ADC samples and as-yet-unwired DDS updates. For reference, an overview of the process showing the procession from the IRQ on the left to the SPI outputs near the middle and another IRQ on the far right:

DDS Mock - 0 VAC - SPI

DDS Mock – 0 VAC – SPI

Now, speed up the sweep and delay the trace by 25 μs to put the triggering pulse off-screen to the left and the second pulse at the center division:

ADC Sample IRQ jitter

ADC Sample IRQ jitter

The orange smear in the middle should be a tidy pulse, but it isn’t.

The  25 μs timer interrupt now has the highest priority on the front burner:

IntervalTimer AudioSampler;

... snippage ...

  if (!AudioSampler.begin(AudioSamplerIRQ, SamplePeriod)) {
    Serial.printf("Timer start failed\n");
    while (true) {

Although nothing can interrupt it, other code / handlers may disable interrupts around their own critical sections and delay the tick. If the triggering tick (the off-screen one starting the trace) is delayed, then the on-screen pulse will appear “too soon”, to the left of center. If the triggering tick is on time, but the on-screen pulse is delayed, it’ll appear “too late” on the right.

The blur is (roughly) symmetric around the center graticule line, so the handwaving seems about right.

In round numbers, the jitter moves the interrupt ±325 ns on either side of its nominal position, with most of the pulses within ±100 ns. I doubt the jitter distribution is Gaussian, but vigorous handwaving says the RMS jitter might amount to 75 ns.

At the 4 kHz audio band limit, a 75 ns sampling error a phase error of 0.1°, so the maximum amplitude jitter would be sin(0.1°) = 0.002 = -55 dB, which might suffice for amateur-radio audio.

I think, anyhow.


1 Comment

Monthly Science: As Seen On Radio

This showed up when I looked at our APRS tracks after a recent ride:

Balloon chase - KJ5HY-9

Balloon chase – KJ5HY-9

Poking around a bit showed the target:

Balloon chase - W2KGY-12

Balloon chase – W2KGY-12

Contrary to what I thought, it didn’t come up the Hudson River from West Point:

Balloon chase - W2KGY-12 track - 2018-04-21 to 2018-04-24

Balloon chase – W2KGY-12 track – 2018-04-21 to 2018-04-24

Knowledge of the Universal Law of the Conservation of Perversity informs you a balloon will never land in the middle of a putting green:

Balloon chase - W2KGY-12 landing site

Balloon chase – W2KGY-12 landing site

Apparently the launch is part of a regular class project at West Point. Good clean fun!


FM DDS: SPI Mock 2

Doing the DDS calculations in full-frontal double floating point turns out to be maybe fast enough:

DDS Mock - 0 VAC - SPI

DDS Mock – 0 VAC – SPI

I set the ADC to HIGH_SPEED conversion and sampling, reducing the time between the start of conversion (first pulse in D1) and the ADC end-of-conversion interrupt (rising edge in D2) from 4.7 μs to 2.6 μs, more-or-less, kinda-sorta.

The ADC hardware can return the average of several sample taken in quick succession, so I set it to average four samples. The vertical cursors show the combination of fast conversion and averaging requires 7 μs (-ish) from start to finish: long enough to justify separating the two by an interrupt and short enough to allow calculations after fetching the result.

The purple trace shows the analog input voltage hovering close to a constant VCC/2 (about 1.6+ V), rather than the sine-wave I used earlier, again courtesy of the scope’s arbitrary function generator. The loop() dumps the min and max ADC values (minus half the ADC range (4096/2= 2048):

    -4 to     2
    -3 to     2
    -3 to     2

A span of half a dozen counts = 3 bits means the 12 bit ADC really delivers 9 bits = 0.2% resolution = 54 dB dynamic range = probably not good enough. However, the “circuit” is an open-air hairball on the bench, driven from the scope’s arbitrary waveform generator in high-Z mode, so things can only get better with more any attention to detail.

The 1.9 μs gap between the first and second burst of SPI clocks contains all the floating-point calculations required to convert an ADC sample to DDS delta-phase bits:

void adc0_isr(void) {

  int Audio;


  AnalogSample = adc->readSingle();             	  // fetch just-finished sample
  Audio = AnalogSample - 2048;                      // convert to AC signal

  DDSBuffer.Phase = 0;

  SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0));
  digitalWriteFast(PIN_DDS_FQUD, LOW);


  DDSBuffer.DeltaPhase = (uint32_t)((((double)Audio / 2048.0) * Deviation + Crystal) * CountPerHertz);

  SPI.transfer((uint8_t)(DDSBuffer.DeltaPhase >> 24));      // MSB first!

  if (Audio > AudioMax)                                     // ignore race conditions
    AudioMax = Audio;
  if (Audio < AudioMin) AudioMin = Audio; SPI.transfer((uint8_t)(DDSBuffer.DeltaPhase >> 16));

  SPI.transfer((uint8_t)(DDSBuffer.DeltaPhase >>  8));

  SPI.endTransaction();                         // do not raise FQ_UD until next timer tick!


A closer look lets the scope decode and present the SPI data:

DDS Mock - 0 VAC - SPI detail

DDS Mock – 0 VAC – SPI detail

The program calculates and displays various “constants” I set for convenience:

FM Modulated DDS
Ed Nisley KE4ZNU
 serial wait: 890 ms

DDS clock:     180000000.000 Hz
CountPerHertz:        23.861 ct
HertzPerCount:         0.042 Hz

Crystal:    20000000.000 Hz
Deviation:      5000.000 Hz

You can confirm the SPI data by working backwards with a calculator:

  • DDS delta-phase register bytes: 1C 71 C6 E2 = 477218530 decimal
  • Multiply by 180 MHz / 2^32 to get frequency: 1999997.5506 Hz
  • Subtract nominal 20.0 MHz crystal to get modulation: -2.4494 Hz
  • Divide by nominal 5.0 kHz deviation to get fractional modulation: -4.89.9e-6
  • Multiply by half the ADC range (4096/2) to get ADC counts: -1.003
  • Add 2048 to get the actual ADC sample: 2047

Nicely inside the range of values reported by the main loop, whew.

Which means I can avoid screwing around with fixed-point arithmetic until such time as clawing back a few microseconds makes a meaningful difference.

Now, to begin paying attention to those pesky hardware details …

The TeensyDuino source code as a GitHub Gist:

Leave a comment