Effect of aircraft speed on barometer Many aircrafts depend on several types of static pressure sensors (barometers) to find the altitude. I assume this sensor need to be located outside the aircraft main body, so that it has a contact with the outside atmosphere to measure its pressure.
Now, won't the speed of the aircraft has an effect on this barometer? The fastest you are, the  faster is the airflow in contact with the pressure sensor, which would cause (erroneous) increased pressure reading.
 A: The sensor you are talking about is a Pitot tube
These have two pressure sensor ports:


*

*a port in the direction of the aircraft's travel/airflow  to sense
the pressure in that direction - the dynamic pressure , whic as you
pointed out, is affected by the aircraft's speed

*and  a port perpendicular to the aircraft's direction of travel to
sense the static pressure - that is, the component of pressure that
is not affected by the aircraft's speed.


The pressure altimeter senses altitude based on the static pressure compared to that pressure at sea level given the current weather, and the differential between the static and dynamic pressure is used to determine the airspeed.
Quite a few aircraft also have radar altimeters, which as the name implies measure the altitude based on measuring time delays between  transmitted and reflected radar pulses.
A: The static pressure is used differentially with the pitot tube dynamic pressure to determine the indicated airspeed (IAS) of the aircraft.  One can think of this as a measure of how many molecules blow past the pitot tube.  (Forget about N2 vs O2, etc.)
The actual speed of the aircraft through the air is measured by true airspeed (TAS), which gets adjusted for temperature and altitude.
Static ports are located on aircraft in areas which tend to make them speed invariant.
So in practice, and in theory, there is little instrument error of the pressure altitude (used for altimeter and for altitude encoding transponder) with airspeed.  If the aircraft were to be in uncoordinated flight, then there might be some instrument error, but that is normally not a factor.
A: There's no change in pressure from air going past a static port.

Those are the static ports from an Airbus A330, but other planes have similar ones.  They're used to measure the static, ambient pressure of the air around the plane, which in turn is used in measuring altitude and other quantities. By being very flush with the surface, they ensure that the airflow past the port is smooth and straight. Once that’s true, I t doesn't matter whether the air is rushing past or not, the port samples the ambient pressure.
Isn't this inconsistent with Bernoulli's principle?  No. That's about the pressure and velocity of a single bit of air as it moves along a streamline.  Here, by comparing air inside and outside, we're not comparing a single piece:  Bernoulli's' principle doesn't apply.
It does apply for a bit of air that starts in front of the plane, goes by the port, and then goes past then end.  It's always moving at the same speed, hence same pressure:  Ports sample that constant pressure.
