An annoying fault (solved)

John  VK2ETA raised a request for help on the group list on 24 January after spending over a week trying to figure out an issue he had with his uBITx.

The problem

John built his uBitx around a manpack configuration with an external side mounted heatsink, no connection at the back, and room for an autotuner.  The issue he had was strong audio tones inside and outside the passband on receive, typically up to 15khz.

He attached an audio recording and took some audio spectrum snapshots made by placing the phone’s microphone near the uBitx speaker.  The tones were often near or above the level of the decoded signal which makes them impossible to ignore.  The frequency of the tones did not change significantly with tuning up or down, or going through the menu items except when passing over the “CW Speed” option.

After doing all the normal things you would expect, such as redoing the factory alignment and BFO adjustment several times, nothing changed.  He changed out the power supply (with three alternatives), he checked the voltage on the Radiuno: 5.01VDC, added capacitors from the Radiuno 5V rail to ground (470uF, 0.1uf mica, no change), power supply rail to ground (470uF, no change), and added 1nF between the  casing of the Arduino crystal to ground (which produced a shift in tone, but no reduction in amplitude).  He modified the software where I would shift the frequencies of both the first and second oscillators by the same amount, thereby leaving the received frequency the same. The result was no change in frequency of the annoying tone. So only a BFO frequency change produces a shift in tones.

Needless to say John was right out of ideas and welcomed input from the group.

Group responses

Jerry KE7ER immediately responded:

Your best bet might be to either replace the nano or replace the 16mhz crystal on the nano.  It might be possible to shield and filter the nano sufficiently somehow, but that would be tough.   It could be that HF Signals would consider replacing your Raduino.  You might ask them.   Do you have somebody nearby you could swap out the Raduino with, to see if the problem follows the Raduino?

There were a number of other responses from group members, and other group members had observed similar issues with tones inside the filter passband.

The problem solved

On 2 February 2018, John announced to the group that he had solved the problem:

“I bought a cheap Arduino on eBay and after some struggle I changed the Nano, re-programmed it and all came good. The tones within the passband are gone and the ones outside the passband can be eliminated with a careful choice of BFO frequency.  Also the tuning noises have disappeared.  So it must have been a bad Arduino.

“As an interesting aside, when chasing this issue I changed the first two mixers VFOs thereby changing the alignment between the 45Mhz filter and the 12Mhz one. I noticed that the default values produced a signal around 8dB lower than when “re-aligning” the two passbands.

“If anyone is interested I can share the code for this test (I simply re-assigned the RIT menu item and had an extra variable which was added to the first two VFOs so that the net received frequency stayed the same, but the first IF was shifted correspondingly).

“Please note that I found the removal of the Arduino a challenge and resorted to cutting the edges out of the Arduino board with a Dremel.   I cut the plastic spacer between each pin to be able to de-solder each pin individually.”

“Since I have mounted the display remotely and have space in front of the Raduino, I opted to use female headers so that I can plug/unplug the Arduino, just in case.”

It turns out that Jerry KE7ER’s advice was spot on.   Afterwards he commented:

“Could be that the old arduino had a faulty 16mhz crystal.  But that thing is tiny, swapping in a different crystal would be tough. Could also be that the ATMega382P processor had a faulty oscillator.”

Ashhar Farhan from HF Signals has since commented on this fault:

“Since we noticed these problems, we do check for the presence of these tones. Our pass test includes viewing the audio spectrum at 5v/db, 625 hz per division setting of FFT on rigol. We set the carrier so that the audio passband is inside two cursors at 300 hz and 3000 hz. Then we check for any spurs upto 15 khz that are above the noise floor. If these tests pass, we move to the next test of transmit outputs on 3.5, 7, 14 and 28 mhz. These tests are a part of the firmware being shipped.

“I suspect the 16 mhz crystal must have aged. There are two things you can try. First is go into the bfo settings and move it slightly so the spurs go away. Second is to add some capacitance to the 25 mhz crystal, about 10 pf. There is a third way too, which is to program the si5352 initialization code to enable a different load capacitance on oscillator. I havent tried the third method myself.

