Tuesday, May 01, 2018

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.

Monday, April 30, 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.

Sunday, April 29, 2018

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.


Wednesday, April 18, 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;
}

Tuesday, April 17, 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).

Monday, April 16, 2018

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.

Wednesday, April 04, 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.

Sunday, April 01, 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.


Saturday, March 31, 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.

Wednesday, March 28, 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.

Sunday, March 25, 2018

Home brew group meeting: switching HT supply and Raspberry Pi SDR

Today the ARNSW Home Brew Group met at Dural for our regular bi-monthly meeting.

John, VK2ASU, demonstrated GQRX SDR software on a Raspberry Pi using an RTL-SDR dongle to receive 2m stations. Performance was amazingly good for such a small computer.

I had tried something similar recently, on Raspian, but my GQRX crashed on start up. John seems to have figured out that the settings file must be edited before launching to avoid this problem.

My favourite thing is John's cooling arrangement as he finds the Pi gets rather hot when working as an SDR (Software Defined Radio).


John also brought a low cost Android tablet which can be used as a pretty good SDR.


The main talk by Mike, VK2BMR, was the story of his project to build a 2.5KV regulated power supply.


It was a fantastic presentation where Mike described his journey to build a power supply that could easily kill you if something went wrong. In the end he has achieved excellent performance and efficiency. The best bit of these presentations is to hear what went wrong and how it was debugged.

At the trash and treasure I picked up a home brew radio with a lovely reduction drive.


Something I haven't seen for a few years was an OLPC laptop that seems to run Linux quite well. Not sure what happened to these devices, I know they failed to hit the $100 price point at the time but perhaps Raspberry Pi's have taken over from these but I still wish we had a durable laptop version.


A lovely day at Dural again.

Vanlife: A new driver's seat

When I got the van it had three seat covers layered one on the next. Taking them off revealed the reason - the driver's seat foam had fallen apart on the side, presumably due to the driver sliding out again and again.

Enquiries at a panel beater pointed me to an upholsterer who did a great job as you see here. Interestingly they make the seat from scratch, sculpting foam and sewing the cover. It cost $385 but given how important it is to have a comfortable seat for long drives I think it's worth it.