### Measuring QRP Radio Output Power with an Oscilliscope

Warning: This post is several years old and the author has marked it as poor quality (compared to more recent posts). It has been left intact for historical reasons, but but its content (and code) may be inaccurate or poorly written.

I added a backlight to my oscilloscope! My o-scope’s backlight hasn’t worked since I got it (for \$10), so I soldered-up a row of 9 orange LEDs (I had them in a big bag) and hooked them directly up to a 3v wall wart. In retrospect I wish I had a bunch of blue LEDs… but for now I can’t get over how well this worked! Compare it to the images a few posts back – you can really see the grid lines now!

I know this is super-basic stuff for a lot of you all, but I haven’t found a place online which CLEARLY documents this process, so I figured I’d toss-up a no-nonsense post which documents how I calculate the power output (in watts) of my QRP devices (i.e., QRSS MEPT) using an oscilloscope.

I think I have increased power output because I’m now powering my 74HC240 from this power supply (5v, 200A) rather than USB power (which still powers the microcontroller). Let’s see!

There’s the signal, and I haven’t calibrated the grid squares (this thing shifts wildly) so I have to measure PPV (peak-to-peak voltage) in “squares”. The PPV of this is about 5.3 squares.

I now use a function generator to create square waves at a convenient height. Using the same oscilloscope settings, I noticed that 10v square waves are about 7 squares high. My function generator isn’t extremely accurate as you can see (very fuzzy) but this is a good approximation. I now know that my signal is 5.3/7*10 volts. The rest of the math is pictured here:

140mW – cool! It’s not huge… but it’s pretty good for what it is (a 2-chip transmitter). I’d like to take it up to a full watt… we’ll see how it goes. My 74HC240 is totally mutilated. I accidentally broke off one of the legs, couldn’t solder to it anymore, and thought I destroyed the chip. After getting distraught about a \$0.51 component, I ripped ALL the legs off. Later I realized I was running out of these chips, and decided to try to revive it. I used a dremel with an extremely small bit (similar to a quarter-round burr in dentistry) and drilled into the black casing of the microchip just above the metal contacts, allowing me enough surface area for solder to adhere to. I’m amazed it works! Now, to get more milliwatts and perhaps even watts…

### AJ4VD Gator Spotted in Essex, England

It’s so awesome that such a small device can send such a low power signal so far away! Anyhow, the title says it all. Special thanks to G6AVK’s “part time” grabber for capturing this awesome series. That’s a 4356.4 mile trip on USB power! ha!

### AJ4VD Gator Chomps its way into Belgium!

Yeah, that’s over 4,500 miles away! The following image was captured from ON5EX’s QRSS grabber in Belgium! Amazing. I don’t have the equipment to measure its power output, but it’s running on USB power and I’d assume it’s putting out less than 100mW. Very cool!

### AJ4VD Gator Spotted in MA

That’s over 1,00 miles on a few milliwatts! The transmitter is the ridiculously simple one pictured below. I’m blown away! It was seen on running QRSS VD software! Awesome!!

Warning: This post is several years old and the author has marked it as poor quality (compared to more recent posts). It has been left intact for historical reasons, but but its content (and code) may be inaccurate or poorly written.

Haray! I’m making awesome progress with my QRSS transmitter design. Because my current transmitter (previous few posts) was randomly freezing-up (likely due to the oscillator stopping its oscillating due to being overloaded) so I moved the oscillator from in-chip to an external oscillator. It’s been made small enough to fit in an Altoids tin, and I already tested it with the solar panel and it works! Awesome! Here are some photos. Again, when I perfect the design I’ll post final schematics.

Sticking out are wires for power and an antenna on each side. The goal is to hang the device between two trees by its own antenna. That’s my new chip development board. I made it with what I needed on it. It’s so convenient! It uses 5v of power from the USB port too! Altogether I’ve tested the device and confirmed it transmits radio when the solar panel is illuminated. I’m thinking of making it more effective by adding more panels… but that’s it for now!

