A Raspberry Pi-Based Attitude Sensor
  We have developed a lightweight low-cost attitude sensor, based on a Raspberry Pi, built with readily available commercial components. It can be used in experiments where weight and power are constrained, such as in high- altitude lightweight balloon flights. This attitude sensor will be used as a major building block in a closed-loop control system with driver motors to stabilize and point cameras and telescopes for astronomical observations from a balloon-borne payload. 
A. G. Sreejith, Joice Mathew, Mayuresh Sarpotdar, Rekhesh Mohan,   Akshata Nayak, Margarita Safonova and Jayant Murthy
astro-ph.IM