i have a project that I'd like to make but not sure how to handle some aspects of it, so thought I'd ask on this mailing list and see...
For those who don't know, a vario is a device used in aviation (more specifically in my case, gliding) to measure lift or sink. http://en.wikipedia.org/wiki/Variometer. A lot of these varios have an audio component - they make different tones depending on if you're in lift or in sink. The problem for me is that I am deaf so can't really hear the vario that well (especially among the other noises in a glider)
You can hear what one sounds like here - http://www.youtube.com/watch?v=q-Soct_yFIo and a broken one (which should give you an idea of the different tones) http://www.youtube.com/watch?v=Z6h_B0pcojY. Now, I'd like to make something (using an Ardunio?) that can detect the beeping of the vario and flash green or red LEDs, depending on whether the plane is in lift or in sink. While it is a simple matter to detect "sounds" in general, the tricky bit is that I'd like to be able to have something that actually detects and differentiates between those two tones. I spoke to martind of the hackspace and he remarked that DSPs might be needed which might be a little out of my depth!
Additional notes:-
* My background is pretty much software (desktop programming), not electronics. But I gather that the electronics aspects of this won't be that tricky - hopefully!
* I have an Arduino Uno.
* I do not want to get into building varios - the real stuff costs a few hundred quid, and I don't really want to get into trying to figure out algorithms for lift/sink! I'd prefer to let the real vario do the heavy work, & simply pick up the tones it makes.
* An example of what I might be looking at can be found here - http://www.borgeltinstruments.com/B500advert.html (see the LEDs in the vario). That vario costs something like £500+ though!
* Not really relevant, but I'll be away as of this weekend for a few weeks so may be slow to reply after that... This also means any actual work will probably have to wait until I return. :(
Thoughts?
Many thanks in advance!
Yoav (a.k.a. Mrdini on IRC)
Which is very much a signal processing challenge. The practical matter of connecting a mic to an Arduino should not pose big problems; but I don't know if the Uno can sample at a sufficiently high frequency, and detecting the sound in sort-of-realtime on such a small chip may require additional magic.
m.
> - as Yoav says, pitch detection would be nice but is optional
I misunderstood. Detecting pitch is very much the point of this project.
m.
This sounds pretty easy. The only additional hardware you need is a
microphone with an amplifier, like one of these:
http://www.hobbytronics.co.uk/electret-microphone-breakout
http://www.sparkfun.com/products/9868
and something to display the result on, e.g. a LED bar, or a
multicoloured LED, or repurpose an analogue voltmeter or something.
According to this page you can easily increase the sampling rate of
the Uno's ADC above what you need (default is about 10 kHz apparently
which *may* be enough. 20 would be better though).
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1208715493/11
Then you just need an algorithm to detect the vario value. From the
sound it is just repeatedly playing a tone burst followed by silence,
at a varying rate, so you have two clues to decode: the pitch, and the
"beep rate". Pitch would be easiest, you can do something fancy from
here: http://en.wikipedia.org/wiki/Frequency_estimation
or just use the FFT. Actually I don't know if the uno has enough power
for that. You may need something even more simple... And you also need
a way to detect whether the tone is on or off.
This is one of those things that you can make as complicated as you like!
Actually a really really simple initial method could be as follows:
Get an LED bar with 8 (say) lights, connect each one to a PWM output.
For each LED, calculate the frequency content of the signal at one
single frequency and use the output to light that LED. You can do this
very efficiently if you use a square window.
Ok enough rambling thoughts.
Building a vario sounds very simple to me, the wikipedia article you linked to says that they measure the rate of change
of air pressure. Digital pressure sensors can interface to an arduino easily, and the maths required is far from difficult.
I wrote an interface library for the SCP1000 sensor a while back, it has a resolution equivalent to about 9cm of height
change! Breakout boards for that one don't seem to be available any more, but this looks like it will be just as good:
http://www.sparkfun.com/products/9694
However, an arduino shouldn't have much problem doing a low resolution FFT to extract the pitch data, I know
that an 8 bit PIC can do this.
Nigle
OK, to begin with I am not a glider pilot so may have misunderstood some aspects. This is what I
believe:
For an accurate indication when finding your way out of a sink or into a lift, the extra complications
you mention are important, but the pilot would be keeping a close eye on the variometer at such
times, surely?
My understanding of the original requirement was a need to attract the pilot's attentionto the variometer
when in normal flight when there is a significant sink or lift rate, to draw the pilot's attention to the variometer
to then respond appropriately to the situation. I would have thought that a simple vertical speed based
measurement would be enough for this.
I didn't listen to the examples of the sound output because I was (and still am) in a noisy public environment
and don't have any headphones with me, perhaps I should have done!
Nigle
Description
The LM567 and LM567C are general purpose tone decoders designed to
provide a saturated transistor switch to ground when an input signal
is present within the passband. The circuit consists of an I and Q
detector driven by a voltage controlled oscillator which determines
the center frequency of the decoder. External components are used to
independently set center frequency, bandwidth and output delay.
Applications
Touch tone decoding
Precision oscillator
Frequency monitoring and control
Wide band FSK demodulation
Ultrasonic controls
Carrier current remote controls
Communications paging decoders
Features
20 to 1 frequency range with an external resistor
Logic compatible output with 100 mA current sinking capability
Bandwidth adjustable from 0 to 14%
High rejection of out of band signals and noise
Immunity to false signals
Highly stable center frequency
Center frequency adjustable from 0.01 Hz to 500 kHz
Description
--
>
++++++++++[>+>+++>++
+++++>++++++++++<<<<
-]>>>+++++++.>++++++
+++++.+++..---------
.++++++++++.<<+++.<.
The vast majority of electronic varios have an output of some kind that you
could make use of directly, rather than trying to pick up the audio output.
On many models this is intended for driving a secondary display in a
two-seater. Of the ones I know the details about:
- The Cair XK10 has a simple analog output for driving a repeater gauge.
- The Borgelt B50 is similar.
- The Tasman V1000 has a digital output which is actually the raw feed
to its LCD controller, so it can be duplicated to a second matching
screen. I wrote a decoder for this a few years ago.
More modern digital varios e.g. Cambridge and LX models have serial
outputs intended to feed into PDA flight computer software. The open
source XCSoar software supports almost all of these, so its code could
be used as a reference for decoding the data.
Any of these methods could be used to get the data into an Arduino or
similar to drive visual indicators, and would give you better results
than picking up the audio output.
That said, an audio based unit is not too difficult in principle and
would have the advantage that you could transfer it quickly between
aircraft - though you would need to develop separate modes for the
different audio output styles of the various models.
Martin
Right, but if the vario is simply differentiating static pressure in the
cockpit then it will not be telling you what you need to know.
It is easy to make a glider climb by simply pulling the stick back
slightly, and trading in some of your speed for height. And vice versa:
put the stick forward, lower the nose and trade height for speed.
When you do this, the design you describe will tell you that you have
entered lift or sink, when the true vertical movement of the air may in
fact be completely different.
So such an instrument is only really usable in perfectly level flight.
Even the small, ongoing control inputs needed to correct for gusts and
drift can cause spurious readings.
And when soaring, flight is anything but straight and level. The pilot
is continuously adjusting speed (slowing down to make use of lift,
speeding up to escape sink) and turning (to centre in the best lift). So
it's essential to have an instrument that can continue to read
accurately regardless of the aircraft's manouvering.
What we are in fact interested in is not the rate of change of height,
but the rate of change of *total energy*. When we trade height for speed
we are trading potential for kinetic energy, and vice versa. The total
energy of the aircraft stays more or less constant during manouvering,
changing only due to slow loss from drag, and to energy gained or lost
by flying in rising or sinking air.
To measure the total energy, we need to measure both the potential and
kinetic energies of the glider. The potential energy is proportional to
height (and hence pressure), but the kinetic energy is proportional to
the square of the airspeed. So a working solution has to measure both
these properties.
The old fashioned method for doing this is a beautiful mechanical hack -
a tube placed in the airflow with a specially shaped end, designed such
that the pressure in the tube will depend on the static pressure and
the airspeed in exactly the right proportions for the total energy to be
measured as a single pressure.
More modern systems will connect to both static probes and the pitot
tube used by the airspeed indicator, and compute the total energy in
software. This is potentially more accurate.
But either way, you need to be connected to the aircraft's probes, not
just to cockpit pressure.
Martin
I apologise for not replying more individually, but the amount of replies has been insane, and since EE or analogue electronics isn't really my area at all, it's obvious I'll need to do a fair bit of reading to understand the various solutions proposed so far! Just as well I'll be away for a month - plenty of reading time!
* The LM567C seems promising but again will need to understand EE a bit more - it sounds complicated to use to a novice like me! (using voltage to choose which tone you want - wtf? No simple dial?)
* As some suggested, building a basic vario is simple, yes. The difficult bit is total energy compensation & Netto - http://en.wikipedia.org/wiki/Variometer#Total_energy_compensation. More work than I'm willing to invest frankly. This is why I'd prefer to leave the actual mechanics of calculating lift/sink to those who know their stuff & focus on the output from a known working vario :)
* Hacking the vario is not an option as Lester already explained. Neither is connecting to an output from the vario suggested by Martin (which is admittedly tempting!). I fly club gliders at the moment (early solo) so I rarely fly the same glider each time I visit the club. So ideally at the end of this path, I'd love to end up with something portable - say cigarette-box sized or similar. But that's a long way off as I need to build it first!
* Martin correctly points out that each vario has different tones so anything I make should hopefully be easily adjusted.
* An additional "personal" spanner in the works for me is that since I can't hear the tones that well, it makes it doubly difficult to determine what sort of sounds I'm working with & figuring out what exactly it is that I need to detect! :) Maybe I should try to gather sound samples & play with something like Audacity & figure out how pure these tones are... Actually, writing this makes me think I could always email Borgelt & ask. (Our club gliders use old Borgelt varios. Looks like the B40).
Thanks a lot for the ideas so far!
Y.