Amateur Radio / Arduino
Amateur Radio / Arduino
- Leigh Klotz, Jr WA5ZNU
- Editor of forthcoming book ARRL Arduino Ham Cookbook with Bonus Picaxe Projects
 
While You're Resting...
- Copy the installer and the software Sketches from the USB memory to your desktop
- Install Arduino IDE if you have not already
 
The Apple II
- 8-bit CPU
- 32K memory
- Expansion cards
- Lots of Software
 
Arduino
- The Arduino is about as powerful as an Apple II computer
 
Arduino
- The Arduino is about as powerful as an Apple II computer
- But for $25...
 
 
Arduino Peripherals
- Instead of expansion cards the Arduino has shields
 
Arduino Peripherals
- Instead of expansion cards the Arduino has shields
 
Arduino Peripherals
- Adafruit sells Shields
http://www.adafruit.com/blog/2010/11/01/arduino-shields-an-adafruit-electronics-gift-guide/
 
Arduino Peripherals
- Sparkfun sells Shields
http://www.sparkfun.com
 
Arduino Peripherals
- Seeedstudio sells Shields
http://www.seeedstudio.com
 
Arduino Peripherals
- Radio Shack sells Shields...and Arduinos
http://www.radioshack.com
 
Arduino Advantages: Books
- There are many Arduino books:
 
Arduino Advantages: Books
- There are many Arduino books:
 
Arduino Advantages: Books
 
Arduino Advantages: Books
- But there is only one Arduino Ham Cookbook:
 
Arduino Advantages: Books
- But there is only one Arduino Ham Cookbook:
 
Arduino Advantages: High-level Programming
Arduino Advantages: High-level Programming
- Easy on-ramp for beginners
 
Arduino Advantages: High-level Programming
- Easy on-ramp for beginners
- Full power for experts
 
Arduino Disadvantages
- Frequency Counter not as capable or as easy to use as some Microchip PIC processors
- Form factor (pin spacing) for shields makes it hard to homebrew on perfboard
- Faster processors with 32 bit data available, but none have as much shared community or software
- (A future official Arduino "Due" will offer 32 bit data, but software libraries are still in development)
 
 
Diavolino and Arduino
- There are many Arduino-compatible boards
- If you did not bring one, we have the Diavolino for sale
- Thanks to Evil Mad Science Laboratories
 
 
Today's Project
Today's Project
- QRSS
- Very slow-speed, low power CW
- A great weak signal mode for propagation research and equipment testing
- 10-40mW often enough to cross continents
 
 
Today's Project
- QRSS
- Very slow-speed, low power CW
- A great weak signal mode for propagation research and equipment testing
- 10-40mW often enough to cross continents
 
- In the ARRL Arduino Ham Cookbook, Hans Summers G0UPL offers two QRSS projects
 
Today's Project
- QRSS
- Very slow-speed, low power CW
- A great weak signal mode for propagation research and equipment testing
- 10-40mW often enough to cross continents
 
- In the ARRL Arduino Ham Cookbook, Hans Summers G0UPL offers two QRSS projects
- To fit in an hour, the project had to be simplified:
 
Today's Project
- QRSS
- Very slow-speed, low power CW
- A great weak signal mode for propagation research and equipment testing
- 10-40mW often enough to cross continents
 
- In the ARRL Arduino Ham Cookbook, Hans Summers G0UPL offers two QRSS projects
- To fit in an hour, the project had to be simplified:
- Omit low pass filter, and test only on the bench, with no antenna
 
 
Today's Project
- QRSS
- Very slow-speed, low power CW
- A great weak signal mode for propagation research and equipment testing
- 10-40mW often enough to cross continents
 
- In the ARRL Arduino Ham Cookbook, Hans Summers G0UPL offers two QRSS projects
- To fit in an hour, the project had to be simplified:
- Omit low pass filter, and test only on the bench, with no antenna
- Use a TTL oscillator as the entire VCO / PA chain
 
 
Today's Project
- QRSS
- Very slow-speed, low power CW
- A great weak signal mode for propagation research and equipment testing
- 10-40mW often enough to cross continents
 
- In the ARRL Arduino Ham Cookbook, Hans Summers G0UPL offers two QRSS projects
- To fit in an hour, the project had to be simplified:
- Omit low pass filter, and test only on the bench, with no antenna
- Use a TTL oscillator as the entire VCO / PA chain
- Three common ones can be used within ham band: 28.322 MHz, 14.318 MHz, 4.000 MHz
- Use PWM with RC filter to control voltage for VCO
 
 
 
Today's Project
- QRSS "Transmitter"
- Very slow-speed, low power CW
- A great weak signal mode for propagation research and equipment testing
- 10-40mW often enough to cross continents
 
- In the ARRL Arduino Ham Cookbook, Hans Summers G0UPL offers two QRSS projects
- To fit in an hour, the project had to be simplified:
- Omit low pass filter, and test only on the bench, with no antenna
- Use a TTL oscillator as the entire VCO / PA chain
- Three common ones can be used within ham band: 28.322 MHz, 14.318 MHz, 4.000 MHz
- Use PWM with RC filter to control voltage for VCO
 
