Wednesday 30 September 2020

My Small Shack

My shack is small and ALL indoors. The antenna is a small 60cm loop a-top an Auto ATU here:

You wouldn't think with my 5W you could get far with that, would you? But I enjoy my contacts using digital FT8 mode, especially on 20m. This is the rest of my shack, first the big picture:

Left to right, GPS clock, iMac, MacBook, FDM-DUO and 13.8V PSU

The GPS clock has been described in this blog below, it runs beautifully, but I have not yet boxed it up... The old iMac is a bit on the slow side, but runs WSJT, Grid Tracker and displays my log file. Underneath the iMac is a low cost Android tablet running ELAD Blueduo app. This gets spectrum and CAT data from the FDM-DUO transceiver via a small Bluetooth dongle and displays it. Next is the MacBook running Parallels and Windows 10, and then running the ELAD FDM-SW2 SDR suite. Lastly is the FDM-DUO transceiver itself with a home made 13.8V power supply, also described in this blog.

And here is the iMac running WSJT for FT8 mode:

iMac running WSJT

And the MacBook running Parallels, W10 & FDM-SW2, zoomed in on 14074kHz FT8 signals.

MacBook running Parallels, W10 & FDM-SW2

The FDM-DUO transceiver - an elegant, very small, very hi-tech SDR. With amazing performance, an almost entirely digital radio. But low powered at 5W output.

On the left a Bluetooth dongle to communicate with 
the Android tablet running Blueduo app.

The Android tablet running Blueduo app. Displays the spectrum and waterfall, and is able to control the FDM-DUO by CAT commands. 

Android tablet running Blueduo.

And that is it. Latest conquests, W. Sahara and Cyprus. That's DX for me!

Monday 28 September 2020

Extensive Arduino course

Note: all files and sketches on M0IFA.me

For beginners or to catch up. M0IFA.me has a full Arduino course, with course notes and all the sketches you need. I suggest you use this starter kit, it has all the pieces you need.

The kit is available from here. But add an LCD I2C interface here.

Please use it, copy it, distribute it. All free of charge!

Monday 21 September 2020

E-paper weather monitor

Weather does not change very quickly, so it is one of the things that can be displayed on a e-paper display which cannot be updated on the fly, but only as the whole screen at a time.

There is a product called DHT11 on the market which measures temperature and humidity, from which you can calculate the dew point.

These are easily used in an Arduino sketch with a library called dht11.h (download here). This is the project


Sketch EPD_TEMP is here. You also need the updated epda.h header here, put it in your libraries folder. 

Good for SOTA activations and field days!

Monday 14 September 2020

Web Site audio in Apple Safari

 I came across G4FPH's WebSDR site. It worked well, but there was no audio from the Apple Safari browser... I have met this issue before on other web sites.

G4FPH website

It seems that Safari controls audio for each web site you visit. To get it to work follow these steps

- Open Safari & the WebSDR site

- Chose Safari menu

- Chose Settings for this Website...

- in the small window that opens chose Auto-play and select Allow All Auto-Play

And presto, sound.

Sunday 13 September 2020

Climate Emergency - seriously

Apart from my interest in Amateur Radio, I have another side (wow). A focus on what to do about the climate emergency. One of the major areas which I feel  we must address is transport - namely road transport. CO2 emissions from transport are going up, not down. In 2021 all makers must meet the level of 95g/km overall... or be fined HUGE amounts.

But some good news is the sales of BEV (Battery Electric vehicles).

 I have put on my download site (M0IFA.me) a collection of snippets "EV POLITICAL ..." about transport and electric vehicles, here.

And I invite you to read this report by The Institute for Government.

Friday 4 September 2020

GPS clock, colour 2.4" TFT display

Note: all files and sketches on M0IFA.me

What a struggle! These TFT displays are awkward to use. Especially when you want to display a clock face and hands that move round, or for that matter to write text/numbers on the display and update them. To move a hand you must delete the previous line you have drawn and draw a new one. BUT, you cannot let the second hand, as it moves round, delete the minute or hour hand as it passes by...

Same for the time. When the hours, minutes or seconds change you have to write a black box over the original number and then the new time. Fortunately the simple Adafruit font does this by allowing you to define both the font colour and the background colour. The negative side of using the simple font is that it is very blocky and only small sizes can be used.

MY CLOCK

This is my display. This TFT has 5V operation and I am running it quite happily on the Arduino Mega at 5V.

The display is complete after I added a calculation of
day of the week and the Maidenhead Locator.

The TFT has an ILI9341 controller chip. This is supported by the Adafruit_GFX.h library with the driver Adafruit_ILI9341.h. This graphic library is not very extensive, but does have to simple things I needed, filled rectangles, circles, horizontal and vertical lines, sloping lines, print of numbers and text.

The interesting code for the clock hands is this:

 - x, y = centre of hands

 - r = radius of clock

 - ch, h etc are the colours and hour, min, sec values

Typical usage may be

dispHands(110, 110, 100, WHITE, hrs, WHITE, mns, RED, sec);

