Monday, May 21, 2018

Home made ubitx box

Inspired by the excellent ubitx.net web site, I have bent a larger box so that the front panel ergonomics are improved. I added a nice tuning knob with finger depression and added a microphone pre-amp, compressor and noise gate board. The tuning knob is on its own on the right (not cramped with the volume control and mic socket) and with the new software it's a pleasure to spin up and down the dial.


I'm just using the mic amp board as it comes with a dynamic mic and levels look good but there's the option to add trimmers for both the compression and noise gate level. I have an output gain control knob in there.


My rudimentary metal work skills are slowly improving and I'm quite proud of the nibbled hole for the LCD display in this one. My nibbler has been sticking, which was frustrating, but a little WD-40 did the trick. I learned from a recent Adam Savage video that WD stands for "water displacement".

Saturday, May 05, 2018

Updated uBitx raduino software

Inspired by the latest edition of the Soldersmoke podcast, I took a look at the updated software that has been created for the embedded Arduino Nano.

My uBitx is looking much nicer since I made a new lid for it and mounted the speaker with a grill made of offcuts from the gutter guard we had installed last year.

I used the latest version of the Arduino IDE 1.8.5. Next I went to library manager and updated all updatable libraries and the same for boards. From the downloaded software from GitHub I opened the ubitx_20.ino file and did a build (the tick button). All built smoothly for me.

The Raduino board (sandwiched with the display) was removed from the uBitx, mainly because the position of my volume control blocks the mini USB port. I removed the display and plugged the board in to USB.

When I programmed it gave timeout errors saying that the board wasn't responding. I tried a different computer and different cables. Finally I tried the "old bootloader" option and all was good.

Along the way I first tried under Linux and then on macOS. The serial driver I needed was found via Bjorn's Techblog.

Now the uBitx is much nicer to tune and there are lots of interesting menu items to explore.

Some of the features are:
  • CAT control
  • S-Meter
  • Software defined radio output
  • Improved receive performance
  • IF Calibration
  • WSPR beacon
  • Bug fixes including CW key debouncing
Great work by KD8CEC and others on all this and of course credit to Ashar Farhan for creating the uBitx and making it all available for hacking.

Update: uBitx to uBitx contact with VK2BLQ

Encouraged by the improved tuning action, Stephen and I had our regular 20m sked with uBitx rigs on both ends. Stephen could hear me over the local noise and I could hear him pretty well when he "talked it up". Both of us have been reading the ubitx site and have independently ordered a low cost mic amplifier/compressor board.

I'm now keen to re-box my uBitx to give more room for the tuning knob. I'm looking for a knob with a finger indent that will screw on to a 6mm shaft. They are about but seem very expensive generally as an after market add on for a commercial rig.

We're also interested in digital modes on the uBitx and of course the best way to do this would be to build in a USB audio interface with VOX. Not sure that I'll go that far but worth thinking about.

Monday, April 30, 2018

First play with OSMO-FL2K compatible VGA dongle

Everyone knows about the popularisation of software defined radio that came about via the wonderful discovery that low cost USB TV dongles with realtech chipsets could be used. Now it looks like we have the same sort of thing but for transmitting.

Some low cost USB VGA adapters are so cheap that they are simply fast digital to analog converters. Steve M from Osmocom has figured out how to turn them into a simple output device suitable for transmitting. Mine came from Aliexpress but others are on eBay locally.

Here I tried a device and used the demo program to transmit an audio file (saved as WAV) over wide band FM to a nearby radio.


I'm on Ubuntu linux so there were some very small deviations from the instructions about USB memory buffer, I had to do this:

sudo sh -c 'echo 1000 > /sys/module/usbcore/parameters/usbfs_memory_mb'

To get some audio to transmit, I opened a 44100 rate mp3 in Audacity and saved it as WAV signed 16-bit PCM file.

The command line to transmit is:

fl2k_fm -s 130e6 -c 35e6 -i 44100 Electric\ Light\ Orchestra\ -\ Telephone\ Line.wav

So far other examples, and there are some amazing ones, require GNU Radio, but hopefully we'll get some more accessible ways to do interesting things like transmit WSPR in the near future.

This is a wonderful example of where the cheaper product is actually more useful than the more expensive versions.

There is a pretty good explanation of how this works in an earlier project VGASIG.

Here's how it looks on an SDR receiver. A little off frequency but looks reasonable to me.