“Very often, closed commercial designs tend to ignore or bury design faults. Open source proceeds with acknowledgment and fixing these to make the system better. As the saying goes, given enough eyeballs, all bugs are shallow.”

Reference

Relay K1 mod

Fred PE0FKO asks a question about relay K1 after looking at the very nice schematic of the uBITX.

“The K1 relay is used for the RX and TX power switching and also for connecting the antenna in RX to the LP filter.   On RX (and TX) the LP filter is also a connection to the TX power amp by C80, that will give a (very) small load on the antenna signal at RX and a mixer (Q90 diode BE) for strong received signals?  Could it be improved by switching pins 12 and 14 of K1 and connecting pin 16 of K1 to C80 (removing the connection to the Low Pass filter)?”

Jerry, KE7ER responded:

“It’s a good idea to make use of K1-16 to disconnect Q90 during receive.  This would also protect Q90 from local QRO transmissions into a local antenna,   The similar Q13 on the Bitx40v3 is often blown in such situations, even when the rig is powered down.”

Alf Baranda asks:

“Can it be the Mod that I have highlighted?”

Of course it is the same mod!   Alf goes on to  attach images with the signal paths in the RX and TX modes.

REFERENCE

 

Using a dynamic microphone

Dennis Yancey asked the group “Has anyone used a dynamic mic on the uBITx?”    Dave WI6R responded with a guide for modifying the uBITx to use a Dynamic Mic:

Referring to the uBITX Schematic.   The Gain of the Mic PreAmp is controlled by R63 in the Emitter of Q6 to C62/R64.  It basically decouples the audio bypass of R64 by C62 to limit gain for the high output Electret Mics.

Substituting a Dynamic Mic

Replacing R63 with a Zero Ohm resistor and putting a 10K potentiometer at the Mic input should allow a Dynamic Mic to work now with a Mic Gain Control.  Also, R60 that supplies Mic BIAS to the Electret-Condenser Mic needs to be removed.  If there is not enough gain after this mod, you might have to reduce the value of R64 to maybe 470 Ohms or so. 

If you cannot look at your transmitted signal on a scope at least listen to your audio on another receiver to verify you are not causing distortion.

More Gain for an Electret Mic
To simply get more gain with an Electret Mic you might try dropping another 47 Ohm resistor on top of the existing R63.  You can solder another chip resistor on top by soldering one end at a time.
[EDITOR:  you can also bridge the surface mount resistor with a standard through hole resistor.  Shorten the leads and bend over about 1/8″ or 3mm for soldering to the ends of the surface mount component]
Reference

A nice looking aluminium enclosure

 

And another aluminium case suggested by wishbone_aaa:

https://www.circuitspecialists.com/metal-instrument-enclosure-la-6.html 

Jim Sheldon, W0EB says:

“I’ve got one on backorder for my third uBITX. The uBITX should ship pretty soon, so I hope the case backorder doesn’t take too long.  I’ve used the smaller versions of this case on other projects and it’s really nice to work with, but the aluminum front and back panels are really soft aluminium. Be careful drilling holes and cutting out the LCD window.”

Reference

Arduino Nano Lights

John Backo answers the question:  “What are those lights on the nano anyway? And do I need them?”

There are usually 4 LEDs on the nano. They are usually in a row and labeled “RX TX PWR L”.

The RX and TX lights are connected to the lines that connect both the USB interface and the ATMega628P. They connect to TX0 and RX0. They are very useful as their flashing shows that communication is taking place during an upload. Likewise, if RX flashes once and then not again during an upload, there is a communications problem. Usually they are red and green; some may be orange. Messing with them will probably mess up RX0 and TX0. It is best to leave them alone. They are always out (low) with no serial communication to the chip. If they stay on, something is wrong…

PWR refers to a direct connection to the voltage regulated 5v line. It is NOT connected to the input voltage, whatever that may be. It is an indication that the board has power either from Vin or USB. That is all it does. It is usually red though I have seen many orange lights. It is useful, but it could be eliminated, I guess.

L is connected to D13. It is a good light and should not be disconnected. If the ATMega has a bootloader (which it should in a nano) this will flash three times when the reset button is pushed and released. That is not guaranteed because earlier versions of the bootloader did not show themselves through D13. And if the ubiquitous Blink program is loaded, it will falsh D13. That alone makes it a good light to retain. It is your “diagnostic visual indicator”.

