This project uses a Raspberry Pi Pico W to internet-enable an antenna rotator controller that has an RS-232 interface. The software presents a web interface to the rotator, and also allows direct network control by N1MM+ and other software.
I used it for my Hy-Gain Ham IV rotator. My Hy-Gain rotator control box has been modified to allow computer control with the addition of a Ham Supply/Idiom Press Rotor-EZ module. I further modified the rotator control box to provide +5 Volts on Pin 1 (carrier detect) of the DE-9S RS-232 interface. This allows the Raspberry Pi Pico W to rob power from the rotator control box.
See the Documentation for details
There is very little external hardware required. The most important other piece is a MAX3232 3.3 volt RS-232 level converter. The MAX3232 is used to interface the 3.3 volt logic of the Raspberry Pi Pico W to the RS-232 levels required by the antenna rotator control box.
- Download the latest stable build of Pico W MicroPython. This is the direct link.
- Connect a micro-USB cable to your PC. Hold down the white "BOOTSEL" button on the Pico-W, and insert the micro-USB cable into your Pico-W.
- The Pico-W should appear as a USB storage device on your computer. On mine, it shows up as "RPI-RP2 (F:)".
- Copy/Paste the MicroPython .uf2 file to this drive.
- Disconnect the Pico-W and prepare for the next step.
The easiest way to get this software installed onto your Pico-W is to use the loader.py
tool, also
provided in this repository.
- Download Python 3 from https://www.python.org/downloads/ and install it. Make sure to select "Add Python 3 to Path."
- Download the contents of this GitHub repository as a zip. Use this URL:
https://github.com/n1kdo/rotator-controller-controller/archive/refs/heads/master.zip
- Unpack that zip file somewhere.
- Open a command prompt. (your choice. Could be PowerShell, could be good ole CMD.)
- From the command line, execute the following command:
pip install pyserial
-- this will install the Python serial port support/ - Change directory to where you unpacked the GitHub zip file, and then
change directory to the
src/loader
directory. - From the command line, execute the following command:
python loader.py
-- this will install all the rotator controller-controller software onto the Pico-W.
If you want to experiment, you can use the open-source "Thonny" IDE to load the python source code and HTML files
onto the Pico W. Unfortunately, Thonny cannot load the binary file compass-background.png
image file into the
proper location, but this can be worked around by using the "upload" feature in the controller-controller software.
Important files:
- src/rotator/main.py -- the main Python application
- src/rotator/dcu1_rotator.py -- a Python module that queries and commands the rotator controller
- src/rotator/http_server.py -- a Python module that implements the web server
- src/rotator/morse_code.py -- a Python module that implements the morse code sender
- src/rotator/n1mm_udp.py -- a Python module that implements UDP send/receive to/from N1MM+
- src/rotator/content/rotator.html -- the rotator control web page
- src/rotator/content/setup.html -- the setup web page
- src/rotator/content/files.html -- the file upload/download web page
- src/rotator/data/config.json -- the configuration file. automatically generated on first use if not present.
Other Stuff:
- src/loader/loader.py -- small Python application installs the six files above onto the Pico-W
- src/loader/pyboard.py -- patched pyboard library from Micropython. Patched to work on Pico-W.
Electronic Design Files:
- kicad/* -- Kicad 6 design files for schematic and PCB.
I used this same electronic design, and a lot of the same source code to make the KPA-500 IOT Thing, a web interface and KPA500-remote host for the Elecraft KPA-500 amplifier.
n1kdo 2023-08-11