After fifteen years using WordPress, I’m leaving it for a simpler alternative: flat markdown files. There were several reasons behind why I made the change. First, I was disappointed with how frequently I had to update WordPress (and upgrade my database) to stay current with security updates. Second, I didn’t like how abstract post content was. The text of posts was stored in SQL tables and references to image URLs weren’t easily accessible (posts point to content IDs, the URLs of which were stored in another table), and images and media were scattered all over the filesystem because the default image placement changed several times over the years. Finally I found that logging in to a web front-end just to write a post was a bit of a barrier that prevented me from writing more frequently.
I have been very active on GitHub over the last few years and used their platform to share my code instead of this website. Lots of code and notes belong in repositories there, yes, but sometimes I create neat things which would be better represented as one-off posts on my personal website. Some of my repositories have collected notes like these, so I look forward to migrating a lot of that content here. My hope is that the new system I put together will make it easier to share content by writing it in Markdown using the editors I’m already working in every day.
The system I’m using now is pretty simple. Every post is a folder, and each folder contains a markdown file along with all of the images and files that post references. At the top of the markdown file is a little header which has information like title, date, and categories (tags). I use a PHP script route HTTP requests and if a requested folder lacks index.html but has index.md, I serve that using Parsedown to convert it to HTML. I also add a few tweaks to do things like convert YouTube links to embedded videos and add syntax highlighting to code blocks. Backups are easy (I just zip the folder), and the website could be committed to source control. I’m leaning away from this because it’s about 1GB (lots of images), but I’ll consider it. Also, the URL is just the path to the folder.
There’s a clear path toward generating a static site. If a folder lacks index.html, index.md is parsed and served. Switching to and from a static site can be achieved just by pre-converting all the markdown files to html and deleting them. I’ll probably keep working on refining the PHP script until the conversions are reliably processing like I desire, then convert most of the old pages to static files. The cool thing about this method is that it lets me serve some posts statically but others dynamically.
The conversion from WordPress to Markdown was semi-automated, but still labor-intensive.
I first dumped the database to a SQL file, parsed-out the content and metadata (url, title, date, and privacy status), then created the filesystem and markdown files.
I then had to manually inspect every markdown file and reformat it, converting inline HTML to markdown (mostly images, galleries, and divs for alignment formatting). In many cases code formatting was damaged over the years, so lots of my old code was run through an autoformatter.
I also had to hunt-down the media (images, MP3s, ZIP files, etc.) for every post, copy it to the same folder, and update the URLs to be relative. This was especially hard for galleries which only point to meta content IDs (stored in a separate database table), and my database had gotten damaged somewhere along the way over the years so I really struggled to find the right content sometimes.
I also added tags to indicate categories, carefully reviewing content and code and marking posts as “old” if they contained out of date examples (lots of Python 2 code) or code that I deemed today to be of very poor quality. Part of me wanted to delete (hide) old posts with bad code, but I decided to leave them up. It’s a reminder of how long I’ve worked in improving my craft, and my revulsion to code I wrote in the past is an indication of how much I’ve learned since.
This process took me about 10 hours a day for 3 days in a row.
Along the way I had a few laughs at the ridiculousness of some of my old content. I think it’s probably a good thing to encourage teenagers to have personal websites, but I also encourage professionals and employers not to give too much credence to ramblings written by a person decades ago that Google happens to remember. I didn’t delete any content, but I marked most of the posts I made as a teenager as private and only exposed the ones that discuss this website.
After reviewing all of my posts I now have a really good understanding of the evolution of the technologies I used to serve my website over the years. Here’s a summary of the major events:
It started as a blog on GeoCities, with the oldest surviving post dating to June 2001. Back then adding content meant editing HTML files and using FTP to upload changes.
In 2002 I started hosting my website from a server at my house. Initially it was served with Windows/IIS using ASP for comments pages. On October 19, 2002 I switched to FreeBSD/Apache using PHP for comments pages.
I started using the Movable Type (a flat-file PHP-based CMS) on Aug 25, 2003.
I migrated to WordPress (a CMS that stored posts in a database) in 2005.
In 2020 I converted all my posts to Markdown using PHP to dynamically generate HTML (with an avenue to generate flat-file output).
I built a frequency counter with a USB interface based around a 74LV8154 32-bit counter, FTDI FT230XS (USB serial adapter), and an ATMega328 microcontroller. I’ve used this same counter IC in some old projects (1, 2, 3, 4, 5) this time I decided to I design the circuit a little more carefully, make a PCB, and use all surface-mount technology (SMT).
The micro USB port provides power and PC connectivity, and when running the device sends frequency to the computer every second. All the parameters can be customized in software, and source code is on the USB-Counter GitHub page.
I also added support for a 7-segment LED display. The counter works fine without the screen attached, but using the screen lets this device serve as a frequency counter without requiring a computer. This display is a MAX7219-driven display module which currently runs for $2 each on Amazon when ordered in packs of 5.
One advantage of this counter is that it is never reset. Since this circuit uses 32-bit counter IC, and every gate cycle transmits the current count to the computer over USB. Because every input cycle is measured high precision measurements of frequency over long periods of time are possible. For example, 1000 repeated measurements with a 1Hz gate allows frequency measurement to a precision of 0.01 Hz.
An optional external 1PPS gate can be used for precise timing. The microcontroller is capable of generating gate cycles in software. Precision is limited to that of the TCXO used to clock the microcontroller (2.5 PPM). For higher-precision gating a resistor may be lifted and an external gate applied (e.g., 1PPS GPS signal).
By clocking the microcontroller at 14.7456 MHz with a temperature-compensated crystal oscillator (TCXO) I’m able to communicate with the PC easily at 115200 baud, and with some clever timer settings and interrupts I’m able to toggle an output pin every 14,745,600 cycles to produce a fairly accurate 1PPS signal.
According to the SN74LV8154 datasheet the minimum expected maximum input frequency (fMAX) is 40 MHz. To count higher frequencies, a high-speed prescaler could be added to the input to divide-down the input signal to a frequency this counter can range. This was discussed in the original issue that kicked-off this project, and Onno Hoekstra (PA2OHH) recommended the SAB6456 divide-by-64/divide-by-256 prescaler which supports up to 1 GHz input frequency. However, present availability seems to be limited. A similar chip, or even a pair of octal flip-flops that work in the GHZ range could achieve this functionality.
By populating one of two input paths with components this device can serve as a sensitive frequency counter (with a small-signal amplifier front-end) or a pulse counter (with a simple 50 ohm load at the front-end).
An optional amplifier front-end has been added to turn weak input into strong square waves suitable for driving the TTL counter IC. It is designed for continuously running input, and will likely self-oscillate if it is not actively driven.
⚠️ WARNING: There is an error in this schematic. The protection diodes should be the other way around.
This simulation shows a small 1 MHz signal fed into a high impedance front-end being amplified to easily satisfy TTL levels. The 1k resistor (R3) could be swapped-out for a 50 Ohm resistor for a more traditional input impedance if desired. LTSpice source files are in the GitHub repository in case you want to refine the simulation.
- improved RF amplifier design
- alternate path to bypass RF amplifier
- corrected counter pin connections
- free a MCU pin by making the status LED the gate
- add a header for the serial LED display
- run MCU at 14.7456 MHz
- allows much faster serial transmission
- no longer accepts external 10MHz reference
- may still accept external gate
- added screw holes
- they’re floating (not grounded) - should they be grounded?
- switched to micro USB (from mini USB)
- didnt have 27 ohm resistors. used 22 ohm.
- I used a 500mW rated R15
- I used a 500mW rated R13
- make hand solder version of usb
- make oscillator fit less awkwardly
- Add a 7805 so 12V can be applied or USB. Use a 78L33 (not the reg on the FTDI chip) to power everything else.
- This device doesn’t work when plugged into a wall USB cord (power only, no data). It seems an active USB connection is required to cause the 3.3V regulator (built into the FTDI chip) to deliver power. The next revision should use a discrete 3.3V regulator.
- For a standalone (LED) device no USB connection is needed. Make a version that accepts 12V and displays the result on the LED. Make the optional external gate easy to access. Break-out the TX pin so PC logging is still very easy.
The design is similar (CMOS buffer driving an IRF510) but I used perfboard to make this one and placed it in an enclosure. There’s no low-pass filter on the amplifier itself, but I put a 30m low-pass filter in-line the coax before the antenna. It’s currently outputting 20PPV into 50 ohms (1 watt).
Right after hooking it up I saw my signal looking nice on the air:
This page documents interesting grabs of the signal from my SMT QRSS Transmitter
I was really strong on VE1VDM’s grabber last night, but I found it interesting to see such a strong signal in the middle of the day (11AM).
I spotted my signal across the Atlantic. It’s pretty weak, but you can just make out the unique shape on EA8BVP’s grabber in the Canary Islands (4,000 miles away).
I spotted my signal in Sweden. This hint of my transmitter was captured by SA6BSS in Slutarp, Sweden at 12:30AM last night.
I spotted my signal in Switzerland
Bill (W4HBK) emailed the QRSS Knights a grab of my signal from a KIWI SDR captured at HB9EHO in Ittigen, Switzerland.
This page documents development of a voltage-controlled oscillator suitable for QRSS. Source code and PCB files are on https://github.com/swharden/QRSS-hardware
For QRSS it’s convenient to have 2 frequency shift adjustments: a coarse one to set frequency (~200 Hz), and a fine one for FSK (5 Hz). I began with the design below allowing manual adjustment of coarse tuning, then an external input for fine tuning. Eventually I switched to a design where a single voltage controls tuning (coarse and fine). Many QRSS TX designs use a variable capacitor to set the coarse adjustment, but I don’t like that design because it means you have to open your enclosure every time you want to shift frequency. If this is going to be ovenized, I’d love to close the box and do all the tuning electronically.
This design worked pretty well. Fixed capacitors (optionally populated) set the frequency so the crystal oscillates in the QRSS band. The coarse adjustment moves the signal around the QRSS band (100Hz). The fine adjustment is pulled high through a divider. Adjust R4 to control how wide the FSK can be.
Real varicap diodes definitely work better than reverse-biased LEDs. A reverse-biasd blue LED measured 60 Hz swing (with a lot of additional fixed capacitance in place to get near center frequency). Replacing this with a BB132 (I had to remove a 5pF cap to compensate) I got a swing of 159 Hz. That’s more than double, and that’s just one varicap. You can stack them in parallel. Real varicaps dont mind low voltage* I found out, so don’t worry about avoiding that super low region like with the LED.
Eventually I stopped trying to separate fine and coarse frequency adjustments and just went with a single voltage for tuning. I can control voltage coarsely and finely using potentiometers, so I was happy to simplify the oscillator design by moving that complexity to the keyer/control system. This is the QRSS oscillator I came up with. It’s just a Colpitts oscillator with an output buffer. Note that the buffer will self-oscillate if the oscillator stops, so on-off-keying should be achieved downstream of this circuit. These decisions are made with maximal frequency stability in mind.
I’m glad I used a SMA connector, but in hindsight I should have laid it out sideways because I couldn’t close the lid.
- I used BB132 for the varicap
- I used 33P for C6
- For C9 I used 33p (should be NP0)
- For C11 I used 100p
- For C10 and C12 I used NP0 120p caps
Ovenization is achieved using two power-resistors fixed to the metal enclosure. A thermistor fastened to the chassis provides temperature feedback. This chassis heater seems to be a winning design, as it is slow but stable. Having loose coupling between the PCB and the chassis is intentional. The whole thing is enclosed in a modestly insulative plastic enclosure. I’m very happy with this design!
My oscillator looks stable on time scales of minutes, but on time scales of hours it is obvious that it wobbles as my central air conditioning turns on and off. I could go nuts with Styrofoam, but a crystal oven (or chassis heater) is warranted.
Some DIY QRSS ovens use resistors as the heater element and package the heater and temperature sensor against the crystal. While temperature stability of the crystal is good, I prefer to thermo-stabilize all frequency-determining components (capacitors and varactors) of the oscillator circuit. For this reason, I prefer a chassis heater.
When I get an oscillator I like using SMT parts, I’ll try adding the temperature sensor and heater directly on the board. This is ideal for small PCBs. It would be cool if the board could thermo-regulate itself, then the oscillator would just need insulation, and the heater would require very low power.
This section documents my thoughts and experiments related to development of a chassis heater. Since I’ll build the chassis heater inside an insulated container, I’ll refer to it as a chassis oven.
After running the numbers for a bunch of different power/resistor combinations, I decided to work with 50-Ohm power resistors. I’d love to have more 50-Ohm power resistors on hand to use for making dummy loads.
I settled on this part: 50 Ohm (+/- 1%) 12.5 watt resistor ($2.64)
Running 12V through a single resistor would burn 2.88W of power as heat. If we wanted more heat we could add additional resistors in parallel, but this should be okay.
After the above considerations, this is what I came up with. I made it on a breadboard and it works well.
- You can add multiple R4s in parallel for faster heating
- I ended-up replacing the TIP122 (Darlington transistor) with an IRF510 (N-channel MOSEFET) for better linear operation (since the TIP122 has such high gain)
- This works great and the IRF510 rests partially on once stabalized
- The IRF510 gets hot! Maybe you can mount that to the chassis too?
- You can supply it with dirty power and it doesn’t seem to affect oscillator performance
- I use a multi-turn potentiometer for RV1
- R6 sets hysteresis
- Large values promote squishy temperature control.
- Small values will faster responses but may oscillate
- Remove R6 for bang-bang operation
- I suspect this design could be used as a crystal oven
- Replace Q1 with a 2N2222
- Replace R4 with a 680 Ohm 1/4-watt resistor (~17 mA, ~200 mW)
I experimented more on 2019-08-31:
- Switched to an LM335 (not a thermistor) super-glued to the chassis
- I target 3.10 mV (310 Kelvin = 37C or 100F)
- Can use LM7805 for op-amp and divider since we are using low voltages
- A tip122 is cheaper than the IRF510 and works fine
Consider a NPN with a collector tied to VCC (
Vcc) and emitter dumping into a resistor (
R) to ground. Let’s say I’m driving a 50 Ohm resistor as a heater. How hot will the transistor get? Is my transistor beefy enough? To answer this I need to determine the peak power dissipation through a transistor into a resistive load.
We should assume the current flowing through the resistor (
I) will be the same as the current flowing through the transistor.
// Ve is a function of R and I
Ve = R * I
// transistor voltage drop
Vce = Vcc - Ve
// power through the transistor
Pnpn = I * Vce
Pnpn = I * Vce
Pnpn = I * (Vcc - Ve)
Pnpn = I * (Vcc - (R * I))
Pnpn = (I * Vcc) - (I^2 * R)
// at peak power the first derivative of current is zero
Pnpn = (I * Vcc) - (I^2 * R)
d(Pnpn) = Vcc - (2 * I * R) = 0
// find the current through the resistor (= transistor) at peak power
Vcc - (2 * I * R) = 0
2 * I * R = VCC
Ipeak = VCC / (2 * R)
// substitute back into original equation
Pnpn = (Ipeak * Vcc) - (Ipeak^2 * R)
Pnpn = ((Vcc / (2 * R)) * Vcc) - ((Vcc / (2 * R))^2 * R)
Pnpn = (Vcc^2) / (2 * R) - (Vcc^2 * R) / (4 * R^2)
4 * R * Pnpn = 2 * Vcc^2 - Vcc^2
Pnpn = Vcc ^ 2 / (4 * R)
Pnpn = Vcc * Vcc / (4 * R)
Pnpn = Vcc * (I * R) / (4 * R)
Pnpn = Vcc * I / 4
// since the power through the resistor is
Pr = Vcc * I
// peak power through the NPN is 1/4 that through the resistor
Pnpn = Vcc * I / 4
- If I drop 12V through a 330 Ohm resistor it passes 36.4 mA of current and dissipates 436.4 mW of power. This means the transistor will dissipate 109 mW of power at its max.