The energy of mobile robots severely limits their range of motion and work capabilities. This paper proposes a method of capturing energy from the amphibious environment for a spherical robot with pendulums. The movement of pendulums is analyzed during amphibious movement, and a feasible scheme is proposed for a pendulum to capture environmental energy and convert mechanical energy into electrical energy. The mathematical model of the swing power generation is established based on the pendulum dynamic equation and voltage balance equation. The physics experiment platform and virtual experimental platform are built to analyse the power generation performance. Furthermore, the power generation mathematical models are established respectively for the spherical robot rolling on the slope and floating in the water, and the power generation performance is analyzed and summarized under different conditions. The results show that the proposed power generation method and scheme can effectively supply the energy to the spherical robot, can enhance the endurance of the movement in the amphibious environment, and provide theoretical guidance for the development of the physical prototype of the new generation of amphibious spherical robot.