Scientific Computing

CB Radio President P channels

The mapping between CB radio channel to President P channel and coded squelch is:

President P channel CB channel Center Frequency (MHz) coded squelch
1 1 26.965 94.8 Hz
2 3 26.985 D073N
3 11 27.085 131.8 Hz
4 18 27.175 D624N
5 24 27.235 203.5 Hz

Some newer President CB radios have preprogrammed FM mode with CTCSS squelch on “President P channels”:

Name Model FCC ID
Bill III FCC TXUS201 2AEOCPC210
Johnson III TXPR767
Barry II+ TXPR122
Taylor IV CL TXPR423

Similar to some OEM FRS / GMRS radios that have preprogrammed channels with CTCSS or DCS codes, the P channels are a convenience that immediately allow users with CB radios having FM and CTCSS to interoperate with each other. We welcome preprogrammed P channel-like features with FM and CTCSS as they are likely to increase usage of FM mode and CTCSS on CB radios. This gives the benefits of maximum range with minimum interference. Before these preprogrammed channels, setting CB radio CTCSS coded squelch involved diving through menus.

Using FM mode with coded squelch experiences much less disturbance from adjacent channel splatter versus the AM mode with signal squelch.

Weather radio channel to frequency

While dedicated NOAA NWR weather (WX) radios are available, two-way communications radios such as CB radio and GMRS etc. can also have 162 MHz weather radio receivers. 162 MHz WX radio is a one-way radio service that broadcasts weather information and emergency alerts across much of the USA, Canada, and Mexico. When determining which WX channel to receive on, it can be confusing because there is no standard WX channel number to 162 MHz frequency mapping. Use the NOAA USA search or Canada search to find nearby WX radio transmitter frequencies.

Channel number to frequency mapping: a common practice is to start with the lowest frequency and go up across the 7 WX radio frequencies. This is perhaps the most common channel number to frequency mapping.

WX Channel Frequency (MHz)
1 162.400
2 162.425
3 162.450
4 162.475
5 162.500
6 162.525
7 162.550

Non-sequential channel order is used by some CB radios such as Radioddity / Anytone radios made by Qixiang.

WX Channel Frequency (MHz)
1 162.550
2 162.400
3 162.475
4 162.425
5 162.450
6 162.500
7 162.525

Comparing the reception performance on a known frequency vs. a handheld radio can give a quick indication that an antenna system is working OK–even if like 27 MHz CB radio the designed antenna frequency is far from the 162 MHz weather radio frequency. Comparing WX radio reception on a CB radio with base or mobile antenna versus a handheld radio on the same 162 MHz WX radio frequency indicates that the CB radio antenna coax is perhaps not severely damaged or lossy, and the radio is working OK.

TV unable to receive any ATSC channels

Modern sub-$250 television receivers make compromises in low cost hardware while supporting the best possible picture quality for internet streams. This can lead to compromises in fundamental performance for over-the-air (OTA) reception of digital ATSC TV signals. For example, the ability to monitor signal strength is often not present in such low-cost TVs. When a channel(s) that should be easily received is not available, the fundamental step of checking signal strength might be unavailable on a low-cost TV. A first step is generally to rerun the channel scan with the antenna (if indoor) positioned in a window facing the transmitter direction.

A diagnostic tool and possible solution is an ATSC tuner connected to the TV via HDMI. ATSC 1.0 HDMI tuners are available for under $30. The dedicated tuner may be of higher quality than the TV’s built-in tuner, and may provide a signal strength reading. Check product reviews to ensure the tuner is of good quality and has a signal strength meter. Some tuners can connect to an Android device or laptop via USB to receive broadcasts or monitor signal strength. This can allow a technically-minded user to diagnose reception issues including interference.

N7DDC ATU-100 Antenna Tuner

