Tuesday, 10 February 2015

EAGLE - Progressing with a PCB design

After the last post I will now continue with actual PCB design. Starting with drawing the circuit schematic.

A Project

A Project is a folder that will contain all your files - schematic drawings, board layouts etc

- At the Control Panel, right click on Projects and chose "New", name the project.

Screen Shot 2015 02 10 at 12 13 48

Then repeat and chose "Edit Description" and give your project a description.

Screen Shot 2015 02 10 at 12 14 08

Schematic

With your Project highlighted,

- File > New > Schematic.

- Click on the "Grid" icon top left and switch it On.

Screen Shot 2015 02 10 at 12 42 01

Now you can add the Devices to your schematic.

- Edit > Add, will open a window showing all your available Libraries of devices.

Screen Shot 2015 02 10 at 12 15 14

Find the one you want and click "OK"

Screen Shot 2015 02 10 at 12 15 30

- Add this to your schematic, position it and click. You can repeat the additions if you need more of the same Device, to exit hit ESC.

Add the other components you need, I used the "rcl" library for the resistors (To rotate a component hit CTRL-R)

Screen Shot 2015 02 10 at 12 17 03

Now wire up the schematic

- Draw > Net (do not use Draw > Wire as this only draws lines, not connections!). Click on the points you want to wire up.

Screen Shot 2015 02 10 at 12 18 19

Wires on your schematic can be given Names, and Eagle will connect all those with the same name, for example "GND" or "VCC", "IN" or "OUT"

- Edit > Name, select the wire and enter a Name.

Text can be added to the schematic to record the wire names

- Edit > Text, enter the name and add to the schematic, ESC to do another name, ESC ESC to exit

Screen Shot 2015 02 10 at 12 20 55

You will want to give your components values.

- Edit > Values, click on each component and enter its value (e.g. 4k7)

That's it. Next time I will complete the design and turn this schematic into a board layout.

Sunday, 8 February 2015

EAGLE - PCB design software

Eagle is not the easiest software to understand. But I have invested a number of hours to get to grips with it. This is what I have found. (This tutorial was written using the "Lite" version of the software from the Cadsoft web site £60).

This blogpost will cover the starting point for creating Devices to use in your designs if you can't find them in an existing library. A future post will cover drawing a schematic and generating the PCB layout. You could also check out this or this site.

Screen Shot 2015 02 10 at 11 10 23

Eagle

Eagle handles these levels, in descending order:

- PCB Design

- Devices or components

- Packages used on PCB layouts

- Symbols use on schematic drawings

- Gates, which are fundamental building blocks of devices (e.g. the individual op-amps in a quad op-amp device)

Libraries and the Device Editor

There are a myriad of libraries of devices from many suppliers, and your software comes with a lot of them, plus many others are made by users for devices they need. There are some web sites, for example this one, to help find if a device exists in a library somewhere.

I would recommend that you chose the libraries you need for your projects, then move all the other unwanted ones to a "oldlibs" folder. This make design a lot easier.

Often you may want to create new devices that you can't find. So here's how to do it using the Device Editor.

Definitions

Device - a combination of a symbol and a package. So that a symbol used on a schematic diagram can be directly translated to a physical device for the PCB layout.

Package - which is the outline and connection types and positions (e.g. SMD or thru hole)

Symbol - the device schematic graphic, and pins to which connections can be made

Gate - parts of a symbol if they are repeated in one device.

When Eagle is started this is the window that appears, called the Control Panel.

Screen Shot 2015 02 08 at 12 45 28

There are two important items on the left, Libraries and Projects. under the Library list are all the libraries that you have installed in your /lbr folder, under /Eagle. Under the Projects list are the designs you have made or are working on.

Screen Shot 2015 02 08 at 12 48 08

Screen Shot 2015 02 08 at 12 48 21

Libraries and new devices

If you can't find the component you need in existing libraries , you will have to design a Device. First create a new library for your components.

- Control Panel, File > New > Library

- Library > Description, enter a description of your library

- File > Save As...

With the Library open you will have this window

Screen Shot 2015 02 08 at 12 53 16I

At the top are three important icons, Device, Package and Symbol.

Screen Shot 2015 02 08 at 12 54 37

Making a new device

Start at the level of Gate, creating one of the internal parts of your device.

Symbol

- Chose Symbol icon, then File > New... and name it

Screen Shot 2015 02 08 at 13 08 09

In the editor window draw the device and the pins.

- Make an outline of the internal gate, Draw > Wire

- Add pins, Draw > Pins

- Name the pins, View > Info, like the component data sheet

