The University of Illinois-developed IlliniSat-2 CubeSat bus has multiple redundant attitude determination sensors. To improve the overall system reliability, a sensor fusion algorithm has been developed. This study demonstrates a real-time sensor fusion algorithm that collects the data from each type of sensor and serves as a preprocessing of the sensor data, passing the best estimate of the sensor data to the determination algorithm. The algorithm is also capable of identifying failed sensors and preventing them from adversely affecting attitude determination. The study concludes with HIL tests of the sensor fusion algorithm using CubeSim, an attitude determination and control simulator, demonstrating the fusion of IMU and magnetometer sensors.