Arduino altimeter & airspeed indicator

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

Help Support HomeBuiltAirplanes Forum by donating:

  1. Oct 8, 2019 #121

    Kamcoman77

    Kamcoman77

    Kamcoman77

    Member

    Joined:
    Oct 31, 2018
    Messages:
    12
    Likes Received:
    12
    Location:
    Douglasville, Georgia
    Bill Welter - I'm interested in seeing the code using the TM1637.
     
  2. Oct 8, 2019 #122

    BJC

    BJC

    BJC

    Well-Known Member HBA Supporter

    Joined:
    Oct 7, 2013
    Messages:
    10,202
    Likes Received:
    6,935
    Location:
    97FL, Florida, USA
    pictsidhe, when you get that scaled Hurricane (“Tropical Storm”?) done, it will have more homebuilt components than most homebuilts.


    BJC
     
    pictsidhe likes this.
  3. Oct 9, 2019 #123

    pictsidhe

    pictsidhe

    pictsidhe

    Well-Known Member

    Joined:
    Jul 15, 2014
    Messages:
    7,327
    Likes Received:
    2,107
    Location:
    North Carolina
    There will be some making do before it's 'done'...

    'Tropical Storm', hmmmmm!
     
  4. Nov 12, 2019 #124

    RowanSB

    RowanSB

    RowanSB

    New Member

    Joined:
    Nov 12, 2019
    Messages:
    3
    Likes Received:
    0
    I am considering trying to build a total energy variometer for hang gliding. This requires to know the air speed, so that height losses due to diving (or gains due to pulling back) which are simply converting kinetic energy into potential energy (or vice versa) can be eliminated from the results. The normal way of doing this seems to be to attach a differential air pressure sensor to a pitot tube. However, the differential sensors available seem to have an analogue output, so I am wondering whether one could achieve the same thing by using two of the modern digital absolute pressure sensors (e.g. BMP388), one connected to the pitot and the other to the static port, and just subtract the two readings. These pressure sensors have a resolution of about 10cm altitude, so I would have thought that it ought to work. Has anyone tried this? Or have any thoughts about whether it would work?

    Thanks - Rowan
     
  5. Nov 12, 2019 #125

    Scheny

    Scheny

    Scheny

    Well-Known Member

    Joined:
    Feb 26, 2019
    Messages:
    166
    Likes Received:
    87
    Location:
    Vienna, Austria
    Hi Rowan, as someone who has done both analog in university and digital afterwards, go for the digital solution.

    For non professionals very hard to get an accurate reading circuit done in analog. You are right that you can use two sensors, but you have to calibrate the offset at startup, meaning they should have the same value at zero speed.

    Please read my post a few posts earlier, the Bosch sensors are designed for easy usage and mass production but not for precision. Instead, use the sensor I stated there.

    BR, Andreas
     
  6. Nov 12, 2019 #126

    Aerowerx

    Aerowerx

    Aerowerx

    Well-Known Member

    Joined:
    Dec 1, 2011
    Messages:
    5,269
    Likes Received:
    1,471
    Location:
    Marion, Ohio
  7. Nov 13, 2019 #127

    Kamcoman77

    Kamcoman77

    Kamcoman77

    Member

    Joined:
    Oct 31, 2018
    Messages:
    12
    Likes Received:
    12
    Location:
    Douglasville, Georgia
    Bill, can you please post the shorter code for the TM1637 an show which lines of your original code should be deleted? Thanks.
     
  8. Nov 13, 2019 #128

    RowanSB

    RowanSB

    RowanSB

    New Member

    Joined:
    Nov 12, 2019
    Messages:
    3
    Likes Received:
    0
    Are there digital differential sensors? If so please give manufacturers and part numbers. If not, then that would be the reason for considering two absolute digital sensors rather than one analogue differential sensor. In this day and age, using analogue sensors that require careful analogue design, filtering, averaging, calibration etc. etc. seems just the wrong thing to do...

    Thanks - Rowan
     
  9. Nov 13, 2019 #129

    RowanSB

    RowanSB

    RowanSB

    New Member

    Joined:
    Nov 12, 2019
    Messages:
    3
    Likes Received:
    0
    I 100% agree about using digital sensors if possible. That was what set me off down this path. If I use two MS5611 sensors, I would think it should be possible to have the offset calibration done automatically on switch-on (assuming that one did not switch the thing on while flying). I wonder what other errors there would be, e.g. how much noise there would be. Sounds worth a feasibility study to me. When I've got the time I may give it a try.

    Thanks - Rowan
     
  10. Nov 14, 2019 #130

    Aerowerx

    Aerowerx

    Aerowerx

    Well-Known Member

    Joined:
    Dec 1, 2011
    Messages:
    5,269
    Likes Received:
    1,471
    Location:
    Marion, Ohio
    Have you used Google?????

    For example, this came up...
    (My emphasis)

    [Rant on] Why do people not like to Google things themselves?[Rant off]
     
  11. Nov 14, 2019 #131

    FritzW

    FritzW

    FritzW

    Well-Known Member

    Joined:
    Jan 31, 2011
    Messages:
    3,750
    Likes Received:
    3,362
    Location:
    Las Cruces, NM
    The guys been on the group for less than one day and gets insulted on his second post...
     
  12. Nov 14, 2019 #132

    pwood66889

    pwood66889

    pwood66889

    Well-Known Member

    Joined:
    Feb 10, 2007
    Messages:
    1,513
    Likes Received:
    170
    Location:
    Sopchoppy, Florida, USA
    Yeah, we Westerners recognize "quick on the trigger," Fritz.
    How some ever, I aver that Google Dependence may not be a good thing; just saying.
    So let's get back onto part selection and sourcing.
     
  13. Nov 14, 2019 #133

    Scheny

    Scheny

    Scheny

    Well-Known Member

    Joined:
    Feb 26, 2019
    Messages:
    166
    Likes Received:
    87
    Location:
    Vienna, Austria
    Dual MS5611 would get altitude in addition and if I read correct, he also needs altitude.

    Both, the MS and BMP have low noise, but compared to the BMP, the altitude I read stayed within the 10cm with the MS.

    With the BMP, the noise was also less than 10cm, but it drifted up and down by a multiple of that and repeatability (changing altitude and going back to the same spot) was off by half a meter a lot of times.
     
  14. Nov 14, 2019 #134

    Aerowerx

    Aerowerx

    Aerowerx

    Well-Known Member

    Joined:
    Dec 1, 2011
    Messages:
    5,269
    Likes Received:
    1,471
    Location:
    Marion, Ohio
    I just don't like doing other peoples research for them Fritz, just like some on here don't like doing other's design work. Now if someone says they tried but needed help I would be more than glad to, but when the 3rd item in Google is what they are looking for...

    Maybe I am becoming one of those Grumpy Old Men?:mad:
     
  15. Nov 14, 2019 #135

    BJC

    BJC

    BJC

    Well-Known Member HBA Supporter

    Joined:
    Oct 7, 2013
    Messages:
    10,202
    Likes Received:
    6,935
    Location:
    97FL, Florida, USA
    Welcome. I practiced for years, just waiting to get old.


    BJC
     
  16. Nov 14, 2019 #136

    pictsidhe

    pictsidhe

    pictsidhe

    Well-Known Member

    Joined:
    Jul 15, 2014
    Messages:
    7,327
    Likes Received:
    2,107
    Location:
    North Carolina
    Don't just wait, work at it!
     
  17. Nov 14, 2019 #137

    Bill Welter

    Bill Welter

    Bill Welter

    Member

    Joined:
    Jun 11, 2019
    Messages:
    19
    Likes Received:
    10
    Using the 4kpa sensor where 0 pressure is digital, and the TM1637 display

    #include <Esplora.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <time.h>
    #include <stdio.h>
    #include <TM1637Display.h>

    int Corr1 = 0;
    int Sensor1 = 0;
    int OffsetC1 = 0;
    float AirSpeed1 = 0.0;
    int AirSpeed1R = 0;
    int MaxSpeed = 0;
    int SpeedLimit = 170;
    float MagicNum1 = 1.06; // to make the system match a real gauge
    int MPHSwitch = 0; // 0=Knots, 1=MPH
    int MaxSwitch = 21; // MaxSpeed switch select to hold max speed
    int SpeedRefresh = 1500;
    int Brightness = 10;

    #define CLK 3 //21
    #define DIO 4 //45
    TM1637Display display(CLK, DIO);

    // MAIN ///////////////////////////////////
    void setup()
    {
    Serial.begin(9600); // init serial communication at 9600 baud
    Corr1 = analogRead(6); // get 0 pressure on startup
    TM1637Display init();
    display.setBrightness(Brightness); //
    }

    // this loop routine runs over and over again forever:
    void loop()
    {Sensor1 = analogRead(6);// get the offset on startup for ambient pressure
    MPHSwitch = analogRead (15); // check to see if we display MPH or KTs
    OffsetC1 = Sensor1 - Corr1; // so from now on 0 pressure = 0 offset
    AirSpeed1 = (sqrt(OffsetC1*36.749*MagicNum1))*0.868976;
    AirSpeed1R = AirSpeed1; // 1R is INT and this rounds down
    if ((AirSpeed1-AirSpeed1R) > 0.499)
    {(AirSpeed1R = AirSpeed1R+1);} // round to nearest Int, up or down
    if (MaxSpeed < AirSpeed1R) {(MaxSpeed = AirSpeed1R);}
    if (MaxSwitch < 20) { (AirSpeed1R = MaxSpeed);} // display Max Speed instead of actual speed this loop

    if (AirSpeed1 < SpeedLimit) // Max for the 4kpa sensor is ~170 kts
    {
    if (MPHSwitch < 20) // switch set to MPH
    {
    (AirSpeed1R = AirSpeed1R*1.1504);
    display.showNumberDec(AirSpeed1R, true);
    }
    else // switch set to Knots
    {
    display.showNumberDec(AirSpeed1R, false); // only this one statement to display speed on TM1637
    }
    delay (SpeedRefresh);
    }

    } // end of main loop
     
  18. Nov 15, 2019 #138

    Kamcoman77

    Kamcoman77

    Kamcoman77

    Member

    Joined:
    Oct 31, 2018
    Messages:
    12
    Likes Received:
    12
    Location:
    Douglasville, Georgia
    Thank you very much.
     
  19. Nov 15, 2019 #139

    pwood66889

    pwood66889

    pwood66889

    Well-Known Member

    Joined:
    Feb 10, 2007
    Messages:
    1,513
    Likes Received:
    170
    Location:
    Sopchoppy, Florida, USA
    "Using the 4kpa sensor where 0 pressure is digital, and the TM1637 display

    #include <Esplora.h>..."

    Code looks straight forward to me. Indenting for literate reading is my only and very minor comment.
     
  20. Nov 15, 2019 #140

    Bill Welter

    Bill Welter

    Bill Welter

    Member

    Joined:
    Jun 11, 2019
    Messages:
    19
    Likes Received:
    10
    The code it was indented for style and readability, but when pasted into this forum, it took out the indents
     

Share This Page

Group Builder
arrow_white