Tuesday, 10 July 2018

Lanark North Leeds ARES

HF, UHF, VHF and digital radio communications
* support for emergency response agencies * 
* participation in non-commercial community events *
* local and province wide communications * 
* amateur volunteer radio operators working from their homes or on site *

Primary Contact:
Barrie Crampton VE3BSB, Emergency Coordinator

To apply as a volunteer: call 613-264-8836 or send an email


Grant DixonVE3CGV
Al NiittymaaVA3KAI
Robert BellVE3NZQ
Ron McFadyenVE3YXY

In the spirit of collaboration, Rideau Lakes ARC is providing this space for our local LNL-ARES Group.

Wednesday, 3 January 2018

BITX40 Software Modification

This is my third post in a series about building and hacking a BIT40 radio. The previous post may be found here.

For future reference links to all the Arduino software, articles and discussions I write about can be found on the Arduino Links Page which is listed in the Pages and Links gadget to the right.

In post one I built the radio. In post two I employed some hardware hacking to correct an unfortunate property of my radio. You may have to do something similar, or maybe your radio works well out of the box. Now it is time to look at how we can modify the radio operating software.


Installing Arduino Integrated Development Environment (IDE).


I could write a lot about installing the Arduino IDE, but it would be difficult to come close to what the Arduino folks have already written. So follow that link and read up about programing the boards and install the IDE on the system(s) you want to use. If the system you want to use is a Raspberry Pi, don't worry. Installing the IDE on a Pi is very easy and the people at MagPi have you covered. Actually even if you aren't going to use a Raspberry Pi that article is still a recommended read.




There are a number of choices of available software:
  1. Farhan's original code, with updates since your Raduino was programmed.
  2. Munters mods which support a series of hardware mods and provide some attractive features.
  3. Costa's fork of Farhan's original and his own Si5351 library. This supports some of Munter's mods and adds some others.
  4. Your own mashup taking pieces from these or other sources and adding your own features.
All of these are possible. I will walk through option 2 in this post. Of all the options this is the one I recommend starting out from. It is feature rich and has ongoing development and support. You will want to implement at least the function button hardware mod.


 A Word About GitHub


The git program is a very advanced source code control system that allows multiple developers to work on a body of code and manage the issues which arise therefrom. The use of git tools is beyond the scope of this post so I will be showing you the simplest way to get the code. If you want to contribute back with your own work, or even if you just want to be able to get the latest updates easily you should look into using git and GitHub.

 Munters Mods


The source code for Munters sketch is on a GitHub repository.
Munters GitHub repository
To download the latest release of the code click on the green "Clone or Download" button and select "Download ZIP":
Use your favorite ZIP management tool to extract the contents to the sketches directory you created when you installed the Arduino IDE. Because I am working with three (or more) options and each will have a sketch called bitx40 I also created a sub-directory for each option, in this case Munters:

As you can see the extracted directory is called bitx40-master. This is a feature of GitHub encoding the branch on into the ZIP file. Double click on the raduino_v1.27.3 Arduino file to open the sketch in the Arduino IDE. The IDE will complain about the sketch name not matching the directory name. Just click "OK" and the IDE will sort it out for you. Open the Tools menu and set the Bord to "Arduino Nano".

Before we can compile the sketch we need to ensure we have access to a library. In the readme file for the code starting at version 1.27 the PinChangeInterrup library is required. The Arduino IDE manages well know libraries very well. From the Sketch menu go to Include Library and select Manage Libraries... Enter PinChangeInterrup where is says filter your search:
Select the entry for the PinChangeInterrupt library and click Install.

You can now Verify and Compile the sketch by selecting "Verify/Compile" from the Sketch menu. This should compile without warnings or errors. Now the sketch is ready to be uploaded. Connect the Raduino to your development machine with an appropriate USB cable. If the radio is off this will power up the Raduino and start running whatever sketch was previously loaded. Using the Tools menu make sure the correct Port is selected. Consult the Arduino getting started guide if you have to. Now you can upload the sketch by selecting "Upload" from the sketch menu.

Enjoy your updated BITX40 software. Make some of the hardware modes as well. If you want a quick and easy taste of what making software mods can do try this. Somewhere around line 460 you will find the printLine function. The original looks like this:

   Display Routine
   This display routine prints a line of characters to the upper or lower line of the 16x2 display
   linenmbr = 0 is the upper line
   linenmbr = 1 is the lower line