Reference

MAX9812 Mic Pre-Amp conclusions

David N8DAH has been testing the MAX9812L Mic Pre-amp module on his BITx40.  In theory this should improve the gain and signal quality.

David says “So far its working ok at best I sound a bit robotish.”

“I am TXing at around 20w with my amp. I took the audio out through a 10uf dc blocking cap to the bitx40 mic in.  I powered the board from a 9v just for testing.  R136 is about 1/4. If you use a pre-amp you should adjust this lower or you will cause one heck of a noise on tx.  I am not yelling or shouting to get audio out now but not sure I like the audio in any case.

This is without the pre-amp … with the audio files from Michigan to Milford PA websdr

This is with the pre-amp …

David has decided he “might just stick with the slight yell to get the audio out. I like the idea of not having to shout but do not like the audio from this version of preamp”.

Others may think differently.  Mike ZL1AXG thought his “more robot-like” voice was more intelligible because it was more “punchy”.

Jeff AD6RH says:

“I used another mic housing with a DPDT switch and wired it so voltage is supplied only when PTT is engaged. I am using a CR2032 3v button cell. It seems to work fine, but I have not compared the stock vs. preamp mic with anyone on the air yet. It definitely has more average power on the watt meter. I can hear some peaks come thru the speaker when transmitting. I may try installing a pot to dial back the gain.”

Reference

AGC for uBITx controlled by I2C via Software

Nick VK4PLN admits he has tried just two AGC approaches on BITx rigs: the VK3YE AGC (which is shall we say very illuminating) and the ADAFRUIT TPA2016 I2C module.

Nick found the VK3YE solution messed with the audio quality, made it all scratchy, and still didnt handle local 100w stations well …

Now after playing with the TPA for a few days he is very happy with the results.  Audio has good depth and AGC is responsive, and the unit also gives a nice increase in gain.

One trick for others who want to implement this,  is that you will need to add some code to the Adafruit library to implement the enableNoiseGate(false); function.    We need to turn the NoiseGate off or else the AGC will not ramp up with only background noise and you will not hear anything until a loud signal comes on.  [EDITOR notes that this could be used as a kind of SQUELCH function].

Also the speaker output is NOT grounded, you need to isolate your SPEAKER jack so that the – ve line from the TPA2016 is direct to the speaker with no chassis grounding…   Output from the amplifier can’t be fed into another amplifier.

The Best part in Nick’s opinion is that all of the AGC related settings are customisable if you want.  If not, just use the voice settings from the datasheet.   Nick says the defaults work great!

Stereo 2.8W Class D Audio Amplifier – I2C Control AGC – TPA2016

Nick says he will post the code to the list along with a few pics… This extra info should appear here shortly.

REFERENCE

And the board installed in Nick’s uBITx can be seen below.  It looks a real tidy build!

Software

Nik has now shared his software:

/*************************************************************************
VK4PLN’s AGC Code. Adafruit TPA2016
Add call to setupTPA2016(); to main code setup() in ubitx_20 after initOscillators();
**********/

#include <Wire.h>
#include “Adafruit_TPA2016.h”

Adafruit_TPA2016 audioamp = Adafruit_TPA2016();

