# Avi8tor857

Member Since: July 27, 2011

Country: United States

• Ok on the Mega 2360 the I2C pings are 20 (SDA) and 21 (SLC) not A4 and A5.

• For those that want to do an altimeter that closely mimics a real aircraft here is the steps to go along with what is provided here.
First we are getting the barometric pressure in pascals, and in Aviation most measurements are in inHG.
float pressInHG = pressure/3386.389; //convert pa to inHG
Secondly this measures very minute changes and when flying you don’t want you altemeter jumping around that much so we limit the accuracy some.
pressInHG = ((int)(pressInHG100))/100.0; //round to two dec places
Now we look up the current altememter setting for our area. The easiest and most current is the METAR data from the closest airport. The trouble you have there is getting the ICAO for the airport. For example the closest airport to me is Peachtree Dekab Airport or kpdk.
http://www.airlinecodes.co.uk/aptcodesearch.asp
This will get you the METAR
http://weather.noaa.gov/weather/metar.shtml
This will teach you to decode the METAR
http://www.wunderground.com/metarFAQ.asp
but basically look for something like “A2995” which gives you the altimeter setting of 29.95 inHG
float AS = 20.95;//this will need to be updated regularly to get accurate readings.
Then we calculate the altitude.
float altitude = (pow(AS,0.1903) - pow(pressInHG,(1/5.255)))/(1.212
(pow(10,-5))); //calculate altitude
Here is my reference
http://wahiduddin.net/calc/density_altitude.htm
I get readings within 50ft of my GPS, usually within 15ft.

• roybean VFR Aircraft altimeters are usually accurate to within a few hundred feet. The digital ones usually have one like this for higher altitudes as most standard barometers work up to 4k feet or so. So the +/- 400 feet doesn’t surprise me on this.
The FAA regs uses an even/odd altitude depending on direction +500 feet (this + 500 feet is there to allow for inadequacies in instruments).
GPS altitude is usually much more accurate, but since in aviation everyone should be using pressure settings from fixed stations and planes move around the altimeter isn’t adjusted constantly the altitude is wrong but its usually wrong for everyone, sometimes the GPS accuracy can cause issues it that is what you are going by.
However on landing you use ILS or other ground based electronics to fix altitude to within a few feet.

• With the aircraft altimeter if calibrated if you set it the the field elevation then the pressure should be the current pressure. Alternatively if you get the pressure at the airport and set it in the altimeter than it should read the field elevation, if this is true its accurate to a few feet.
Most airports update the pressure every hour, ask the FBO what the pressure is or if you have a radio the airport will have a frequency with an automated notice including the pressure.

• One other thing with the altitude calculation it is using standard pressure p0. So you are getting standard altitude, not true altitude. Pilots use standard altitude at high altitudes as a standard, but small airplanes flying lower use true altitude with the altimeter adjusted to the pressure as reported by the closes station.

• The instructions says to use pins A4 and A5 but on the Ardunio mega 2560 you have to use pins 20 (SDA) and 21 (SCL).

• This may be obvious to some but the instructions just blindly say use pins A4 and A5 but on the Ardunio mega 2560 you have to use pins 20 (SDA) and 21 (SCL).

• How do you know to use the A4 and A5 pins, can these be set somewhere if you want to use different pins?

• Has anyone gotten this to work with the mega 2560, if so which pins are you using I tried mapping it with SDA-A4 and SCL-A5, but I can’t get the code to get past while(Wire.available() and available() is always empty.

In 2003, CU student Nate Seidle blew a power supply in his dorm room and, in lieu of a way to order easy replacements, decided to start his own company. Since then, SparkFun has been committed to sustainably helping our world achieve electronics literacy from our headquarters in Boulder, Colorado.

No matter your vision, SparkFun's products and resources are designed to make the world of electronics more accessible. In addition to over 2,000 open source components and widgets, SparkFun offers curriculum, training and online tutorials designed to help demystify the wonderful world of embedded electronics. We're here to help you start something.