Friday, March 15, 2024

Setting the Output Power on the IC-706

This information is to help me remember how to set the output power on my IC-706.  It is a set of notes that may not make full sense to everyone. 
  1. Press and hold the Display Button until the display changes
    • The lower left corner should show a Q number
  2. Use the Band Up/Down buttons to change the display until you find Q1 RF POWER
  3. Rotate the Tuning Knob to change the number on the screen to what you want based on the table below.
    • Note that each "setting" is actually a range as you rotate the knob through it. 
  4. Press/Release the Display Button to return to normal operation.
Here are the power settings as measured on an Icom IC-706 MK II (not G). 
Band->HF/6-------2 
H    100-95    19-19 
9     95-85    18-16 
8     80-68    16-13 
7     67-53    13-10 
6     52-40    10-8 
5     39-28     8-6 
4     27-20     6-4 
3     19-12     4-2.8 
2     11-6    2.8-1.7 
1      6-3    1.6-1.0 
L    2.5-2.0  0.9-0.8
        ^        ^
      Power    Power

Wednesday, March 13, 2024

AHT-10 and the Pi 400 - Monitoring Temperature and Humidity

I've built a few projects that kept track of temperature, humidity and barometric pressure in the past couple of years.  Each of them used one of the Raspberry Pi variants...  well, there was one that used the Adafruit Feather M0 WiFi (Link to the Feather M0 with WiFi) and a BME280 that ran a web server...  Maybe I'll write that one up next...

My first project used a Pi 3 B and the DHT10 sensor.  

It sits in a container and keeps track of the temperature and humidity for me, logging it to a file every 15 minutes.  It has been doing a pretty good job until last year when the humidity reading went wacko.  It reads high all the time.  It's also used to access the internet (complete with mouse, monitor and keyboard). 

My next project used a Pi 3 A+ with a BMP390 (Temperature and Barometric pressure) and a SHT31 (Temperature and Humidity).  Plus a Real Time Clock and a 2x16 LCD Display.  

It, too, lived in the container monitoring temperature and humidity and logging it every 15 minutes.  The log is archived daily on a thumb drive.  

My third project saw me trying to combine the tasks both were doing.  I wanted something to access the internet and to track Temperature and Humidity.  For this task I pulled a Pi 400 out of the box where it has been sitting unused and pressed it into service.  For monitoring the Temperature and Humidity I chose the AHT10.  This part is readily available and less expensive than the BMP390.


I connected wires to the AHT10 with pin jacks on the ends, then connected the wires to the 40 pin header on the rear.  Here is where the wires are connected:

Connection on AHT10

Pin on 40 pin header

VIN

4

GND

6

SCL

5

SDA

3


Next, there are a series of commands needed to get the Pi 400 ready to run the python3 script that will do the work for us.  These steps come from an Adafruit page that describes what needs to be done to install the libraries we need for the project.

Caveat - There are extra steps here I did not need in earlier incarnations of this project.  This is because the Pi 5 has the 'bookworm' release of the Pi OS.  With the new release any libraries loaded for Python that are not part of the regular release path (ie loaded using the apt command) require you to install them in a 'virtual environment'.  I did not delve into the whys and what fors.  I just read the information and implemented it.

This is the link to the Adafruit page that has the steps I used and a whole lot more good information:  Adafruit setup for using Circuit Python libraries

The following are the steps I used, as taken from the Adafruit web page, to get this to work on my Pi 400:

1 - Install python3 full:

$ python -m venv env –system-site-packages

2 - Make sure the virtual environment python is installed using these commands:

$ sudo apt install python3-full -y

$ sudo apt install python3-venv

3 - The virtual environment needs to be activated:

$ source env/bin/activate

4 - Then run the following commands to be sure the pi is correctly configured and to install blinka:

$ cd~

$ pip3 install –upgrade adafruit-python-shell


$ wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py

$ sudo -E env PATH=$PATH python3 raspi-blinka.py

