The model Sun-Earth-Moon is built from the Lego Wedo 2.0 educational kit. The model of “redused” solar system (Sun-Earth-Moon) uses a bevel gear that converts rotation from horizontal to vertical. And thanks to the combination of cylindrical and belt drives, all celestial bodies rotate around each other, and the Earth and the Sun additionally rotate around their axis. A distance sensor can help you count the number of revolutions of the Earth around the Sun by using a variable.
The set includes step-by-step building instructions and a example of program (in Lego Wedo 2.0 environment).