And here's how the 35MHz waveform looks on a CRO:


So when working it's a decent 0.5V peak to peak waveform, DC offset. And a good signal on an FM radio at 95Mhz

I have noticed that this software/hardware works on some Linux machines and not others. It works fine on an Ubuntu 18.04 desktop but not on Fedora machines. When running on some machines it fails silently in that all appears to be running but there's no RF output.

Using the fl2k_file utility I output a sine wave. I can see the sine wave in the dongle output but there is lots of nasty spikes too. I guess a low pass filter could clean this up but it's not a good look.


Please let me know if you've got a better result than I have.

Update: Now getting a better waveform.

I've done some hacking on the FM code, basically stripping it right back and focusing on generating the cleanest wave I can on 40m.


This is running at a sample rate of 150Mega samples per second and a carrier of 7.159MHz. Not great but might be eventually useful (with some filtering) for something like WSPR transmit.

My stripped back version of the source now builds stand alone (no library) and simply generates a sine wave carrier. The source is available here.

Made a small project box

I'm not very good at this and figuring out how much extra to allow for the bend in aluminium continues to elude me but gradually I'm getting there.

The box shown here is still pretty rough but it's good enough for my little projects. Being able to make them at home means I can adjust the size to suit the project.

This morning I looked up Aluminium in Google maps and lucked upon Aluminium Engineering near by in Brookvale. What a wonderful establishment. I purchased a sheet of 0.9mm aluminium and loaded it in to the van.

The shop front is a work of art and should be classified as a heritage building to be preserved for ever.


Inside they're well stocked and the two chaps in there are friendly and informative. The warned me not to try welding 0.9mm which is fine.


Here's the shiny new hand shear which is making all of this cutting pretty easy. A cat is shown for scale.


Here is the current iteration of my box plan.


The measurements in the lid on the right are based on 0.9mm thickness and my dodgy bending. As you can see this makes a 100mm x 100mm x 40mm box. I'm using self tapping screws on the sides and it needs rubber feet to avoid scratching tables.

Sunday, April 29, 2018

Metalwork upgrade - a hand shear to make boxes

I'm terrible at metalwork. Cutting even 0.5mm aluminium sheet is difficult with a hacksaw or jigsaw. Today I went on an expedition to machine tools supplier Hare & Forbes and it was a great place to look around and the staff were friendly.

Half the battle is working out what things are called. I bought a "hand shear" which is like a heavy duty guillotine operated by hand through a big lever. While they had them from $99, I spent a bit more ($169) to get one with a 300mm blade length.

I have owned a small hand brake metal bender for some time but the inability to cut metal cleanly has hindered my use of it so far. Hare & Forbes have a great range. The one I bought is second from the left.



As a first project I bought a rectangle of 0.5mm aluminium and re-made a box lid to replace one I messed up for the uBitx.


My dream is to be able to make small custom boxes for projects. There is much to learn but happily YouTube is a great place to see how to operate this kind of equipment. Peter, VK2EMU, kindly sent me a link to this video about making Aluminium enclosures from Chuck Adams, K7QO.


I've had a shot at a small box out of 0.5mm aluminium.




It's pretty rough but not bad for a first attempt. The trick is to make the top part wider than the lower part by the right amount.

Vanlife: another tour north


This past week I headed north with a friend back to Dorrigo and surrounds. Once again, I was the perfect guest and slept in the van outside the homestead.

Really lovely country and views to be seen as we toured around stopping at some wonderful creeks. The van is going well although it doesn't have a lot of power going up hills.

No radio activity, other than listening to the local FM version of ABC Radio National.

Here's a few photos of the trip. Click to see a larger version.





There is a steam rail museum coming soon they say.





I haven't visited Uluru yet so it was great to see this totally accurate reproduction.


Tuesday, April 17, 2018

OLED GPS display on Arduino with a little C++

 The Arduino language is actually C++ but you never see that unless you look at library source code which tends to be a C++ class. I've written a little code to read the $4.10 GPS and display a bit of info on a small OLED display using the excellent Adafruit library.

To avoid spaghetti code I put the parsing of the NMEA string into a class. This is a quick hack but you don't see many examples like this so here you go.

Just for fun I've boxed this little project up all held together with hot glue and running from a 3.3V LiPo cell. The low price of the GPS along with the low price of an Arduino Nano Pro makes this a very attractive platform for building embedded computing devices.


