Arduino altimeter & airspeed indicator

Discussion in 'Instruments / Avionics / Electrical System' started by cluttonfred, Apr 8, 2015.

Help Support HomeBuiltAirplanes Forum by donating:

  1. Apr 20, 2015 #41

    Aerowerx

    Aerowerx

    Aerowerx

    Well-Known Member

    Joined:
    Dec 1, 2011
    Messages:
    4,601
    Likes Received:
    1,217
    Location:
    Marion, Ohio
    Fred,

    A lot of this discussion is similar to what is in the old threads https://www.homebuiltairplanes.com/...onics-electrical-system/19960-diy-gauges.html and https://www.homebuiltairplanes.com/.../21021-diy-gauges-7-segment-led-displays.html

    You might want to consider air core motors, as used in a lot of the newer automotive gauges. They can go a full 360 degrees, but need two analog signals that vary as sine and cosine. Some of the Arduinos have a pulse width output function, which could be run through a simple filter to get the varying analog signal. One possibility is to have a Arduino Uno mounted on each gauge that does this, with a larger one that does the computations.
     
  2. Apr 20, 2015 #42

    12notes

    12notes

    12notes

    Well-Known Member Lifetime Supporter

    Joined:
    Aug 27, 2014
    Messages:
    692
    Likes Received:
    445
    Location:
    Louisville, KY
    The servos don't use pulse width modulation (PWM) as the Uno typically uses it. The PWM on the Uno generally is used with the analogWrite() function to produce a voltage level by switching the 5 volts on and off at different rates that effectively averages to a lower voltage, the speed of switching on and off determines the value. The 6 PWM ports on the Uno are for this use. If you use the servo library, then analogWrite() won't work on pins 9 & 10.

    The servo library write() uses a different type of PWM - it sends a specific length pulse at regular intervals, the width of that pulse determines the position of the servo, and sends that pulse every 20 ms (although this doesn't need to be exact, many servos will accept anything between 5-25ms). This can be used on almost any pin of the Uno, I think (not sure about pin 0 & 1), and is only subject to the 12 servo limit.
     
  3. Apr 20, 2015 #43

    12notes

    12notes

    12notes

    Well-Known Member Lifetime Supporter

    Joined:
    Aug 27, 2014
    Messages:
    692
    Likes Received:
    445
    Location:
    Louisville, KY
    A stepper would need a stepper controller, but is fairly easy to wire up and use. Personally, I've been using the A4988 stepper driver boards from Pololu.com, they are simple to use and can adjust from a full step down to 1/16th step. If you use a fixed step size, then you just need 2 pins on the arduino, direction and step. If you need to vary the step size, it uses 5 pins.
     
  4. Apr 22, 2015 #44

    Aerowerx

    Aerowerx

    Aerowerx

    Well-Known Member

    Joined:
    Dec 1, 2011
    Messages:
    4,601
    Likes Received:
    1,217
    Location:
    Marion, Ohio
    Have you considered these air core motors?

    The problem with conventional steppers or servos is that they have no indexing of the position, so some type of potentiometer is needed for feedback. This means an A/D input on the Arduino. R/C servos have a potentiometer built in. It would have to be added to a stepper. Then, most potentiometers are not capable of 360 degree rotation, so any multi pointer gauge would be a problem

    The air core motors, although technically are a stepper motor, is different. Unlike the typical stepper, they have only 2 poles and are feed with 2 DC signals that have a quadrature (sine-cosine) matter. What ever the sine vs cosine angle is, that is the position of the motor, and they can rotate a full 360 degrees. No need for feedback. Of course, this then needs 2 analog outputs. I have noticed that some of the Arduinos have a variable pulse width output. Two of them could be used, and then fed through a simple resistor-capacitor filter to obtain the analog signals. One pulse width would vary as the cosine of the angle, and the other as the sine of the angle.

    For a multi pointer gauge, you would need some type of gear reduction. But another idea I have come up with is using one of these motors for a 0-1000 foot (or 0-10000) altimeter, then a 2 digit LED display for the thousands and ten thousands.

    Have you looked at the DIY flight simulator web sites? That is where I got the idea for these. One even shows how to build your own air core motors.
     
  5. Apr 22, 2015 #45

    cluttonfred

    cluttonfred

    cluttonfred

    Well-Known Member

    Joined:
    Feb 13, 2010
    Messages:
    6,351
    Likes Received:
    2,208
    Location:
    World traveler
    Thanks, Aerowerx, I will take a look at air core options and how folks are using them with an Arduino. I do understand your point about stepper motors, but I think there may be another way simpler way by having the stepper find the home position each time it turns on. As I understand it, the steppers are quite precise in terms of following instructions (forward 12, back 3, forward 18, etc.) but they get lost, so to speak, without some way to start at zero each time they are powered on. In the case of an altimeter, the Arduino would simply run a calibration each time it starts up, perhaps turning the motor backwards until it hits a microswitch to mark the home position for reference. Except for the calibration routine it would ignore the switch. With a 10,000 ft single pointer altimeter, making 9,900 ft the home position would avoid hitting the switch all the time unless you are flying from La Paz. The mixed digital/analog idea is interesting but perhaps more complex than I need. Either way, I am nowhere near ready to tackle this project just yet. When I am, I will probably start simply with just a digital altimeter and move up from there.
     
  6. Apr 22, 2015 #46

    cluttonfred

    cluttonfred

    cluttonfred

    Well-Known Member

    Joined:
    Feb 13, 2010
    Messages:
    6,351
    Likes Received:
    2,208
    Location:
    World traveler
    Thanks, Aerowerx, I will take a look at air core options and how folks are using them with an Arduino. I do understand your point about stepper motors, but I think there may be another way simpler way by having the stepper find the home position each time it turns on. As I understand it, the steppers are quite precise in terms of following instructions (forward 12, back 3, forward 18, etc.) but they get lost, so to speak, without some way to start at zero each time they are powered on. In the case of an altimeter, the Arduino would simply run a calibration each time it starts up, perhaps turning the motor backwards until it hits a microswitch to mark the home position for reference. Except for the calibration routine it would ignore the switch. With a 10,000 ft single pointer altimeter, making 9,950 ft the home position would avoid hitting the switch all the time unless you are flying from La Paz. This common stepper motor, for example, has exactly 200 steps per revolution, which would make an altimeter with 50 ft increments. The mixed digital/analog idea is interesting but perhaps more complex than I need. Either way, I am nowhere near ready to tackle this project just yet. When I am, I will probably start simply with just a digital altimeter and move up from there.
     
  7. Apr 28, 2015 #47

    cluttonfred

    cluttonfred

    cluttonfred

    Well-Known Member

    Joined:
    Feb 13, 2010
    Messages:
    6,351
    Likes Received:
    2,208
    Location:
    World traveler
    I am still messing around with ideas for this basic electronic gauge display. Simpler to pull off and easier to fit an standard gauge sizes than my previous ring of LEDs would be just a four-character alphanumeric LED display for the digital readout over or under a bicolor (red and green or both together make yellow) LED 8x8 matrix for the at-a-glance analog indication.

    Here is one scheme for for a VSI that gives seven indications: level, three rates of climb and three rates of descent. By splitting the level bar yellow over green for a slight climb or red under green for a slight descent, and flashing the maximum arrow at the highest setting, it could show five rates of climb and descent. For simplicity each level could be 1 m/s or 200 fpm, so the VSI would show +/- 5 m/s or 1000 fpm.

    led icons VSI and ASI.jpg

    The last figure is a possible analog ASI indicator to go over or under the analog readout. One thing I might consider if using the same bicolor matrix in each gauge would be to color code the alphanumeric displays by function, say blue for ALT/VSI, white for ASI?

    Cheers,

    Matthew
     
  8. Jan 18, 2016 #48

    martseger63

    martseger63

    martseger63

    New Member

    Joined:
    Apr 12, 2014
    Messages:
    3
    Likes Received:
    7
    Location:
    tallinn
    Hi guys,

    I built a similar experimental flight data system for my homebuilt nanotrike.
    The instrument is based on Arduino Leonardo and 20x4 character display.
    It uses MPXV7002DP differential pressure sensor for pitot, two MAX31855K thermocouple amps for egt and cht probes and Bosch BMP180 barometer for altitude and vertical speed.
    Also features a simple turn and push encoder knob for menu settings and mainly for setting the altimeter.
    The pitot is attached to the unit itself, as it's a naked aircraft. I flew whole summer with it, no issues.
    [​IMG]

    For next season I'm working on Version 2.
    The display will be upgraded to 4" graphical 240x128px lcd and I'll also add rpm sensing circuitry(until now i used external hour meter/tach), fuel level sensor and GPS module for groundspeed and track heading and a CLOCK! :)
    Here's one test screen on 2.5" 128x64px display, will get the bigger one soon.
    [​IMG]
     
    Last edited: Jan 18, 2016
  9. Jan 18, 2016 #49

    BJC

    BJC

    BJC

    Well-Known Member

    Joined:
    Oct 7, 2013
    Messages:
    8,887
    Likes Received:
    5,737
    Location:
    97FL, Florida, USA
    I like it.

    Is HD a magnetic heading or a GPS calculated track?


    BJC
     
  10. Jan 19, 2016 #50

    martseger63

    martseger63

    martseger63

    New Member

    Joined:
    Apr 12, 2014
    Messages:
    3
    Likes Received:
    7
    Location:
    tallinn
    It's GPS track heading, which I feel for me is more useful, because a slow flying nanotrike can fly rather sideways in sidewind..
    So for navigating I'd rather use the real track heading not aircraft nose heading, which can be quite useless most of the time.
    Here's a couple more pictures of the trike, you can also see my 20W LED landing light, real bright, don't want to look straight at it from close, I learned.;)
    [​IMG]
    [​IMG]
    [​IMG]
     
    Last edited: Jan 19, 2016
    Midniteoyl and bmcj like this.
  11. Jan 19, 2016 #51

    BJC

    BJC

    BJC

    Well-Known Member

    Joined:
    Oct 7, 2013
    Messages:
    8,887
    Likes Received:
    5,737
    Location:
    97FL, Florida, USA
    That is what I thought, and for navigation is much more useful than heading. Most EFIS displays use "TRK" of something similar, rather than HD to avoid the confusion between heading and track.

    Probably not an immediate concern to you with a trike, but perhaps a consideration if you plan to sell the unit, is that ATC communications all reference heading rather than track.

    I like it. Keep us informed on your progress.


    BJC
     
  12. Jan 19, 2016 #52

    martseger63

    martseger63

    martseger63

    New Member

    Joined:
    Apr 12, 2014
    Messages:
    3
    Likes Received:
    7
    Location:
    tallinn
    Yes, I will surely standardize the abbreviations and terms later on, this was just an anxious first lcd functional/layout test. Thanks for the TRK hint!
     
    BJC likes this.
  13. Jan 19, 2016 #53

    Bin31

    Bin31

    Bin31

    Member

    Joined:
    Feb 26, 2015
    Messages:
    14
    Likes Received:
    0
    Location:
    France
    To get HDG information, you would need a gyro+compass MEMS unit in your design.

    This is doable but quite challenging because of all sort biais or drift those MEMS sensors suffer from and the soft/hard compensation that have to be addressed with adequate filtering and calibration.

    Some Honeywell HMR modules would do the job but are not affordable.

    Leisure IMUs would be a good hardware base to provide raw data to a fast MCU that would do the filtering.
     
  14. Jan 19, 2016 #54

    Aerowerx

    Aerowerx

    Aerowerx

    Well-Known Member

    Joined:
    Dec 1, 2011
    Messages:
    4,601
    Likes Received:
    1,217
    Location:
    Marion, Ohio
    Not really. IIRC there are 9 or 10 DOF arduino shields that do all of this for you.
     
  15. Jan 19, 2016 #55

    Bin31

    Bin31

    Bin31

    Member

    Joined:
    Feb 26, 2015
    Messages:
    14
    Likes Received:
    0
    Location:
    France
    Really ? Give me just one example of such a shield able to address MEMS subtilities in order to provide a heading as good as a regular compass would do and this at an affordable cost.

    Not affordable, it exists look up Honeywell HMR devices.
     
  16. Jan 19, 2016 #56

    Himat

    Himat

    Himat

    Well-Known Member

    Joined:
    May 5, 2011
    Messages:
    2,752
    Likes Received:
    632
    Location:
    Norway
    But do ATC notice the difference?
    Would not ATC make more notice if a plane crabbing along reported a heading very different from where it was going?
     
  17. Jan 19, 2016 #57

    Joe Fisher

    Joe Fisher

    Joe Fisher

    Well-Known Member

    Joined:
    Feb 11, 2007
    Messages:
    1,384
    Likes Received:
    374
    Location:
    Galesburg, KS South east Kansas
    As far as ATC is concerned the airplanes are all flying in the same air. If two airplanes are flying the same heading and have a mile separation they can not collide. If one is flying ground track and the other heading they have a convergence.
     
  18. Jan 19, 2016 #58

    Himat

    Himat

    Himat

    Well-Known Member

    Joined:
    May 5, 2011
    Messages:
    2,752
    Likes Received:
    632
    Location:
    Norway
    Thanks!
    I do see that mixing different quantities here make a mess.
     
  19. Jan 20, 2016 #59

    Aerowerx

    Aerowerx

    Aerowerx

    Well-Known Member

    Joined:
    Dec 1, 2011
    Messages:
    4,601
    Likes Received:
    1,217
    Location:
    Marion, Ohio
  20. Jan 20, 2016 #60

    Bin31

    Bin31

    Bin31

    Member

    Joined:
    Feb 26, 2015
    Messages:
    14
    Likes Received:
    0
    Location:
    France
    No trace of compass in your link... No big deal...

    But they just illustrate what i wrote in my post.

    Complex Software filtering is required if you want to get something from any IMU based on MEMS in general.

    For a compass the challenge is that measure of earth magnetic field is disturbed by soft or hard iron around.

    Extended calibration is required but my experience showed that repeatability was not at the level of a regular compass with those low performance but cheap IMU.
     

Share This Page

arrow_white