Making a visual variometer

121 views
Skip to first unread message

Yoav Felberbaum

unread,
Feb 29, 2012, 6:14:31 PM2/29/12
to london Hackspace
Hello all,

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)

Martin Dittus

unread,
Feb 29, 2012, 6:30:00 PM2/29/12
to london-h...@googlegroups.com
It's an interesting challenge. Specifically what I was thinking when we discussed this:
- planes are very noisy environments, see the videos
- the signal is a tone of changing pitch but fixed timbre (overtone structure)
- as Yoav says, pitch detection would be nice but is optional

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.

Martin Dittus

unread,
Feb 29, 2012, 6:35:12 PM2/29/12
to london-h...@googlegroups.com

On 29 Feb 2012, at 23:30, Martin Dittus wrote:

> - as Yoav says, pitch detection would be nice but is optional

I misunderstood. Detecting pitch is very much the point of this project.

m.

Tim Hutt

unread,
Feb 29, 2012, 6:45:22 PM2/29/12
to london-h...@googlegroups.com

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.

Anthony Bowyer-Lowe

unread,
Feb 29, 2012, 7:09:59 PM2/29/12
to london-h...@googlegroups.com
The tone sounds pretty clean - i.e. a sine - which makes things a lot easier and reduces the need for heavy DSP.

One quick and easy method would be to filter out the environmental noise with a high-Q band-pass filter (easily implemented in analogue electronics with less than a dozen components before hitting the Arduino), then just time the period between the signal's zero crossings (apply a short moving average).

Signal presence can be detected with a simple RMS threshold gate.


A.

Will Pearson

unread,
Feb 29, 2012, 7:32:43 PM2/29/12
to london-h...@googlegroups.com

Doing it purely in electronics shouldn't be too hard.

My initial idea would be something like

Amplify the input signal so it can drive an LED at the end

Build 2 band pass filters*  tune them to frequencies output by the vario

Pass through two LEDs.

My electronic circuit design skills are a bit rusty but I don't see why this wouldn't work. Should be fairly easy to build on a bread board. It should mainly use components from the space, you might need an inductor or two.

You can get more fancy and smooth the signals with capacitors, so it doesn't PWM itself but is has a more even brightness independent of tone. An Arduino is a valid option though, if you are happier with software.

 Will



http://en.wikipedia.org/wiki/Band-pass_filter Or you may want a high pass and low pass, And something that removes the rumble from the glider.

Nigel Worsley

unread,
Feb 29, 2012, 7:51:11 PM2/29/12
to london-h...@googlegroups.com
> * 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!

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

Nick Leaton

unread,
Feb 29, 2012, 8:13:11 PM2/29/12
to london-h...@googlegroups.com
It's much more complex that differentiating height with respect to time. You can trade height for speed. Does that mean you have lost energy or gained it? Do you want to know the speed of the atmosphere, in which case the rate of sink of the glider depends on its type, speed, weight (you can load them up with water), the number of insects splatted on the wing, and your g-loading. 

So a question for Nigel, was the SCP1000 a good microphone and did you have to filter the outputs?
--
Nick

Nigel Worsley

unread,
Feb 29, 2012, 8:36:29 PM2/29/12
to london-h...@googlegroups.com
> It's much more complex that differentiating height with respect to time.

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

M

unread,
Feb 29, 2012, 11:45:42 PM2/29/12
to london-h...@googlegroups.com
How about using a couple of these IC's, KA567/LM567C ?

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

--
>
++++++++++[>+>+++>++
+++++>++++++++++<<<<
-]>>>+++++++.>++++++
+++++.+++..---------
.++++++++++.<<+++.<.

bobby

unread,
Mar 1, 2012, 7:18:45 AM3/1/12
to London Hackspace
Perhaps rather than using a microphone to detect predictable tones
against a high background noise level it could be better to tap the
audio direct from the unit. Does the unit have a headphone/external
audio output? If not it could more than likely be very easily hacked
to replace the inbuilt speaker with an audio out socket. This nice
clean signal could then be processed by your arduino, or indeed if it
is too high in frequency content you could down-shift it an octave or
two with a decade counter logic chip before feeding it to the arduino.