Update: now with charger

I've added a USB charging board, this one from Jaycar. I have some others on order. This one will not run the Arduino board if the battery is removed, I read that some do and that would be a useful feature.





/*********************************************************************
Display info from a cheap GPS on an Adafruit OLD display
*********************************************************************/

#include 
#include 
#include 
#include 

SoftwareSerial GPS(2,3); // rx pin = 2, tx pin for GPS

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

class NmeaRecord {
  public:
    NmeaRecord();
    void clearFields();
    bool parseLine(char *line); // return true if useful
    
    // GPGGA fields
    enum {
      eLabel,
      eTimeStamp,
      eLat,
      eLatNS,
      eLon,
      eLonEW,
      eFix,
      eSatellites,
      eHorizDilution,
      eAltitude,
      eHeight,
      eEmpty1,
      eEmpty2,
      eChecksum
    };
    // string lengths, +1 for null terminator
    enum {
      kLabelLen = 7,
      kTimeStampLen = 11,
      kLatLen = 9,
      kLatNSLen = 2,
      kLonLen = 10,
      kLonEWLen = 2,
      kFixLen = 2,
      kSatellitesLen = 3,
      kHorizontalDilutionLen = 4,
      kAltitudeLen = 7
    };
    char label[kLabelLen];
    char timeStamp[kTimeStampLen];
    char lat[kLatLen];
    char latNS[kLatNSLen];
    char lon[kLonLen];
    char lonEW[kLonEWLen];
    char fix[kFixLen];
    char satellites[kSatellitesLen];
    char horizontalDilution[kHorizontalDilutionLen];
    char altitude[kAltitudeLen];
  private:
    void storeField(int index, char*field);
};

NmeaRecord nmeaRecord = NmeaRecord();

void setup()   { 
  GPS.begin(9600);               
  //Serial.begin(115200);
  //Serial.println("started");
  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x32)
  // init done
  
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.print("Looking for satellites...");
}


void loop() {
  
  String line = GPS.readStringUntil('$');
  
  // GPGGA,054540.000,3346.7737,S,15113.2178,E,2,12,0.99,94.2,M,21.9
  if(nmeaRecord.parseLine(line.c_str())) {
    display.clearDisplay();
    display.setCursor(0,0);
    display.print("UTC: ");
    display.print(formatTime(nmeaRecord.timeStamp));
    display.print(" sats=");
    display.println(nmeaRecord.satellites);
  
    display.print("Lat: ");
    display.print(formatLat(nmeaRecord.lat));
    display.print(",");
    display.println(nmeaRecord.latNS);
  
    display.print("Lng: ");
    display.print(formatLng(nmeaRecord.lon));
    display.print(",");
    display.println(nmeaRecord.lonEW);
  
    display.print("Alt: ");
    display.print(nmeaRecord.altitude);
    display.print("m   fix=");
    display.print(nmeaRecord.fix);
    display.display();
  }
}


NmeaRecord::NmeaRecord() {
  this->clearFields();
}

// return true if it's a useful line
bool NmeaRecord::parseLine(char *line) {
  char *token;
  token = strtok(line, ",");
  if(strcmp(token, "GPGGA") != 0) {
    return false; // don't parse
  }
  int fieldIndex = 0;
  while(token != NULL) {
    this->storeField(fieldIndex, token);
    fieldIndex++;
    token = strtok(NULL, ",");
  }
  return true;
}

void NmeaRecord::clearFields() {
  strcpy(this->label, "");
  strcpy(this->timeStamp, "");
  strcpy(this->lat, "");
  strcpy(this->latNS, "");
  strcpy(this->lon, "");
  strcpy(this->lonEW, "");
  strcpy(this->fix, "");
  strcpy(this->satellites, "0");
  strcpy(this->horizontalDilution, "");
  strcpy(this->altitude, "");
}