void setupTPA2016() {

audioamp.begin();
// See Datasheet page 22 for value -> dBV conversion table
// Serial.println(“Right off, Left On,”);
audioamp.enableChannel(false, true);

// Noise Gate Threshold: Below this value, the AGC holds the gain to prevent breathing effects.
//Select the threshold of the noise gate (1,4,10,20mV) (0-3)
// Serial.println(“Noise Gate Threshold,”);
//Disable NoiseGate, we want to hear everything, even weak signals….
audioamp.enableNoiseGate(false);
audioamp.setNoiseGateThreshold(0);

// Fixed Gain: The normal gain of the device when the AGC is inactive.
// The fixed gain is also the initial gain when the device comes out of shutdown mode or when the AGC is disabled.
// value 6 seems to work ok… based on datasheet. Where gain is from -28 (dB) to 30 (dB)
// Serial.println(“Setting Fixed Gain”);
audioamp.setGain(-12); //-27 is ok? -12 is too high local stations arnt clipped…

// Compression Ratio: The relation between input and output voltage.
// AGC can be TPA2016_AGC_OFF (no AGC) or
// TPA2016_AGC_2 (1:2 compression)
// TPA2016_AGC_4 (1:4 compression) * Datasheet – Voice
// TPA2016_AGC_8 (1:8 compression)
// Serial.println(“Setting AGC Compression”);
audioamp.setAGCCompression(TPA2016_AGC_8);

// Limiter Level: The value that sets the maximum allowed output amplitude.
// Serial.println(“Setting Limit Level”);
audioamp.setLimitLevelOn();
// or turn off with
//audioamp.setLimitLevelOff();
audioamp.setLimitLevel(30); // range from 0 (-6.5dBv) to 31 (9dBV) (8.5dBv(30) as per datasheet)

//Maximum Gain: The gain at the lower end of the compression region
// Serial.println(“Setting AGC Max Gain (18-30db – (0-12)”);
audioamp.setAGCMaxGain(12);

/*
* For voice systems the attack time should be in the 2-ms region, with a hang time of about 0.3 sec,
* followed by a gradual recovery time of up to 1 sec.
* http://www.qsl.net/va3iul/Files/Automatic_Gain_Control.pdf
*
*/

// See Datasheet page 23 for value -> ms conversion table
// Serial.println(“Setting AGC Attack (0.1-6.7ms – (0-63))”);
audioamp.setAttackControl(3);

// See Datasheet page 24 for value -> ms conversion table
// Serial.println(“Setting AGC Hold (0.0137-0.8631ms – (1-63))”);
audioamp.setHoldControl(0);

// See Datasheet page 24 for value -> ms conversion table
// Serial.println(“Setting AGC Release (0.0137-0.8631ms – (0-63))”);
audioamp.setReleaseControl(4);

}

Also, need to add this new function to Adafuit library after the existing enableChannel function:

// Turn on/off Noise Gate
void Adafruit_TPA2016::enableNoiseGate(boolean ng) {

uint8_t setup = read8(TPA2016_SETUP);
if (ng)
setup |= TPA2016_SETUP_NOISEGATE;
else
setup &= ~TPA2016_SETUP_NOISEGATE;

write8(TPA2016_SETUP, setup);
}

And the line for the header file:

void enableNoiseGate(boolean ng);

in .h file:
void setNoiseGateThreshold(uint8_t thresh);

in .cpp file

void Adafruit_TPA2016::setNoiseGateThreshold(uint8_t thresh){ //Added by VK4PLN
if (thresh > 3) return; // max threshold is 3 (20mV)
uint8_t agc = read8(TPA2016_AGCLIMIT);
  agc &= ~(0x20);  // mask off bottom 5 bits
  agc |= thresh;        // set the limit level.
  write8(TPA2016_AGCLIMIT, agc);
}
Reference

Warning: Some uBitx kits shipping with incorrect female connectors

KF2510 headers in uBITx

There are two 8 pin wiring male headers in the kit – one on the main uBITx board and the other on the Raduino.  Today, Arvo KD9HLC started assembling the wiring on his kit.  He found that the female plugs didn’t match the headers on the board.  After a bit of head scratching and further investigation he found that the female header plugs with flying leads only had 7 pins!

It is likely that other kit purchasers may have the same issue.

These headers are of KF2510 type, widely used in China and are very affordable.  Sets of 50 male/female pairs of 2, 3, 4 and 5 pins are available for about US$3 ex China if you can wait.  And 8 pin females can be found on the various Chinese merchant sites as well.   However, these headers are a bit harder to source in the US.   In NZ and Australia they can be sourced from Jaycar.

THe uBITx kits come with  2 x 8 pin, 1 x 3 pin, 1 x 2 pin wiring harnesses with KF2510 female plugs.   The Raduino unit connects to the main board with a 16 point pre-soldered header.

HINT:   You can substitute ordinary Dupont header strips or single female pins.  They won’t be polarised, so you will need to be careful making connections.

Reference