5 - Then activate the virtual environment

$ source env/bin/activate

6 - Then install the adafruit library for the AHT10 using this command

$ pip3 install adafruit-circuitpython-ahtx0


7 - Now the python program temp-humidity.py will run (source at the end of this page).

$ python3 temp-humidty.py


I need the program to run every 15 minutes. For this I use cron.
To get the python script to run within the virtual environment using cron you need to put the following line into your /etc/crontab file (the following should be one long line):

*/15 * * * * piuser source env/bin/activate ; python3 /home/piuser/temp-humidity.py >> /var/tmp/temperature.log 2>&1 ; deactivate

  • The */15 tells cron to run this every 15 minutes on the quarter hours (ie 00, 15, 30 and 45).
  • The next four * tells cron to run this every hour, day of month, month of year, and day of week (google cron examples to learn aboout cron)
  • The pisuer is the user running the program (it is run from /home/piuser by cron).
  • The three commands used are as follows:
    • source env/bin/activate (this command activates the virtual environment)
    • python3 /home/piuser/temp-humidity.py >> /var/tmp/temperature.log 2>&1 (this command runs the program and sends an stdout or stderr messages to a log file in /var/tmp)
    • deactivate (this command deactivates the virtual environment)
  • And they are strung together using semicolons (the following should be one long line):
source env/bin/activate ; python3 /home/piuser/temp-humidity.py >> /var/tmp/temperature.log 2>&1 ; deactivate

Last, here is the Source code for the temp-humidity.py program:

# Python 3 script to grab Temperature and Humidity from an AHT10, display and log them.
from time import sleep, strftime, time
import board
import adafruit_ahtx0
i2c = board.I2C()
sensor = adafruit_ahtx0.AHTx0(i2c)
filename = "/home/piuser/temperature.csv"
running=True
# Write the values to the file
def write_file(filename,f,h):
    log = open(filename, "a")
    log.write(strftime("%Y-%m-%d") + ', ' + strftime("%H:%M:%S") + ', Temperature: ' + str(round(f,1)) + ', Humidity: ' + str(round(h,2)) + '\n')
    log.close()
while running:
    try:
        # Get the temperature from the AHT10
        temperature_f = (sensor.temperature * 9/5) + 32
        # temperature_f = temperature_c * (9 / 5) + 32
        # Get the humidity from the AHT10
        humidity = sensor.relative_humidity
        #print the values to stdout
        print(
                "Temperature: {:.1f} F   Humidity: {:.2f}% ".format(
                temperature_f, humidity
            )
        )
        # Write the values to the logging file
        write_file(filename,temperature_f,humidity)
        running=False
    except RuntimeError as error:
        print(error.args[0])
        continue
    except Exception as error:
        running=False
        raise error

Let me know how yours works.
Mike Dooley
N5BGZ



Tuesday, March 12, 2024

6BTV 80 Meter Resonator issue

Problem:  The resonant spot for 80 meters on my 6BTV had moved.  In other words, the antenna no longer resonates in the 80 meter band.

Prolonged Investigation:  

  • After a rain event I noticed the resonant spot for 80 meters on my 6BTV had moved.  
  • A few days of sunshine and everything was back to normal.
  • Next rain event, the problem came back.
  • I waited for a few more days of sunshine and a return to normal operation.

Steps to resolve: 

  • I took down the vertical
  • I taped the resonator where the top and bottom caps touch the coil.  
  • I re-installed the resonator and tested to be sure it was tuned where I wanted it to be in the 80 meter band.
  • I put the vertical back up in its normal, operating, position.

Testing the fix:  Another rain event occurred a few weeks later.  After the event I check the antenna and it is still resonant where it is supposed to be in the 80 meter band!  

Conclusion:  

  • Water from the rain was infiltrating the resonator, moving its resonant spot.  
  • After a few days of sunshine the water was gone and the resonator worked correctly.  
  • Taping the resonator adequately sealed the resonator from the rainwater.