This is the function:

// HANDS

// display hands x, y, r, ch, h, cm, m, cs, s

void dispHands(int16_t x, int16_t y, int16_t r, uint16_t ch, uint8_t h, uint16_t cm, uint8_t m,  uint16_t cs, uint8_t s) {

 uint16_t rh, rm, rs; // hand lengths

 static uint8_t xh, xm, xs; // prev hms data


  // hand lengths, % of radius

  rh = r * 60/100;

  rm = r * 80/100;

  rs = r * 90/100;


  // proportional move of hour hand

  h = h * 5 + m / 12.0; // 60 min / 12 hours, plus minutes / 12


  // if hms change erase old hand

  if (h != xh) {

  tft.drawLine(x, y, x + rh * sin((6.282 * xh / 60.0)), y - rh * cos((6.282 * xh /60.0)), BLACK);}

  if (m != xm) {

  tft.drawLine(x, y, x + rm * sin((6.282 * xm / 60.0)), y - rm * cos((6.282 * xm / 60.0)), BLACK);}

  if (s != xs) {

  tft.drawLine(x, y, x + rs * sin((6.282 * xs / 60.0)), y - rs * cos((6.282 * xs / 60.0)), BLACK);}


  // then draw current times

  tft.drawLine(x, y, x + rh * sin((6.282 * h / 60.0)), y - rh * cos((6.282 * h / 60.0)), ch);

  tft.drawLine(x, y, x + rm * sin((6.282 * m / 60.0)), y - rm * cos((6.282 * m / 60.0)), cm);

  tft.drawLine(x, y, x + rs * sin((6.282 * s / 60.0)), y - rs * cos((6.282 * s / 60.0)), cs);


  // remember current time

  xh = h;

  xm = m;

  xs = s;

}

Just to run though it

1. Three static variables for hour, minute & second are created in the function, these are remembered between calls. They store the "previous" values.
2. The length of the hands is set as 60, 80, 90% or the radius.
3. Hours are converted to 60ths and intermediate minutes added, so the hour hand slowly goes round with the minutes
4. A check is made to see if anything has been updated, if so the old hand is erased (written over in BLACK colour)
5. The new hands are written. All of them MUST be written as an erase of the secondhand as it passes over the minute of hour hand will "black" it out!
6. Finally the current values are stored for the next call.

All the date & time and display functions have been written in a "Tft.h" header file, here. And the sketch code TFT_ADA_MEGA.ino is here. Name started off as "TFT using Adafruit" library, but it stuck.

TIME
So where does the time come from? GPS of course, and this is relatively easy to do using a GPS module and the TinyGPS library. See the sketch for the code.

Here it is running on an Arduino Mega
Display: CLK 13, MOSI 11, RES 8, DC 9, [CS 10, MISO 12 not used]
GPS: RX 18, TX 19

UNO or NANO
The clock will work equally well using an UNO or NANO. But here you will have to implement the serial port for the GPS in software using the SoftwareSerial library, part of the Arduino IDE installation. The sketch is TFT_ADA_NANO, shown working on the UNO as I don't have a spare Nano around at the moment...


The display has a bit of a lag as the UNO (and NANO) are slower than the MEGA that I originally used.

QSO

The project has obvious use in the Amateur Radio shack for logging QSOs and checking the timing of transmissions - including for example FT8 which must start +/- 1 sec from the 15 seconds boundaries.


Wednesday 2 September 2020

More on Digital SSB generation

 If you look back through this blog you will see (June 2020) a couple of reports of me delving into generating SSB signals using the digital "Phasing Method" using a Teensy processor to do the DSP processing using a couple of Hilbert filters. Hilberts give a band pass characteristic, plus they can be programmed to provide a signal phase shift. The design uses a +45 and -45 deg phase shift to generate I & Q audio signals, which are them fed to a couple of balanced mixers with RF I & Q signals. The result is USB or LSB SSB signals.

The SSB generator. Left Si5351 RF I & Q signals
Centre mixers and audio amp
Right the Teensy processor and mic input

It worked but it had a problem with the Hilbert filters, as they were limited to 70 to 100 taps, the Teensy could not handle a longer filter. This in turn caused the phase shift to move away from 45 deg at low AF frequencies. This then generated opposite sideband break though.

To tackle this I have added a couple of further processing steps. The Teensy processor is mounted on an audio ADC/DAC board and this can provide some audio preprocessing by itself. I have programmed it to provide an EQ with a passband of 500Hz to 3kHz and also an auto volume control, or compressor function. This is the code snippet

  soundcard.audioPreProcessorEnable(); // preprocess -3dB 500-3000kHz

  soundcard.eqBands(1.0, -1.0);

  soundcard.autoVolumeEnable();

  soundcard.autoVolumeControl(0, 1, 1, -10, 0.1, 0.1);

The full code for the app is on my website M0IFA.me here, it is called TEENSY_TX_ABPF.

On a listening test I found a significant improvement in the SSB punch and a reduction on the other sideband and correct side band audio BW.