- Set pin direction, Edit > Info > Direction and the pin visibility, Edit > Info Visible (note: chose "pin" to have only the pin name showing on the symbol/schematic)

- Add text, Draw > Text... ">NAME" and ">VALUE", and put these on the 95Names layer, Edit > Info... Layer 95Names

That completes the gate creation. File > Save.

Package

- Chose the package icon, then File > New... to name it

Screen Shot 2015 02 08 at 13 08 17

- Set the grid "on" at a suitable resolution for the physical package design, see data sheet

- Draw the pads, Draw > Pads (either SMD and set size) or Pins (thru hole and set shape) and position them correctly

- Draw the outline, Draw > Wire, then Edit > Info to change the lines to the 21Place layer.

Device

Chose the Device icon, then File > New.. and name it

Screen Shot 2015 02 08 at 13 08 30

- Add the gate(s) to the left hand pane, Edit > Add

- Rename the gates "A","B", etc Edit > Name

- Set the gate levels to "next", Edit > Info

Add a power supply connection if this is not one of the pins, this will provide a hidden connection to VCC & GND.

- Edit > Add "PWRN", right click PWRN symbol and set Add Level to "request" (Note: it will then not appear on the schematic, but the signals will connect)

- Add the package in the top right pane, New button... chose package

- "Connect" and chose correct pins and pads to be connected

- Set a naming Prefix, e.g "IC", "T", etc (Note: devices on the schematic will be names IC1, IC2 etc)

File > Save All

Additional help

It maybe that someone else has already drawn the package and a similar symbol to the device you are creating. You can use their Package and symbol drawing in your Device like this:

- Control Panel, open libraries. Right click on the library containing the Device with the Package and/or Symbol you want to copy.

- Open the Package or Symbol

- Edit > Group and drag a box round all of the Package or Symbol

Screen Shot 2015 02 10 at 10 47 55

This will high-light the selection:

Screen Shot 2015 02 10 at 10 48 08

- Edit > Copy

- Now open your Library, chose your Device. Open its Package and or Symbol and Edit > Paste

That's it.

Friday, 6 February 2015

New proposed version of the Radiono TXRX

The Radiono TXRX is a fascinating design, using a bi-directional FET output mixer for RX & TX, driven by a couple of amplifiers one in each direction.

Here's a proposal using MMICs for the two amplifiers. It also has AGC on the audio side to give more "punch".

The input BPF is based on the WA4DSY design aid

Screen Shot 2015 02 07 at 17 45 11

and has a response like this:

Screen Shot 2015 02 07 at 17 45 23

Screen Shot 2015 02 20 at 18 14 00

Saturday, 31 January 2015

SDR TXRX Block Diagram

As things are slowly getting sorted out, here is the block diagram of the four board SDR TXRX controlled by an Arduino Uno that I have in mind. The boards are useful individually for home constructor projects.

The Universal VFO interfaces with the LCD display and the Rotary Encoder/Button for tuning and band change. It outputs either VFO, VFO and BFO signals for CW transmit or superhet receivers, or /4 frequency I & Q quadrature signals for SDR use. The function depends on the Arduino software program.

The 403020 SDR is a complete SDR receiver with its own input BPF.

The Universal TX is an SDR based wide band transmitter (with around 100mW output). This can be used to generate SSB/AM/CW over a wide range of frequencies. If used stand alone it needs an external LPF.

The 403020 PA includes the LPFs for the three bands 40, 30 & 20m. It also provides the TX/RX switching of the antenna input from the ATU.

Screen Shot 2015 03 22 at 10 05 59

My ideas are coming together, and I must say that they are just ideas today, nothing has yet been made. Other shields considered are a GPS and an Auto ATU. Still its good to go on thinking and studying how to achieve the result. We are considering to make this a club kit project at the Banbury Amateur Radio Society.

By the way, a simple CW TXRX could be made by omitting the Universal TX and driving the PA directly from the Universal VFO. I am including a physical switching link for this on the PA board.

Note

The RF BUS of the system has been increased to 8 pins, giving

- 4 outputs VFO, BFO, I & Q from the Universal VFO

- 2 for RX ground and input

- 2 for TX ground and output

The Arduino UNO connections planned are:

Screen Shot 2015 03 22 at 10 21 55

Where you can see the RFbus signals, and the use of the Ardubi signals D0-D13 and A4, A5 (I2C bus). D2, 4 are used as Interrupt inputs from the tuning rotary encoder, D5 is the band change button, D6, 7 are inputs from a GPS board planned to calibrate the VFO and give timing for WSPR use. D9 is the key or PTT, D10, 11 and for band switching and D12, 13 are for enabling TX or RX.