void NmeaRecord::storeField(int index, char*field) {
  Serial.print("Storefield index = ");
    Serial.print(index);
    Serial.print(", field = ");
    Serial.println(field);
    
  switch(index) {
    case eLabel:
      strncpy(label, field, kLabelLen);
      break;
    case eTimeStamp:
      strncpy(timeStamp, field, kTimeStampLen);
      Serial.print("got timeStamp = ");
      Serial.println(this->timeStamp);
      break;
    case eLat:
      strncpy(lat, field, kLatLen);
      break;
    case eLatNS:
      strncpy(latNS, field, kLatNSLen);
      break;
    case eLon:
      strncpy(lon, field, kLonLen);
      break;
    case eLonEW:
      strncpy(lonEW, field, kLonEWLen);
      break;
    case eFix:
      strncpy(fix, field, kFixLen);
      break;
    case eSatellites:
      strncpy(satellites, field, kSatellitesLen);
      break;
    case eHorizDilution:
      strncpy(horizontalDilution, field, kHorizontalDilutionLen);
      break;
    case eAltitude:
      strncpy(altitude, field, kAltitudeLen);
      break;
  }
}

String formatTime(String timeString) {
  String newTime = timeString.substring(0,2);
  newTime += ":";
  newTime += timeString.substring(2,4);
  newTime += ":";
  newTime += timeString.substring(4,6);
  return newTime;
}

String formatLat(String raw) {
  // 4807.038,N   Latitude 48 deg 07.038' N
  String result = raw.substring(0,2);
  result += " deg ";
  result += raw.substring(2,7);
  return result;
}

String formatLng(String raw) {
  //  01131.000,E  Longitude 11 deg 31.000' E
  String result = raw.substring(0,3);
  result += " deg ";
  result += raw.substring(3,8);
  return result;
}

Monday, April 16, 2018

The VK3ZZC "Horror" transmitter

A fond memory from my early days of ham radio was talking with Ralph, VK3ZZC, on 2m as he drifted up and down. To my amazement he was using a home brew valve transmitter he dubbed the "horror mitters".

I just noticed that he has written a post about this project here. It's worth having a look through all of Ralph's site as there's lots of good stuff.

In my view this transmitter is a thing of beauty.