I’m so excited! This little transmitter I made and programmed to transmit my call sign (AJ4VD) and a picture of a gator got its first spotting tonight! I’m so excited. It was reported by W4HBK in Pensacola, FL. It’s only 300 miles away, but it’s a start! I’m keeping my fingers crossed and maybe someday soon I’ll hear from Europe.

### Debut of the AJ4VD QRSS Gator

Warning: This post is several years old and the author has marked it as poor quality (compared to more recent posts). It has been left intact for historical reasons, but but its content (and code) may be inaccurate or poorly written.

I re-wrote the code from the previous entry to do several things. Once of which was to make a gator rather than a fish. It’s more appropriate since I’m planning on housing the transmitter at the University of Florida. To do it, I drew a gator in paint and wrote a python script to convert the image into a series of points. I’ll post it later. One thing to note was that size was a SERIOUS issue. I only have two thousand bytes of code, and every point of that gator was a byte, so it was a memory hog. I helped it dramatically by using repeating segments wherever possible, and some creative math to help out the best I could (i.e., the spines on the back) Here’s what it looks like, and the code below it…

```#include <avr/io.h>
#include <util/delay.h>

// front top LED - PA0
// inside top LED - PA1
// inside bot LED - PA2
// front bot LED - PA3

unsigned long int t_unit; // units of time
const int tDit = 100; //units for a dit
const int tDah = 255; //units for a dah
char fsk; // degree of frequency shift to use for CW
char fsk2; // degree of frequency shift to use for HELL

char light = 0; // which lights are on/off

void delay(){
_delay_loop_2(t_unit);
}

return;
if (light==0){
PORTA|=(1<<PA0); //on
PORTA|=(1<<PA1); //on
PORTA&=~(1<<PA2); //off
PORTA&=~(1<<PA3); //off
light=1;
} else {
PORTA|=(1<<PA2); //on
PORTA|=(1<<PA3); //on
PORTA&=~(1<<PA0); //off
PORTA&=~(1<<PA1); //off
light=0;

}
}

void tick(unsigned long ticks){
while (ticks>0){
delay();
delay();
ticks--;
}
}

void pwm_init() {
//Output on PA6, OC1A pin (ATTiny44a)
OCR1A = 0x00; //enter the pulse width. We will use 0x00 for now, which is 0 power.
TCCR1A = 0x81; //8-bit, non inverted PWM
TCCR1B = 1; //start PWM
}

void set(int freq, int dly){
OCR1A = freq;
tick(dly);
}

void fish(){
char mult = 3;

char f2[]={2, 3, 4, 5, 6, 7, 4, 3, 7, 4, 7, 7, 6, 5, 4, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 3, 4, 5, 6, 7, 8, 4, 9, 5, 9, 6, 9, 6, 9, 6, 9, 8, 8, 7, 7, 6, 5, 4, 3, 3, 3, 4, 5, 5};

for (int i=0;i<sizeof(f2);i++) {
OCR1A = f2[i]*mult;
tick(20);
OCR1A = 1*mult;
tick(20);
}

char f3[]={1,2,3,4,3,2};

char offset=0;
while (offset<9){
for (char j=0;j<3;j++){
for (char i=0;i<sizeof(f3);i++){
char val = (f3[i]+5-offset)*mult;
if (val<mult || val > 10*mult){val=mult;}
OCR1A = val;
tick(20);
OCR1A = 1*mult;
tick(20);
}
}
offset++;
}

}

void id(){
char f[]={0,0,1,2,0,1,2,2,2,0,1,1,1,1,2,0,1,1,1,2,0,2,1,1,0,0};
char i=0;
while (i<sizeof(f)) {
if (f[i]==0){OCR1A = 0;tick(tDah);}
if (f[i]==1){OCR1A = fsk;tick(tDit);}
if (f[i]==2){OCR1A = fsk;tick(tDah);}
OCR1A=0;
tick(tDit);
i++;
}
}

void slope(){
char i=0;
while (i<25){
OCR1A = 255-i;
i++;
}
while (i>0){
i--;
OCR1A = 255-i;
}
}

int main(void)
{
DDRA = 255;
pwm_init();
t_unit=1000;fsk=10;id(); // set to fast and ID once
//fsk=50;//t_unit = 65536; // set to slow for QRSS
t_unit=60000;

while(1){;
fish();
id();
}

return 1;
}
```

