The Sound Card Method (Or: When a 14-Year-Old is Your Technical Advisor)

It has been two days without a frequency counter. Two days of looking at the empty space on my desk where the VC-3165 used to sit. Two days of reading atmospheric pressure on The Ambassador and voltage on The Professor but not being able to measure the one thing that matters most right now.
On Tuesday, I need to measure.
I emailed Dima.
The Email
Dima,
I have a problem. I sent my frequency counter to Mikhail. The replacement has not arrived. Tuesday is in four days. I need to measure grid frequency.
You mentioned measuring with a sound card. Can you send me your setup?
Dr. Goverki
He replied in seven minutes. The reply was longer than any of his previous emails. When Dima writes about technical matters, he becomes a different person. The sentences are precise. The instructions are clear. He numbered them.
Dr. Goverki,
You need:
A small transformer (any phone charger adapter will work - the kind with exposed prongs, not USB-C. The older and cheaper the better. You probably have twelve of these.)
A 3.5mm audio cable (male to male)
Your laptop’s microphone input (or a USB audio interface if you have one)
Software: Audacity (free) or any spectrum analyzer
DO NOT connect mains voltage directly to your sound card. This will destroy your sound card and possibly you. The transformer steps 220V down to whatever the adapter outputs. You measure the LOW voltage side.
Steps:
- Cut the output end of the charger cable
- Strip the wires
- Solder them to a 3.5mm jack (or just twist and tape if you are in a hurry, but you are a physicist so please solder)
- Plug the jack into your laptop’s microphone input
- Plug the charger into the wall
- Open Audacity
- Record
- The waveform will show 50 Hz (or whatever your grid is doing)
- Use Analyze > Plot Spectrum for FFT. Set window size to at least 65536 samples for good resolution.
With a 48 kHz sample rate and 65536-point FFT, your frequency resolution is 0.73 Hz. That is not enough. You need to use zero-padding or interpolation. Or better: measure the period directly. Count zero-crossings over a 10-second window. At 50 Hz that is 500 crossings. If you get 499 or 501, you know the frequency has shifted.
I wrote a Python script that does this automatically. I can send it if you want.
Dima
P.S. This is the same method I used. My readings were 50.00 Hz every time but I think that is because I was not measuring on a Tuesday.
The Build
I had everything I needed. Dima was right - I had twelve old phone chargers. Possibly more. They accumulate in drawers the way entropy accumulates in closed systems.
I selected a Nokia charger from approximately 2009. It was the oldest and therefore, by my logic, the most trustworthy. The transformer inside is simple, robust, and overbuilt in the way that electronics used to be before everything became disposable.
I cut the output cable. I stripped the wires. I soldered them to a 3.5mm jack. The soldering took ninety seconds. Some skills do not degrade.
I plugged the charger into the wall. I plugged the jack into my laptop’s microphone input. I opened Audacity.
A waveform appeared. Clean, sinusoidal, 50 Hz. The grid, singing through a Nokia charger from 2009 into a laptop from 2022.
I felt a specific emotion that I can only describe as: a physicist in his fifties, alone in his apartment, building measurement equipment from instructions written by a teenager, and finding that it works perfectly.
The Python Script
I asked for the script. Dima sent it within the hour.
It was 47 lines of Python. I will not reproduce all of it here, but the core method was elegant: it records audio for a configurable window (default 10 seconds), identifies zero-crossings, calculates the period between each crossing pair, and reports the mean frequency with standard deviation.
The comments in the code were written in a mixture of Russian and English:
# считаем пересечения нуля (count zero crossings)
# если частота отклоняется больше чем на 0.05 Гц, пишем WARNING
# TODO: добавить логирование в CSV
I ran it. The output:
Recording 10 seconds...
Zero crossings detected: 1000
Mean frequency: 50.012 Hz
Std deviation: 0.003 Hz
Status: NORMAL
50.012 Hz. The Ц4353 showed 228.4 V on the same outlet. Everything consistent. The setup works.
I ran it again. 50.009 Hz. Again: 50.011 Hz.
The resolution is lower than the dedicated frequency counter. The VC-3165 gives me three decimal places. Dima’s method gives me reliable data to two. But two decimal places is enough to detect the Tuesday Anomaly. The typical deviation is -0.15 to -0.21 Hz. This setup will see it.
The Calibration
I do not trust a measurement system until I have tested it against something known. I do not have a calibration source. But I have The Professor.
The Ц4353 can measure frequency, in theory. Its accuracy for frequency measurement is poor - ±2% according to the manual, which is 1 Hz at 50 Hz. Useless for detecting 0.2 Hz deviations. But for confirming that Dima’s sound card setup is reading in the correct range, it is sufficient.
| Method | Reading (Hz) | Resolution |
|---|---|---|
| Sound card + Python script | 50.011 | ±0.003 |
| Ц4353 (analog) | ~50 | ±1 |
| VC-3165 (absent) | - | ±0.001 |
The sound card reads 50.011. The Ц4353 reads approximately 50. These are consistent. The setup is working.
I emailed Dima:
The setup works. Your script is well-written. The zero-crossing method is more robust than FFT for this application. I would not have thought of it.
Two suggestions:
- Add a timestamp to the CSV output
- Add a command-line argument for the recording window duration
Also: you are 14. When I was 14, I was measuring the temperature of soup with a stolen laboratory thermometer. You are building frequency analysis systems from phone chargers. This is not the same.
His reply:
Thanks. I added the timestamp. The window duration was already a parameter, you just did not read the help text.
What stolen thermometer?
I am not going to answer this question.
Tuesday
The system is ready. On Tuesday at 14:30, I will start the script. Ten-second recording windows, continuous, for fifteen minutes. The data will be lower resolution than usual, but it will be data.
Mikhail’s frequency counter should arrive in Novosibirsk by Monday or Tuesday. If it arrives in time, we will have three simultaneous observations:
- Almaty (sound card method, UTC+5)
- Ruslan’s location (his equipment, UTC+5)
- Novosibirsk (VC-3165, UTC+7)
Three observers. Two time zones. One Tuesday.
And all of it built from secondhand equipment, a cut-up Nokia charger, and a Python script written by a teenager.
A Thought
Viktor Morozov had institute equipment. Precision instruments. Funding, at least initially. He had everything a scientist should have, and it was not enough. Not because the equipment failed, but because nobody listened.
I have a retired postman, a neighbor’s cat, a teenager with a sound card, and an old friend in Novosibirsk who has agreed to stare at a number every Tuesday.
Perhaps equipment is not what matters. Perhaps what matters is having people who will stare at the number with you.
Current status:
- Measurement system: Sound card + Nokia charger (2009) + Python script (2026)
- System accuracy: ±0.003 Hz (sufficient for Tuesday Anomaly detection)
- Dima’s code: 47 lines, well-commented, bilingual
- Suggestions made to Dima’s code: 2
- Suggestions already implemented by Dima: 1 (the other was already there)
- Days until Tuesday: 4
- Frequency counters in possession: Still 0
- Frequency counters in transit: 2 (1 to Novosibirsk, 1 from China)
- Stolen thermometer: No comment
- Emotional state: Improvising
Previous post: The Shipping