Best hardware to use for finding what side a shape is laying on?

I have an octahedron shape with an ESP8266 inside. The goal is for the ESP to know which of the eight sides is facing down. I have tried using the MPU6050 and 9260 with little success due to inconsistent readings. What is the most efficient way to achieve this?

Place a cube inside the octahedron.

Orient it so the vertices of the cube are lined up with the centers of the octahedron's faces.

A metal sphere inside the cube will fall into a corner of the cube according to what face of the octahedron is facing down.

Place contacts in the cube's corners such that the ball will complete a circuit to allow determination of which cube corner the ball is in.

You can use 8 simple "switches" or get clever if you need to save on I/O pins.

a7

Either of the MPU sensors will work fine, if you fix the problem of inconsistent readings. All you need is the accelerometer to determine static orientation, as it tells you the direction of "down".

See the "How to get the best of this forum" message for instructions on posting.

circuitkitty:
I have tried using the MPU6050 and 9260 with little success due to inconsistent readings. What is the most efficient way to achieve this?

Fix the code!

circuitkitty:
I have tried using the MPU6050 and 9260 with little success due to inconsistent readings. What is the most efficient way to achieve this?

A three-axis accelerometer. Since the MPU6050 has one of those I suspect there is something wrong with your sketch. Perhaps you are trying to use the rate gyroscope?!? Maybe use the rate gyroscope just to figure out when the object has stopped turning and then use the accelerometer to tell which side is down.