Arduino altimeter & airspeed indicator

HomeBuiltAirplanes.com

Help Support HomeBuiltAirplanes.com:

Aerowerx

Well-Known Member
Joined
Dec 1, 2011
Messages
5,358
Location
Marion, Ohio
Code looks straight forward to me. Indenting for literate reading is my only and very minor comment.
Well, he could have put it all on one line, with no cr/lf! So long as the ";" are there, the compiler won't care. :confused:

Formatting is for humans.
 

pwood66889

Well-Known Member
Joined
Feb 10, 2007
Messages
1,530
Location
Sopchoppy, Florida, USA
Aero is correct - compilers don't care.
How some ever. I feel that program text has two targest - the system that executes it and the "Wet Ware" that has to modify it if it is "successful." Made money at that over a couple decades and have strong thoughts there on. I found that formatting sharpened my debugging - like finding the "}" that was missing. Sorry for the thread drift.
 

Robert Dingus

Well-Known Member
Joined
Feb 11, 2012
Messages
323
Location
somerset, ohio USA
Hello all, i have been trying to make my own version of the Altimeter to use as an experimental project i want to report i have been successful. I used the Arduino, Nano, a 20 point rotary encoder, a Chinese clone of the BME280 chip, and an SD Card module. this unit starts up and displays the current Temp, Humidity, Atmospheric Pressure converted to InHg, and then the Altitude is initially reported as Pressure altitude equal to setting a real Altimeter to 29.92 and can be used to calculate density altitude, then i can use the rotary encoder to set the current local sea level pressure and use this as an accurate MSL Altimeter. Finally all of this data is recorded in real time to the SD card for use later in seeing what i did. Tested it today on the drive home, set it to 120 data points every minute good enough for the car ride home, turns out it was accurate enough to record 43 minutes of data and it worked perfectly for this part of the project.

IMG_1186.jpg
 

Robert Dingus

Well-Known Member
Joined
Feb 11, 2012
Messages
323
Location
somerset, ohio USA
It also has dew point, i am trying to figure out how to get Density altitude to display as an automatic item as well, a few other items would be nice and will post an update when i get it cleaner and smoother. this could be used as a black box of sorts so you just go fly and let it do its thing, for example you could go out and do stall testing, and determine you recovery or altitude loss etc, many things you could do with it.
 

Aerowerx

Well-Known Member
Joined
Dec 1, 2011
Messages
5,358
Location
Marion, Ohio
... a Chinese clone of the BME280 chip,...
I applaud your efforts, Robert, BUT STAY AWAY FROM CHINESE CLONES!!

You have no way of telling how good they are. They may not meet the full specs of the brand names. And many of them are counterfeit.

I bought some GPS modules on eBay a couple months ago. They had a brand name label on them. My requirements went beyond the usual uses. I could not get them to do what I wanted. After some head scratching and further testing I positively identified them as counterfeits. Since they didn't meet the brand name specs, it makes me wonder how good the basic information was (lat and long, I mean).

The moral of the story is, for critical applications like flight instruments spend the money and buy from a reputable dealer (NOT an eBay dealer!).
 

pictsidhe

Well-Known Member
Joined
Jul 15, 2014
Messages
7,372
Location
North Carolina
Chinese clones can be useful for basic experiments. I use them often. At a fraction of the price of the good stuff, I can do more on a budget. But once I've got something worth building properly, I build it properly, with good components. Too many ideas don't pan out for one reason or another for me to spend money on basic experiments.
 

Aerowerx

Well-Known Member
Joined
Dec 1, 2011
Messages
5,358
Location
Marion, Ohio
Chinese clones can be useful for basic experiments. I use them often. At a fraction of the price of the good stuff, I can do more on a budget. But once I've got something worth building properly, I build it properly, with good components. Too many ideas don't pan out for one reason or another for me to spend money on basic experiments.
My problem was that I wanted to program the GPS receiver for different parameters, and to use both GPS and GLONASS. The counterfeit parts would not program, and only received GPS. If you wanted to make sure your house hasn't moved, they are probably OK, but I wanted top-notch performance.

Turns out that all GPS receivers spit out some header information when first powered on. That was how I verified that it was counterfeit. The header info didn't match.

I have even read about basic components (transistors) made in China failing because they were not made to brand name specs. Buyer Beware!

I reiterate. If you want top-notch performance buy from a reputable vendor. DigiKey, Mouser, Jameco to name a few.
 

Hephaestus

Well-Known Member
Joined
Jun 25, 2014
Messages
1,463
Location
YMM
digikey and mouser have issues with getting the 'real' components - i had some issues with a mosfet last year, google ended up pointing the way - they get their fair share of 'accidental' clones slipping into their supply chain...
 

