From 3402d961e1ad8b5e35bbdee7f1d9abbefbee9615 Mon Sep 17 00:00:00 2001 From: Denis Denisov Date: Thu, 10 Dec 2020 22:51:31 +0300 Subject: [PATCH] Updated README --- README.md | 40 ++++++++++++++++++++++++++++++++++++++-- scheme.png | Bin 0 -> 3368 bytes 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 scheme.png diff --git a/README.md b/README.md index 8851087..2f279c5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,39 @@ -# soundthermo-cpp +# SoundThermo -Thermometer via sound card. C++ version (Qt) \ No newline at end of file +Simple thermometer using sound card input and output, a thermistor and couple of resistors. +This version uses Qt framework, so it can be built for different OSes. + +# Hardware + +One should assemble components as shown on scheme below: + +![Thermometer scheme](scheme.png) + +* Lout should be connected to left channel of sound card output +* Rout should be connected to right channel +* Mic In is for microphone input +* GND should be connected to ground (both on input and output) + +# Using the software + +First, one should compile the project. This can be done via Qt Creator or simply from command line. +For building you will need Qt Core and Qt Multimedia. + +Firstly it's useful to run `./soundthermo-cpp list`. This will output all detected sound devices in +your system, input and output. Note names of desired input and output device. + +After that one should run `./soundthermo-cpp measure --input= --output= --duration=`. +Duration means amount of time spent for measuring (longer the measurement, more precise results). As for me, one second +is enough. + +# How it works + +The idea is to generate harmonic signal with some amplitude `Vin` on sound output and then measure +`Vout` - amplitude of same signal on microphone input. + +If we consider just left or just right channel, we could not that `Vout = R2 * Vin / (R1 + R2)`, +where `R1` and `R2` are resistor values. Unfortunately, due to different volumes in input and output, +really equation is like `Vout = R2 * Vin * k / (R1 + R2)`. So firstly we do measurement via right +channel (where we know both `R1` and `R2`), to determine `k`. After that we repeat same measurement +using left channel. Knowing `Vin`, `Vout`, `R2`, and `k` we can determine value of thermistor. +After that we compute real temperature via approximation formula. diff --git a/scheme.png b/scheme.png new file mode 100644 index 0000000000000000000000000000000000000000..f8d9b354762c0cbc509101a934a42d041f059060 GIT binary patch literal 3368 zcmbVPc{G%58y{UB}|OnSO%jZ>qPdiBMf6-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