### Debut of the AJ4VD QRSS Fish

Warning: This post is several years old and the author has marked it as poor quality (compared to more recent posts). It has been left intact for historical reasons, but but its content (and code) may be inaccurate or poorly written.

Finally! After a few years tumbling around in my head, a few months of reading-up on the subject, a few weeks of coding, a few days of bread-boarding, a few hours of building, a few minutes of soldering, and a few seconds of testing I’ve finally done it – I’ve created my first QRSS transmitter! I’ll describe it in more detail once I finalize the design, but for now an awesome working model. It’s all digital, consisting of 2 ICs (an ATTiny44a for the PWM-controlled frequency modulation, and an octal buffer for the pre-amplifier) followed by a simple pi low-pass filter.

My desk is a little messy. I’m hard at work! Actually, I’m thinking of building another desk. I love the glass because I don’t have to worry (as much) about fires. That sounds scary, I know.

This is the transmitter. The box is mostly empty space, but it consists of the circuit, an antenna connection, a variable capacitor for center frequency tuning, and a potentiometer for setting the degree of frequency shift modulation.

Yeah, that’s a fishy. Specifically a goldfish (the cracker). It’s made with a single tone, shifting rapidly (0.5 sec) between tones. So cool. Anyway, I’m outta here for now – getting back to the code! I think I’ll try to make a gator next…

Here’s the code that makes the fish. It sends my ID quickly, some fish, then my ID in QRSS speed using PWM.

```#include <avr/io.h>
#include <util/delay.h>

const int tDit = 270/3;
const int tDah = 270;

char fsk;
unsigned long int t_unit;

void delay(){
_delay_loop_2(t_unit);
}

PORTA^=(1<<0);
PORTA^=(1<<1);
PORTA^=(1<<2);
PORTA^=(1<<3);
}

void tick(unsigned long ticks){
while (ticks>0){
delay();
delay();
ticks--;
}
}

void pwm_init() {
//Output on PA6, OC1A pin (ATTiny44a)
OCR1A = 0x00; //enter the pulse width. We will use 0x00 for now, which is 0 power.
TCCR1A = 0x81; //8-bit, non inverted PWM
TCCR1B = 1; //start PWM
}

void set(int freq, int dly){
OCR1A = freq;
tick(dly);
}

void fish(){
char f[]={0,0,0,4,5,3,6,2,7,1,5,6,8,1,8,1,8,1,8,1,8,2,7,3,6,2,7,1,8,1,8,4,5,2,3,6,7,0,0,0};
char i=0;
while (i<sizeof(f)) {
i++;
OCR1A = 255-f[i]*15;
tick(20);
}
}

void id(){
char f[]={0,0,1,2,0,1,2,2,2,0,1,1,1,1,2,0,1,1,1,2,0,2,1,1,0,0};
char i=0;
while (i<sizeof(f)) {
if (f[i]==0){OCR1A = 255;tick(tDah);}
if (f[i]==1){OCR1A = 255-fsk;tick(tDit);}
if (f[i]==2){OCR1A = 255-fsk;tick(tDah);}
OCR1A = 255;tick(tDit);
i++;
}
}

void slope(){
char i=0;
while (i<25){
OCR1A = 255-i;
i++;
}
while (i>0){
i--;
OCR1A = 255-i;
}
}

int main(void)
{
DDRA = 255;
PORTA^=(1<<0);
PORTA^=(1<<1);
pwm_init();

t_unit=2300;fsk=50;id(); // set to fast and ID once

fsk=50;t_unit = 65536; // set to slow for QRSS

while(1){
id();
for (char i=0;i<3;i++){
fish();
}
}

return 1;
}
```

Warning: This post is several years old and the author has marked it as poor quality (compared to more recent posts). It has been left intact for historical reasons, but but its content (and code) may be inaccurate or poorly written.