- Remember, no antenna, just test on the bench
 
 
Project Overview
- Use Arduino for CW Keying
- Generate two different keying voltages for mark and space
- Use Pulse Width Modulation
 
 
Pulse Width Modulation
- PWM generates a square wave with a specified duty cycle, 0-100%
- An RC integrator smooths the square wave to provide a DC analog voltage output
 
- A frequently-used technique for doing digital to analog conversion
- Used in this project to generate the two voltages for FSK QRSS CW
 
 
PWM Space
- Blue trace is PWM square wave of moderate duty cycle
- Yellow trace is filtered DC output at space voltage level
 
PWM Mark
- Blue trace is PWM square wave of higher duty cycle
- Yellow trace is filtered DC output at mark voltage level
 
PWM Voltage
- Useful range about 128-255
- Measured voltage is relative to power supply (compensate in software)
- Different voltage for mark and space for different oscillator parts
 
Parts selection
- For current at 5v of up to 40mA, we need to buffer the output of the Arduino pin
- Either power with 6v, or use rail-to-rail opamp
- TL922 Op Amp gives near 5v performance
- Most 28.322 MHz parts seem to work OK at lower voltages, but 14.318 MHz parts did not.
- 4.000 MHz parts pull well to 3.999 MHz
 
Design Choice: 3.999 MHz and 28.322 Mhz
- Still need a buffer, but at 3.3v max we can use NPN transistor emitter follower
- Pull 4MHz oscillator below 3.3v at max (mark) to keep frequency in ham band
 
Modes
- QRSS FSK CW
- Space is Low, Mark is High
- Aim for 4Hz
 
- Triangle Pattern
 
Arduino sketch
- Setup
- Loop
- QRSS
- Calibrate
 
Setup
Set PWM word in the range 128-255 to achieve 3150mV for mark, and 2850mV for space
#define VCC_MV 4675   // Vcc measured
void setup() {
  ...
  mark = calibrate(128, 255, 3150);
  space = calibrate(128, 255, 2850);
  ...
}
Similar setup for 5V part
 
Loop
void loop()
  analogWrite(PWM, (mark+space)/2);
  delay(1000); 
  tri(); tri(); tri();
  analogWrite(PWM, (mark+space)/2);
  delay(1000); 
  qrss_cw(MESSAGE);
}
 
Tri
void tri() {
  for (int i = space; i < mark; i++) {
    analogWrite(PWM, i);
    delay(TRI_DELAY);
  }
  for (int i = mark; i >= space; i--) {
    analogWrite(PWM, i);
    delay(TRI_DELAY);
  }
}
 
Calibrate
// Use Analog Input A0 for voltmeter
int calibrate(byte min_pwm, byte max_pwm, int desired_mv) {
  Serial.print("Calibration for ");
  Serial.print(desired_mv);
  Serial.print("mv = ");
  read_voltage(128);
  delay(1000);
  int m = calibrate_b(min_pwm, max_pwm, desired_mv);
  Serial.println(m);
  return m;
}
 
calibrate_b
int calibrate_b(byte min_pwm, byte max_pwm, int desired_mv) {
  int m;
  while(min_pwm<=max_pwm) {
    m=(min_pwm+max_pwm)/2;
    int mv = read_voltage(m);
    if (desired_mv==mv) {
      break;
    } else if(desired_mv<mv) {
      max_pwm=m-1;
    } else {
      min_pwm=m+1;
    }
  }
  return m;
}
 
read_voltage
// start with initial voltage and delay(1500)
// when used to read a slowly-changing voltage per-step delay(250) is ok.
// with sudden jumps from previous call, use delay(1500)
unsigned int read_voltage(byte pwm) {
  analogWrite(PWM, pwm);
  delay(250);
  long avg = 0;
  analogRead(DVM);
  for (byte i = 0; i < 10; i++) {
    avg += analogRead(DVM);
  }
  return (avg*(VCC_MV/10))/1024L;
}
 
Thanks to...
- Thanks to K6BEC, K6YUU, and KI6IMM for helping out today!
- Thanks to ARRL and MDARC for making this event possible!
- Thanks to Evil Mad Science Laboratories for the Diavolinos
- Thanks to Quixey.com for giving me Friday off!
 
Photo Credits
- Apple II photo from http://en.wikipedia.org/wiki/Apple_II courtesy http://commons.wikimedia.org
- Lynard Skynard publicity photo
- Arduino Uno photo by Arduino.cc
- Shield Stack photo by WA5ZNU
- Arduino Shield Gift Guide from Adafruit.com
- Sparkfun Shields from Sparkfun.com
- Seeedstudio Shields from Seeedstudio.com
- Maker Shield from Radio Shack
- Fritzing.org for schematics and drawings
- PWM Images using SEEEDStudio DSO Quad Nano
- O'Reilly Press, Getting Started With Arduino
 
Licenses
- Sketch released under MIT License http://opensource.org/licenses/mit-license.php
- Schematics and Layouts CC-BY-SA 3.0 http://creativecommons.org/licenses/by-sa/3.0/   