bobs

On Feb 29, 11:14 pm, Yoav Felberbaum <londonhacksp...@mrdini.com>
wrote:

Lester Hawksby

unread,
Mar 1, 2012, 8:32:54 AM3/1/12
to London Hackspace
Sadly there's a minor problem with this. If the OP's vario is
permanently fitted to his instrument panel then, even if the aircraft
is entirely his rather than shared or rental, it is probably not legal
to just hack it. I don't recall the exact rules on this but I do
recall they are strict. A

I am sure there are some varios that have headphone integration -
Yoav, is yours one of them?

I miss gliding. Yoav, if you want a helper with a tiny bit of rather
rusty familiarity with flying, I'd be delighted to be that person. I
am not too bad with an Arduino but must admit to not being anywhere
near an audio wizard. Can you get a recording of your own particular
vario's tone?

(I can't help but wonder, though, if it's going to be easier to
measure vertical velocity than it is to interpret the existing vario
sounds. I do not think the algorithms in a vario can be very
complicated; I've never used a really fancy vario like the one in the
link, but I have used totally pneumatic/mechanical analogue gauges
that can't contain any algorithms at all. While they're certainly less
good, the information they give is of the same character. Much of the
cost of a vario is the cost of certification, which is not applicable
to a device that isn't screwed to the aircraft - though I believe
velcro-ing in a temporary device isn't covered, I'd be inclined to
check with someone more up to date than me)

Best

Lester

Martin Ling

unread,
Mar 1, 2012, 6:00:40 PM3/1/12
to london-h...@googlegroups.com
Hi Yoav,

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

Martin Ling

unread,
Mar 1, 2012, 6:54:58 PM3/1/12
to london-h...@googlegroups.com
On Thu, Mar 01, 2012 at 01:36:29AM -0000, Nigel Worsley wrote:
>
> > It's much more complex that differentiating height with respect to time.
>
> 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?

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

Yoav Felberbaum

unread,
Mar 1, 2012, 7:07:41 PM3/1/12
to london-h...@googlegroups.com
Hallo all,

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.

danny staple

unread,
Mar 2, 2012, 2:27:12 AM3/2/12
to london-h...@googlegroups.com
Turning a simple dial (variable resistor/potentiometer) into a voltage is not so hard  - get a suitably sized pot (100k), set it up as a voltage divider (ie across both +ve/-ve lines), perhaps with some biasing resistors to set the bounds of it, and then wire the varied part to the LM567C input. 

--
Danny Staple

Director, ODM Solutions Ltd
w: http://www.odmsolutions.co.uk
Blog: http://orionrobots.co.uk/blog1-Danny-Staple


Lester Hawksby

unread,
Mar 2, 2012, 9:16:11 AM3/2/12
to London Hackspace
Hi Yoav,

> * 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 :)

Slightly off-the-wall here, but there are quite a lot of people
working on things like autonomous robot model aircraft who are using
accelerometers, gyros and GPS to know their position. I do wonder if
this approach might be worth reading up on because there's a lot of
existing hardware around, along with open source software that almost
certainly has some relevant algorithms already in it - getting from
the data that's in this sort of system to what you need to know for a
total-energy vario is probably not so hard, and the resulting device
would be totally independent of cockpit hardware. However, the cost of
the gear will be greater.

> * 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!

Irritatingly, I found an interesting link that suggests that the B40
*has* an output for external devices that sounds really easy to work
with:
http://www.airtalk.org/borgelt-b40-averager-vt73671.html
but I assume there's no convenient socket for this in the cockpit of a
club glider. (I don't recall ever seeing one but it's been a while).
There shouldn't be any actual regulatory issue in you plugging
something into a headphone jack, though, if there is one.

> * Martin correctly points out that each vario has different tones so anything I make should hopefully be easily adjusted.

This is where the tone decoder chip's voltage-setting features come
in. They allow a dial OR for it to be set from software. (You will
need a little hardware between Arduino and decoder, but there are
various possible approaches and it's not particularly difficult.)

Best

Lester

PS where do you fly from?
Reply all
Reply to author
Forward
0 new messages