You will need a 3D gravity sensor and a 3D gyroscope sensor and a lot of time to develop the stabilisation-program to make it work. It will be very likely that it will not work good out of the box. Which means you quadcopter will have multiple drops out of the air.
For the fun of flying a quadcopter have you considered buying one of these?
or
Beeing so cheap is the result of beeing a mass product.
For the fun building something that flies from scratch;
Building something like a small plane with a self-stabilising design (v-shaped wings) will be much much easier.
best regards Stefan