Success! Amid a bunch of academic exams, psycho-motor tests, and other crazy shenanigans my dental school is putting me through, I managed to do something truly productive! I built a simple QRSS transmitter with an ATTiny44A microcontroller clocked by a 7.04 MHz crystal which generates FSK signals and modulates its own frequency by applying potential to a reverse-biased diode at the base of the crystal, the output (CKOUT) of which is amplified by an octal buffer and sent out through an antenna. As it is, no lowpass filtering is implemented, so noisy harmonics are expected. However for ~2\$ of parts this is an effective QRSS transmitter!

I was able to detect these signals VERY strongly at a station ~10 miles from my house. I haven’t yet dropped in a 10.140 MHz crystal and tried to get this thing to transmit in the QRSS band, but when I do I hope to get reports from all over the world! This is what it looks like:

The cool thing about this transmitter (aside from the fact that it’s so cheap to build) is that it will work with almost any crystal (I think below 20 MHz-ish) – just drop it in the slot and go!

### Generate LUTs with Python

Warning: This post is several years old and the author has marked it as poor quality (compared to more recent posts). It has been left intact for historical reasons, but but its content (and code) may be inaccurate or poorly written.

I wrote a script to generate and display LUTs with Python. There has been a lot of heated discussion in the QRSS Knights mailing list as to the use of color maps when representing QRSS data. I’ll make a separate post (perhaps later?) documenting why it’s so critical to use particular mathematically-generated color maps rather than empirical “looks good to me” color selections. Anyway, this is what I came up with:

For my QRSS needs, I desire a colormap which is aesthetically pleasing but can also be quickly reverted to its original (gray-scale) data. I accomplished this by choosing a channel (green in this case) and applying its intensity linearly with respect to the value it represents. Thus, any “final” image can be imported into an editor, split by RGB, and the green channel represents the original data. This allows adjustment of contrast/brightness and even the reassignment of a different colormap, all without losing any data!

ORIGINAL DATA:
(that’s the “flying W” and the FSK signal below it is WA5DJJ)

Note that it looks nice, shows weak signals, doesn’t get blown-out by strong signals, and it fully includes the noise floor (utilizing all available data).

The following links are downloadable LUTs which can be applied to 8-bit grayscale images using most editors (i.e., MBF ImageJ) generated by the python script below.
Linear LUT
Nonlinear LUT

This is the Python script I wrote to generate the downloadable LUTs, graphs, and scale bars / keys / legends which are not posted. It requires python, matplotlib, and PIL.

```import math
import pylab
from PIL import Image

####################### GENERATE RGB VALUES #######################

r,g,b=[],[],[]
name="Blin_Glin_Rlin"
for i in range(256):
if i>128: #LOW HALF
j=128
k=i
else: #HIGH HALF
k=128
j=i
#b.append((math.sin(3.1415926535*j/128.0/2))*256)
#r.append((1+math.sin(3.1415926535*(k-128*2)/128.0/2))*256)
r.append(k*2-255)
g.append(i)
b.append(j*2-1)

if r[-1]<0:r[-1]=0
if g[-1]<0:g[-1]=0
if b[-1]<0:b[-1]=0

if r[-1]>255:b[-1]=255
if g[-1]>255:g[-1]=255
if b[-1]>255:b[-1]=255

####################### SAVE LUT FILE #######################
im = Image.new("RGB",(256*2,10*4))
for x in range(256):
for y in range(10):
pix[x,y] = (r[x],g[x],b[x])
pix[x,y+10] = (r[x],0,0)
pix[x,y+20] = (0,g[x],0)
pix[x,y+30] = (0,0,b[x])
a=(g[x]+g[x]+g[x])/3
pix[256+x,y] = (a,a,a)
pix[256+x,y+10] = (r[x],r[x],r[x])
pix[256+x,y+20] = (g[x],g[x],g[x])
pix[256+x,y+30] = (b[x],b[x],b[x])
#im=im.resize((256/2,40),Image.ANTIALIAS)
im.save(name+"_scale.png")

####################### PLOT IT #######################
pylab.figure(figsize=(8,4))
pylab.grid(alpha=.3)
pylab.title(name)
pylab.xlabel("Data Value")
pylab.ylabel("Color Intensity")
pylab.plot(g,'g-')
pylab.plot(r,'r-')
pylab.plot(b,'b-')
pylab.axis([-10,266,-10,266])