Robert Dingus

Well-Known Member
Joined
Feb 11, 2012
Messages
323
Location
somerset, ohio USA
i agree, the clones are cheap and let me develop the concept so now i am off to get the good stuff.

i will have to bump up to the Arduino Mega, for all i want to do, i found out that the SD card files eat a lot of available memory and resources. unless i use several of the nanos, to make the components redundant and easy to replace if they get damaged.

Robert
 

12notes

Well-Known Member
Lifetime Supporter
Log Member
Joined
Aug 27, 2014
Messages
963
Location
Louisville, KY
i agree, the clones are cheap and let me develop the concept so now i am off to get the good stuff.

i will have to bump up to the Arduino Mega, for all i want to do, i found out that the SD card files eat a lot of available memory and resources. unless i use several of the nanos, to make the components redundant and easy to replace if they get damaged.

Robert
Keep in mind that the Atmega is not the only line of processors for Arduino. You might look at the Artemis (Adafruit or Sparkfun has them) for more memory or additional capabilities.
 

pictsidhe

Well-Known Member
Joined
Jul 15, 2014
Messages
7,372
Location
North Carolina
The official arduino store has nanos for $10. One per instrument is not a huge expense, and also means that an arduino failure only affects one instrument. Integrate everything, it is more complex and more likely to glitch out on you, taking down everything.
 

9aplus

Well-Known Member
Joined
Jan 1, 2008
Messages
48
Location
HR 9A
CAN bus with some buffering can be the right way to integrate... after all big players in automotive and aviation are using CANbus.
 

Aerowerx

Well-Known Member
Joined
Dec 1, 2011
Messages
5,358
Location
Marion, Ohio
i agree, the clones are cheap and let me develop the concept so now i am off to get the good stuff.....
Yes but...

As in my case, if you run into problems is it the part or are you doing something wrong in the design? I pulled my hair out for almost two weeks until I figured out I had counterfeit parts. Then after I got known good ones, it was (that part of the project anyway) running in a couple hours!
 

12notes

Well-Known Member
Lifetime Supporter
Log Member
Joined
Aug 27, 2014
Messages
963
Location
Louisville, KY
Yes but...

As in my case, if you run into problems is it the part or are you doing something wrong in the design? I pulled my hair out for almost two weeks until I figured out I had counterfeit parts. Then after I got known good ones, it was (that part of the project anyway) running in a couple hours!
I've been using Arduino clones for years, never had a problem that wasn't either DOA or the one time Microsoft bricked counterfit USB-FTDI chips (that may have been the ESP8266, it was at least 4-5 years ago, can't remember clearly) .

My favorite ATMEGA328 development board is the RoboRed. UNO compatible, 3 pin connectors (Vcc, Gnd, and signal) for every digital and analog pin, I2C & serial headers, switchable between 5V & 3.3V, and the voltage regulator takes anything from 7-23V and outputs 500mA at 3.3V or 2A at 5V. The extra pins alone help a ton.

http://www.yourduino.com/sunshop/index.php?l=product_detail&p=429
 

Hephaestus

Well-Known Member
Joined
Jun 25, 2014
Messages
1,463
Location
YMM
You guys have it all wrong, once you get past Arduino needs for memory/processor you jump to PJRC teensy products.

I'm starting to become a fan of the esp32 for some things...

In a lot of cases if you're still building in Arduino IDE it's just installing a new board and libraries that are tweaked for the new board.
 

pictsidhe

Well-Known Member
Joined
Jul 15, 2014
Messages
7,372
Location
North Carolina
CAN bus with some buffering can be the right way to integrate... after all big players in automotive and aviation are using CANbus.
CANbus is a royal PITA on my car. I have an intermittent glitch somewhere. That glitch will sometimes show as check engine light, no tacho, no speedo, no ABS, no brakes, no stability control, engine temp in the red. Usually, it's a combination. There is no code...
 

9aplus

Well-Known Member
Joined
Jan 1, 2008
Messages
48
Location
HR 9A
You need to monitor your bus with independent device (storage osciloscope, logic analizer, RPI with proper interface and SW).... can be short cut on the bus too.
 

MadProfessor8138

Well-Known Member
Log Member
Joined
Nov 3, 2015
Messages
736
Location
Ekron,Kentucky
Very interesting thread.....I actually read it from start to finish.
I will admit that probably 75% of the information posted is well over my head when you guys start talking codes,chips,etc.

So I'm just going to show everyone how much of a dumb redneck that I am by asking a stupid question.....
Has anyone developed a DIY kit,with assembly instructions, that the average guy like me can set down and build that will give EFIS and/or EIS info on a digital display or tablet ?

Kevin
 
2
Group Builder
Top