(Photo from Ralph's site, used with permission).

Low cost Neo-6M GPS works well

Ross, VK1UN, tipped me off to these GPS modules available from Aliexpress for AU$4.10. At that price I ordered 2. Here's the ad as it appears at the moment.


Here's me running it via a USB serial device supplying 3.3V. The specs say it will run from 3.3 - 5V. Default baud rate is 9600 and amazingly these devices have the 1Hz PPM output which used to only be available on the more expensive modules.


With a little bit of tinkering I've now got it displaying on an OLED display. Makes a nice clock for the shack.


Amazing that a device costing $4 can receive satellites.

Sunday, April 15, 2018

Vanlife: another tour south

I'm back from a tour south from Sydney ending up in Melbourne. Gradually I'm learning how to find places to stay that I like.

My preference is for places that are very quiet and look out at water or nice bush. The most up to date reference is the WikiCamps app. (This is a very poorly designed app, but the information in it is good). Reviews of camp sites are naturally in terms of what the reviewer likes so you tend to find great reviews for crowded sites that happen to have clean toilets.

Caravan parks can be nice if the unpowered sites are well away from the powered sites where the giant caravans tend to go.

The trick seems to be to find locations on WikiCamps and then check them out from Google's satellite view to get an idea of the layout.

On this trip I met up with my sister Jane and her partner Paul who have a lovely "teardrop" trailer.


It's very compact and presumably easy to tow. You sleep inside but it's pretty cramped but comfortable.

I also met a wonderful French Canadian couple who had sailed to Australia and are now touring around in a van.


It's fascinating to see how vans are configured. They shared red wine with me which they gleefully said had come from Aldi and wasn't too bad for $5.

One trick I've discovered is sleeping in the bush and then visiting the sea for breakfast and a swim.


It's lovely sitting in the van and having vastly different views from day to day.



The configuration is gradually changing. These days, when parked, I fold the passenger seat down and place the fridge there so there's more cabin space. I have a small folding chair from Banggood and this was great on a day when there was rain.


The mosquito net (there were mosquitoes and wasps at this site) is held up with magnets.

The van is going pretty well but the oil light came on and it needed a bit over a litre of oil to be filled up again. It's now done 378,000 Km and I'm not sure if it's normal to be using some oil like this.

Tuesday, April 03, 2018

WSPR Watch iOS app updated



Since retiring from full time work over a year ago, I've had a break from iOS programming. Doing something as a job is a great way to lose interest in it as a hobby.

Recently, after a dalliance with Google's excellent cross platform framework Flutter (and the Dart language),  I decided to have a play with the latest version of Swift, 4.1. I'm pretty familiar with the Cocoa frameworks but in line with Swift conventions many of the APIs have changed. Happily, Apple's documentation browser is excellent these days.

WSPR Watch is a free app I wrote some years ago basically for myself to provide a quick way to check for WSPR (Weak Signal Propagation Reporter) signal reports from a phone without having to use a web browser.

Over the past week or so I re-wrote the app in Swift 4.1 and found this a very pleasant environment to work in. A problem with the rapid changes in the Swift language in recent years is that when you search for how to do something you'll find a version of the code that isn't quite right with the latest Swift. This problem will hopefully diminish over time.

The other thing that's changed dramatically for the better is the whole process of submitting an app to the Apple store. What used to take a week now takes hours and the process is much more straight forward than it used to be. App signing used to be a buggy mess but now seems to work reliably too.

Thanks to my beta testers and particularly Ross, VK1UN, for bug reports and feature suggestions.

Saturday, March 31, 2018

Leadstar D12 TV with Raspberry Pi

The Leadstar 12V TV I bought for the van has HDMI input and it's an obvious possible display for a Raspberry Pi.

The screen's native resolution is 1280x800 but by default the Raspberry Pi doesn't offer this resolution in the GUI configuration software.

By default the Pi outputs 1080 lines which is readable on this screen but a little fuzzy.

To get the Pi to output the native resolution I edited /boot/config.txt as follows:

hdmi_group=2
hdmi_mode=27

This now boots up in 1280x800 at 60Hz and works nicely. As mentioned in a previous post this TV cost $130 on eBay and seems decent. It runs on 12V and has an internal re-chargeable battery. The built-in software doesn't know about the Australian band plan. The seller sent me a RAR archive with new software but for some reason it doesn't like it and won't update.

Anyhow, this is a good screen for a small Raspberry Pi setup.


Friday, March 30, 2018

Increasingly irritating trying to read text on the web

Presumably desperate measures to fund journalism are leading to increasingly intrusive ads but I'm finding reading text on line is getting difficult. Here's what it's like opening a story on Vice.com:


Ads load above content, scrolling down what I'm reading. Ads slide up from the bottom obscuring the text and animation down the right draw my eye. To top it off, Safari now warns that significant energy is being used - maybe they're mining crypto-currency too?


Safari now won't auto-play videos with sound and soon Google Chrome will do the same thing plus block other annoying styles of ads. This is a war for our attention and I doubt it will stop there.

The answer on macOS and iOS is to use "reader view" which works well on most sites but strips away all the design. I've set reader view as on by default on some sites and maybe that's the answer.


Sorry for the rant but reading the news shouldn't be irritating. Note that I pay for Fairfax and Guardian but like to read more widely.

Tuesday, March 27, 2018

Vanlife: Improved electric system

The van came with a big box of batteries and wires in the middle of the space behind the driver's seat.

This box was a bit of a mess and contained two different sorts of batteries in parallel. There was a Redarc SBI12 relay that lets the auxiliary battery charge from the alternator but it avoids flattening the starter battery by only connecting when the motor is running and the alternator voltage is good.

Mysteriously though the 60A fuse was blown...

I ripped all the old stuff out and have been gradually re-using bits and getting things going again.

This week I figured out the correct wiring for the Redarc SBI12 and confirmed that it's working correctly. This will be particularly important if I'm out and not getting enough sun to run the fridge.

The 12V cable from the starter battery emerged from a hole in the floor and this morning I paid a few hundred dollars at an auto-electrician to run a new cable and remove the old one. Also I've mounted the old switch box in a plastic case screwed to the wall. All looks much neater now.


There is still room for improvement but it feels more spacious and I'm happy that I now understand how everything is wired.

The auto-electrician put the van up on a hoist which let me take a good look underneath for the first time. There's a few mystery wires hanging down and I can see the replaced differential but otherwise it looks pretty good for a van that's done 378,000Km.




In other news, I've purchased a 12 inch TV that runs on 12V for the van. $130 on eBay. It seems to be a Leadstar D12 and has the ability to play from USB or SD card and can record off air. Having HDMI in means that it might be useful as a portable screen for a Raspberry Pi project.


The TV is re-chargeable but I read reviews saying that it only runs about 2 hours. It came without the Australian band plan but I scanned in Czech and it seemed to find channels. The seller has sent me new firmware which I'll flash shortly.

Update

I took the TV but never used it and will keep it for Raspberry Pi use.