void printLine(char linenmbr, char *c) {
  if (strcmp(c, printBuff[linenmbr])) {     // only refresh the display when there was a change
    lcd.setCursor(0, linenmbr);             // place the cursor at the beginning of the selected line
    strcpy(printBuff[linenmbr], c);

    for (byte i = strlen(c); i < 16; i++) { // add white spaces until the end of the 16 characters line is reached
      lcd.print(' ');

Change the function prototype (the first line of the function) by adding const in front of char *c like this:

void printLine(char linenmbr, const char *c) {

Then add these three lines immediately after the function prototype:

  if (linenmbr == 1 && strlen(c) == 0) {
    c = "your callsign";

This is a kludge, there is a much better way but it involves changes scattered around the source code. I have created a request to have the code included in Munters' repository. In the mean time you can get the updated source from my repository. These changes are now incorporated in Munters' repository.


Tuesday, 2 January 2018

Sometimes Hacking is done with a Soldering Iron

This is my second post in a series about building and hacking a BITX40 radio. The series starts here.

Some BITX40 radios -- including mine -- built as designed exhibit tuning clicks. That is as the DDS frequency changes there is an audible click in the speaker or headphone output. There is some debate as to the cause. Some believe it is the result of how the DDS circuit is handled in software and that it can be fixed in software. Pavel Costa has written a library that has a number of benefits, including eliminating the tuning clicks. That link has some interesting reading, and the first thing I did was to compile and install his software and his modification of the BITX40 sketch. I still had tuning clicks, so not entirely a software problem.

The other solution proposed on the internet was that the Raduino voltage regulator was insufficiently decoupled from the 12VDC supply. Heavy computing and circuit use surrounding a change in frequency would cause an increase in current draw, which was bleeding back across the regulator to the main power circuits and appearing in the amplified audio. There are a number of ugly and somewhat dubious solutions adding components to the back of the Raduino board. None of these appealed to me so I took a different route.

If the problem is decoupling of the voltage regulator I could de-solder the regulator from the board, replace it with a header, then I could experiment with the required circuit. So that's what I did.
Raduino with regulator replaced by header.
While the iron was hot I also soldered in a 5 pin header in the area used for other hacks to make things easier in the future.

With the header in place I could put the regulator on a prototyping board and build up the required circuit. I found a 66 ohm resistor in series with the input 12VDC line and a 333uF capacitor between the 12VDC line and ground eliminated the tuning clicks.
Prototype decoupling circuit.
Here are some YouTube videos of the radio tuning without and with the added decoupling circuit:
All that remained was to transfer the working circuit to a permanent board and install it in the radio.
Final decoupling circuit.
As an added benefit this board now has the main 12VDC, Raduino 5VDC and ground so it is perfect for other hacks and experiments.


Monday, 1 January 2018

Building a BITX40 40M SSB Radio

This is the first in a series of posts about the BITX40 radio, the next post is here.

The radio kits from HF Signals are quite popular because they are:
  1. inexpensive;
  2. hackable in both hardware and software;
  3. well supported;
  4. work well considering they are inexpensive and hackable.
The kit doesn't come complete, which makes it easier and less expensive to ship. But that does mean you will need to come up with a power supply, a case (or at least some way to mount the boards and controls), complete or find a microphone assembly and some others things. Some may see this as a drawback, but I see it as an advantage if your goal is to experiment with the radio rather than simply use it as you would any other appliance. You have the option of only building that which you need for you experiments.

My radio kit arrived in September but I did not really have time to put the radio together, and had not decided on a case. I finally settled on a case from Amateur Radio Kits World-Wide, the colour is very nostalgic of my days as a signalman.

Universal Case Siemens Grey II & Accessories

It comes with some useful parts not included with the BITX40
The case, like the BITX40 ships from India, but the only shipping options is by Post. Never the less it arrived at my mailbox in Canada less than three weeks after I ordered it right in the middle of the holidays. Perfect timing to put it together.

The first thing I did was test fit the boards and parts into the case. Doing this while reading the wire up instructions gives you a better idea of how the wires traverse the case and a chance to consider various options. I learned three things while doing this.

First, the BIT40 diagram is a bit confusing because it shows the Raduino board from the side facing the front of the case, rather than the side you would be looking at while running the wires. The text instructions are better, but again from a point of view I would not have chosen. But this is not a huge problem.

Second, I had to ream out some of the mounting hols to get them large enough to mount the parts. Again not a huge problem, nor unexpected since the case is powder coated, but one you should be prepared to deal with.

Third, the voltage regulator on the Raduino protrudes past the left side of this style of case. Again easily dealt with by carefully folding the regulator the other way.
Voltage regulator folded back between the Raduino and the LCD display.
The rest of the installation was quite easy as described on the BITX40 web pages.
Left side of the radio.

Right side of the radio.
If you look closely you will notice that I have not completed the hook up. I have not:
  • provided for MIC or headphone jacks,
  • installed a PTT switch or any way to get the radio to transmit,
  • trimmed the shaft of the tuning pot.
This is because I intend to do a number of modifications. The first step in this process will be to decide on which firmware to run. But these are discussions for a later post. I will leave you with pictures of the front and back panels and an anecdote of my first test.
Front panel.

Back panel.
The only antenna I have at home is a 2m ground plane whip in my attic which works well for me on 70cm as well. Once the radio was completed and knowing there was no way I could accidentally transmit and perhaps damage the rig I hooked up this antenna and started tuning around the band. I quickly game across a stations calling "CQ contest" likely for this RAC event. I was able to make out some VA3 call signs. Some more tuning and I came across a station from Long Island NY calling "CQ DX" and listened to him for a while. Not a bad days work as a HAM if I do say so myself.