How we think BB-8 works

“There’s a gyroscope inside Sphero that helps it keep its orientation no matter where it rolls, and an accelerometer for measuring speed. The sensors inside relay information back to a tablet or phone to control the bot. A counterweight ensures that, as the bot pivots and moves inside, the motorized parts stay to the ground. There are wheels inside moving like a mini RC car’s, tightly pressed against the walls to keep Sphero moving. The upshot: Everything that keeps BB-8 moving is under the hood.”