An antenna tuner is commonly used in the HF radio bands to match the impedance of the antenna and typically the feedline as well to the transceiver. If the antenna tuner is located at or very near the antenna feedpoint, losses and feedline radiation can be greatly reduced. For practicality most applications place the antenna tuner near the transceiver, which may require grounding the antenna tuner and/or putting a coaxial choke in the feedline to reduce common mode currents that can cause interference to one’s own transmission.

The N7DDC ATU-100 is a compact antenna tuner that can be purchased as a kit or assembled. It is designed to handle up to 100 watts of power and is typically built to cover the HF bands from 160m to 6m.

A popular implementation is the “7x7” configuration that uses 7 inductors and 7 capacitors to provide a wide range of matching options. The “7x7” setup is comparable to the “8x8” configuration used in more expensive commercial tuners. An example maximum capacitance of 1.822 nF and maximum inductance of 8.53 uH is typical for the “7x7” configuration.

Tuner model Maximum Capacitance (nF) Maximum Inductance (uH)
N7DDC ATU-100 1.82 8.53
MFJ-994 2.95 17.0
Icom AH-4 2.4 19.0
Elecraft T1 1.3 7.5

By putting the ATU-100 into Test Mode by holding the Auto and Bypass buttons on power up, the user can flip the high / low tuning by a short press of the Tune button. A long press of the Tune button switches between tuning “L” inductance and “C” capacitance. Thus by writing down the auto-tuned settings for a particular frequency, the user can manually tune the ATU-100 for that frequency in the future without needing to go through a full tuning cycle. This can be useful to get a more efficient match or handle a tricky matching scenario.

Be sure to ground the radio and antenna tuner to a common ground point, and if possible, use a coaxial choke in the feedline to prevent common mode currents. Note that the RF voltages on any antenna even at “low” power levels can reach thousands of volts, particularly where baluns and ununs are used to match high antenna impedances (e.g. 4:1, 9:1, 49:1, 64:1).

The efficiency of the antenna is a limiting factor of the effectiveness of all antenna matching schemes, whether manual or automatic. The tuning impedance range of the relatively inexpensive ATU-100 is remarkable, as observed in this video testing a 102" whip antenna from 160m to 10m bands:

An important feature lacking in the current N7DDC ATU-100 is tuning memories. The tuner simply remembers the last tuning setting, but any significant frequency change will require a complete tuning cycles. This can be surprising as compared to the near instant retune common in commercial antenna tuners that typically remember thousands of frequency tuning settings even after power is removed and restored. The ATU-100 price point is about 1/3 most commercial antenna tuners, so this lack of tuning memories is a compromise one might be willing to accept.

C23 function declaration needs arguments

The C23 standard requires function declarations to have the arguments specified, else (void) (zero arguments) is assumed. This is a breaking change for code that didn’t use the best practice of specifying the argument types in the function declaration. A real life example of upgrading a large project (Red Hat Linux) to C23 compliance is illustrative. This change emphasizes the importance of adhering to recent C standards for clarity while maintaining compatibility with older language standards if possible.

Freezing the compiler version range for project code is generally a costly long-term strategy as technical debt and developer frustration accumulate. Newer compilers keep adding debugging features and performance improvements.

C++ std::endl requires <ostream> header

C++ standard library (STL) improvements over time include paring down internal includes where possible as best practice and to improve compilation time. When user code accidentally relies on internal includes, it can lead to compilation errors when the internal includes are removed by the STL maintainers or external libraries. Tools like IWYU can help identify missing or unused include statements.

GCC 15 STL removed some superfluous <ostream> includes that may affect code using std::endl without including <ostream>. It’s a common mistake to assume that <iostream> includes std::endl. When checking code to ensure that std::endl code files include <ostream>, consider if the code could use \n newline instead to improve code performance by avoiding unnecessary stream flushing with std::endl. Part of checking if \n can be used instead of std::endl is to observe if downstream code requires the output buffer to be flushed – for example in interactive CTest runs.

8 meter 40 MHz ham band in the USA