Wednesday, 19 November 2014

DSP Radio, SDR software for the Mac

An increasing number of people are using Macs as opposed to PCs. Quite a few Amateur radio programs are available for Mac OS X. One of the most interesting is the SDR program from DL2SDR called "DSP Radio". This posting is intended to help anyone setting up the program.

Physical connections

The setup described here is for an iMac, which has audio output (LS) and a built-in microphone, but no audio line-in. So an A-to-D/D-to-A convertor is used to provide wideband input/output audio channels. I use the Berlingher FCA202, which interfaces the iMac by Firewire (Apple persistently keeps messing around with their I/O protocols, so a couple of convertors are needed to convert the iMac's Thunderbolt to Firewire 800, then Firewire 800 to 400... £40-50!!!). The FCA202 has line-in which is the receive audio from the SDR and line-out which is the transmit audio to the SDR.

[If you lash out and buy a new MacBook it has only one I/O connector. The best solution here is to use an external A/D D/A convertor, e.g. the StarTech (look on Amazon), and connect with a USB-C to USB converter]

The computer microphone and LS are used for TX & RX listening.

I have tested the setup, so far, only with a simple SDR receiver board, the Softrock Lite. I modified this as described in a earlier posting to use a VFO built round an Arduino and DDS board. But the original with fixed XTAL control works just as well.

Audio MIDI Setup

The first thing to do is to set up the iMac audio channels using the utility Audio MIDI Setup. This is used to create an "Aggregate" device and connect the FCA202, Built-in Microphone and Built-in Output. To do this click on the '+' button lower left and select Aggregate device. Name this something like "SDR"

Screen Shot 2014 11 18 at 14 51 34

Make sure all the audio channels are set to 96kHz bandwidth, which will give the SDR about +/-48kHz tuning range.

DSP Radio setup

I am using the version 1.3.9 of DSP Radio as I have found bugs in the later version which I have yet to overcome. Launch the program and hit CTRL-A which will list the audio devices found on your iMac.

Screen Shot 2014 11 18 at 14 54 56

You can see here the Aggregate device you created in Audio MIDI Setup. Chose this for both Input and Output.

Next hit CTRL-C to create the RX & TX configurations. This means choosing the input/output channels for each, and setting the gain for the RX channel. The audio channels are, unfortunately not numbered the same as the numbers in Audio MIDI setup, so follow those shown here.

Screen Shot 2014 11 19 at 10 34 24

You can switch the AGC function on and off by clicking in the box, you can also set the input or output gain, the S-Meter gain and the gain applied to the spectrum display.

Using the DSP Radio

DSP Radio looks like this

Screen Shot 2014 11 19 at 10 37 00

On reception the spectrum displays, and you can listen to, stations about +/- 45-48kHz from the centre frequency of the oscillator on your SDR radio. Set the centre frequency by scrubbing up/down on RX Frequency/Centre QRG or double click and enter the value in kHz. SDR radios that work receiving commands from the computer over a USB connection, like the Softrock Ensemble, will tune themselves to the frequency entered. If you do not have USB control (as in the Softrock Lite RX which I am using) then you must set the Centre Frequency to the local oscillator frequency on the receiver (remember that the receiver operates at a frequency of the XTAL divided by four as it has a /4 Johnson counter to generate the internal quadrature signals for the detector).

Select the mode, for example LSB, you should now see received signals and moving the green band across the display with the mouse will allow you to listen to the stations. The filter bandwidth can be chosen by sliding the Bandwidth slider.

If you have a transmit also SDR then you must set the RIT/XIT frequency to be the same as the indicate RX frequency, do this by clicking on the button RIT/XIT and enter the receive frequency, then click on RIT/XIT again. This will set the TX frequency to the same value as the RX frequency.

Transmit

To transmit you hit the SPACE bar or the button at the bottom on the display. The DSP Radio will generate an output audio frequency the same as the receive frequency, with sideband modulation set by the mode. For example, with a Centre Frequency QRG of 7160kHz, and LSB selected, tuning to an RX frequency of 7187.100kHz and sending a 1000Hz tome will generate a TX audio output via the D-to-A convertor of 16.1kHz, thus generating a carrier output of 7186.100kHz (7160,00 + 16.1kHz.

Screen Shot 2014 11 19 at 10 50 57

The display will show the transmitted signals, which would look like this

Screen Shot 2014 11 19 at 10 51 45

Comments

SDR is the future, and once you have used an SDR radio you will not want to go back. The HUGE advantage is the ability to see all the stations and relative signal strengths across a wide part of the band. When tuning to a station you can clearly see the bandwidth it is occupying and get a picture of the audio quality. It also make it easy to chose an unused channel if you wish to make a CQ call.

Saturday, 15 November 2014

SDR first steps - the DDS

This is a new build of a DDS using the Adafruit Si5351 module. It adds a CD74ACT74 as a divide-by-four Johnson counter to generate IQ quadrature signals.

The DDS has two modes, SDR & VFO. It is tuned in programable steps (at the moment 10kHz for SDR & 100Hz for VFO) . The shield RF Bus outputs VFO and I & Q which are derived like this:

freq = indicated frequency on display

D5 HIGH	SDR mode	freq x4 clk0 = VFO x4 output
			freq x4 clk1 = Johnson /4 = I & Q x1 outputs
D5 LOW	VFO mode	freq x1 clk0 = VFO output


The input for tuning is a rotary encoder. An LCD display shows the band and the tuned frequency.

Three bands are generated, 40, 30, & 20m. These are selected in turn by the rotary encoder push button. Selecting a new band tunes a preset band frequency.

Photo 11 22 2014 13 38 00

The 5 connections across the left are for the Rotary Encoder and its Button and 4 for the I2C LCD display. This is documented in the source code.

The schematic diagram is:

Scanner Pro 1

Software

The software is a "Universal VFO" this software uses the new "Si5351.h" library from NT7S and implements a VFO switchable to 40, 30, & 20m bands. At the top of the code are defined constants, SDR & VFO, which determine the output frequency, x4 or x1. This value is set to SDR if you want an output x4 the indicated frequency on the VFO output, and a x4 drive to the onboard CD74ACT74 Johnson counter to generate I & Q signals. The VFO output in SDR mode can be used, for example, for the Softrock Lite SDR board. In VFO mode it changes to a single x1 output on the VFO RF bus pin.
The mode, SDR or VFO, is selected by a High or Low on pin D5, selected at start-up by the red jumper link. The constant STEP4 or STEP1 determine the step of the tuning, which can be, for example, 10kHz for driving an SDR, or 100Hz for a direct tuned radio.

The board thus has a VFO output which can be x1 or x4 the indicated frequency. When the hardware /4 Johnson counter is implemented and used, then two further outputs I & Q, provide outputs with the Si5351 running at x4 the frequency displayed. The VFO output is from CLK0, the IQ drive is from CLK1. Board outputs VFO, I & Q are on the RF bus (see previous post below).

Thus this design, with small changes in the software can satisfy diverse applications. Here's the code:

// Universal VFO, outputs for 40-30-20m
// V0.9
// Function
// Generates VHF & IQ outputs.
// Si 5351 output is x1 or x4 displayed frequency.
// Frequency selected in programmable steps by rotary encoder. Button changes bands 40-30-20m
// Change of band sets new frequency to band
// LCD displays frequency in kHz and band
// -----
// Shield has RF bus with VFO, I & Q outputs
// Two modes, set by link (pin D5):
// SDR (D5 HIGH) outputs x4 from clk0 to VFO, & x1 quadrature to I & Q. 10kHz steps
// VFO (D5 LOW) outputs x1 on clk0 to VFO out, 100Hz steps
// -----
// DDS I2C SI5351 
// SCL = A5
// SDA = A4
// I2C address 0x60
// ------
// display I2C LCD 16 * 2
// o A5 SCL (y)
// o A4 SDA (or)
// o +5     (r)
// o GND    (bwn)
// I2C address 0x27
// -----
// encoder KY-040
// o D2 DT  (y)
// o D3 CLK (g)
// o D4 SW  (or)
// o +5     (r)
// o GND    (bwn)
//-----
// D12-D13 TX-RX enable
// D10-D11 band switch relays 40-30-20
// -----

// I2C, Si5351, LCD and Rotary Encoder libraries
#include "Wire.h"
#include "si5351.h"
#include "LiquidCrystal_I2C.h"
#include "Rotary.h"

// XTAL freq, PLL multiplier, outputs 0-2, IQ Mult, steps (Hz)
#define XTAL 25
#define MULT 36
#define SDR 4
#define VFO 1
#define STEP4 10000
#define STEP1 100

// SDR/VFO link pin 5, button pin 4, Rotary Encoder pins 2 & 3 (A & B)
#define LINK 5
#define BUTTON 4
#define ROTA 2
#define ROTB 3

// dds object
Si5351 dds;

// lcd object
LiquidCrystal_I2C lcd(0x27, 16, 2);

// Rotary Encoder object
Rotary rot = Rotary(ROTA, ROTB);

// start frequencies (Hz)
float bandStart[3] = {
  7000000, 10050000, 14000000};
char bandName[3][4] = {
  "40m", "30m", "20m"}; // band 0 = 40m, 1 = 30m, 2 = 20m

// band & freq, freq steps, mode
byte band;
float freq;
float steps;
byte mode;

void setup()
{
  // encoder, button, link, relays & TXRX pin config
  pinMode(ROTA, INPUT_PULLUP);
  pinMode(ROTB, INPUT_PULLUP);
  pinMode(BUTTON, INPUT_PULLUP);
  pinMode(LINK, INPUT_PULLUP); // default input = HIGH

  mode = digitalRead(LINK); // HIGH (default) = SDR, LOW = VFO
  if(mode == HIGH) steps = STEP4; // set steps STEP4 (SDR) or STEP1 (VFO)
  else steps = STEP1;

  dds.init(SI5351_CRYSTAL_LOAD_8PF); // init si5351

  lcd.init(); // init LCD & backlight
  lcd.backlight();

  // startup band & frequency
  band = 0; // 40m
  freq = bandStart[band];

  freqOut(freq);

  dispMenu(); // display menu
  dispFreq(freq); // display freq
  dispBand(bandName[band]); // display band
}

void loop()
{
  unsigned char dir; // tuning direction CW/CCW
  byte step;

  if(digitalRead(BUTTON) == LOW) // button pressed?
  {
    while(!digitalRead(BUTTON)); // wait for release
    if(band == 2) band = 0; // go around
    else band++;

    freq = bandStart[band]; // set centre freq of new band

    freqOut(freq); 
    dispFreq(freq); // update freq & band display
    dispBand(bandName[band]); 
  }

  dir = rot.process(); // read encoder
  if(dir != DIR_NONE) // turned?
  {
    if(dir == DIR_CW) freq += steps; // increment +/- STEP
    if(dir == DIR_CCW) freq -= steps;

    freqOut(freq);
    dispFreq(freq); // update freq display
  }
}

// freq out x IQ
void freqOut(float freq)
{
  if(mode == HIGH) // SDR mode
  {
    dds.set_freq(freq * SDR, 0, SI5351_CLK0); // VFO out, x4
    dds.set_freq(freq * SDR, 1, SI5351_CLK1); // CD74AC74 quadrature to I & Q
  }
  else
  {
    dds.set_freq(freq * VFO, 0, SI5351_CLK0); // direct VFO out, x1
  }
}

// display menu
void dispMenu()
{
  lcd.setCursor(1, 0); // display caption
  if(mode == HIGH)  lcd.print("SDR");
  else lcd.print("VFO");
  lcd.setCursor(1, 1);
  lcd.print("Band");
}

// display freq
void dispFreq(float f)
{
  float pf;
  pf = f /1000; // kHz

  lcd.setCursor(5, 0);
  lcd.print("       "); // clear last freq display
  if(pf < 9999.9) lcd.setCursor(6, 0);
  else lcd.setCursor(5, 0);
  lcd.print(pf, 1);
  lcd.setCursor(13, 0);
  lcd.print("kHz");
}

// display band
void dispBand(char b[])
{
  lcd.setCursor(5, 1);
  lcd.print("   "); // clear last band display
  lcd.print(b);
}


Saturday, 27 September 2014

QRSS first looks

I have a growing interest in the communication protocols called WSPR (see previous posting) and QRSS which stands for very slow morse code. I have often wondered if there is much activity on the bands. There are designated frequencies for QRSS which are:

WSPR  QRSS Frequencies

But how about software. QRSS needs basically a spectrum analyser for the audio spectrum, say from 0 to 2500Hz,, and a slow graphing of the signals received across the page. There are a few Windows based programs for QRSS reception but not a single one for the Mac (hey-ho). But their is one for the iPad from Black Cat Systems, called Godaloss (whatever..).

So i downloaded this (£1.99 on the App Store) and rigged up my iPad to the audio output of my iMac, via an A to D convertor iMic (which I can strongly recommend to anyone needing analog In or Out to USB conversion), it has two input sensitivity settings for Line and Mic. The iMic is powered by the battery in the iPad and interfaced using an Apple iPad 30pin to USB convertor.

Next I opened my browser (Safari - the browser must be HTML5 compatible) and went to the on-line site for an SDR receiver in Holland. Tuning to the 7MHz QRSS frequency revealed a number of morse code looking signals, although as of now I have had difficulty reading or understanding the code sent, they are clearly morse, like this:

IMG 0038

The signals at the bottom is, I think, a WSPR transmission.

I intend to experiment further, and use my own Arduino based SDR receiver to get to grips with QRSS. Then I may try myself to send some signals out into the ether.