Several countries have created an 8 meter ham band near 40 MHz. The USA FCC has a proposed rulemaking RM-11843 to create an 8 meter ham band in the USA. A key conflicting user SNOTEL, which used meteorburst communications to connect very remote sites, has ceased use of the 40 MHz band. As commenters indicate, a rich surplus equipment market exists of military surplus radios and commercial equipment that can be used on the 8 meter ham band. Proposed bandplans allocate FM, CW, and digital modes.

Raspberry Pi power consumption

The Raspberry Pi 5 power management IC PMIC is the Renesas DA9091, a chip specifically designed for the Pi 5. The Raspberry Pi 3B+ and Raspberry Pi 4 PMIC is the MaxLinear MXL7704. Older Raspberry Pi models used custom circuitry or the APX803 instead of a COTS PMIC to handle sequencing of discrete DC power input to the Pi subsystems. It has been noted that damaging the PMIC can make the Raspberry Pi too difficult to repair.

A yellow lightning bolt is GPU-superimposed on the Raspberry Pi display output for low voltage. In general computing platform operation is not guaranteed with voltages out of tolerance. The SD card can become unreadable, the Pi may have random malfunctions, and corrupt data (bad writes) on the SD card. Raspberry Pi 4 and Pi 5 require a minimum 5 Volt 3.0 Amp power supply. Using peripherals can require higher current supply. The cable between the power supply and Raspberry Pi must be of good quality to minimize voltage drop and unstable operation. The USB-C power connector of the Raspberry Pi 4 and Pi 5 is markedly more robust than the micro-USB power connector of legacy Raspberry Pi models.

Raspberry Pi Low voltage alarm

If the DC input voltage falls below 4.65 volts (depending on Raspberry Pi model and firmware), the GPU superimposes a lightning bolt graphic on the display output. This may not be visible on a VNC remote desktop.

yellow lightning bolt

Measure Raspberry DC input voltage / current

The Raspberry Pi 5 added vcgencmd pmic_read_adc to read DC input voltage and the several generated voltages and currents consumed. On older Raspberry Pi models there is no built-in capability to measure the Raspberry Pi DC input voltage without adding an external ADC.

On the older Raspberry Pi (older than Pi 5) it may be possible to read the input voltage binary state (OK or low) from the Terminal, but we have not confirmed this. On the Raspberry Pi 1 B+ and Pi 2 it may be possible to read state of GPIO 35, depending on the hardware and firmware. On the Raspberry Pi 3 in may be possible to read GPU-driven LED status.

Mitigate inadequate power supply

When compiling programs with concerns about excessive power consumption, consider not compiling in parallel. For GNU Make, “make -j1” uses 1 CPU core. For Ninja compilation in parallel is default, so specify “ninja -j1” for one build thread. For meta-build systems limit build parallelism like CMake cmake --build build -j1 or Meson meson compile -j1

Related: Measure Raspberry Pi CPU temperature

Terminal text web browsers

lynx is a text web browser that allows browsing certain websites without need for a graphical display. Several other text-based web browsers for Terminal are available, and while they offer some measure of increased security due to their lacking JavaScript or easily disabling JS, there have been CVEs for these web browsers as well. With this type of browser using a custom engine, the web-browsing data bandwidth can be dramatically less than with general graphical web browsers as the graphics and JavaScript might simply be ignored and not downloaded. This orders of magnitude reduction in data usage can be useful for those with limited data plans or slow connections. This can be useful at remote arctic sites or on a satellite connection.

However, the lack of a general web browser backend engine like Chrome or Firefox can lead to many websites not rendering properly or at all. An alternative approach is to render the website remotely and send only rendered text over a secure connection like SSH. This achieves dramatic data bandwidth reduction to the remote site by rendering at a server with a normal full internet connection. An implementation of this approach using a headless Mozilla Firefox is browsh. Browsh keybindings or mouse can be used to browse the web in the Terminal. On Windows, Browsh can be installed by winget:

winget install browsh.browsh