The invention provides a device and a method for synthesizing ammonia by utilizing renewable energy sources, and relates to the technical field of ammonia synthesis. The device provided by the invention comprises an energy microgrid 1, a water electrolysis hydrogen production device 2, an air separation device 3, a first buffer tank 4, a first compressor 5, a second buffer tank 6, a third buffer tank 18, a heat exchanger 7, a reaction tower 8, a first adsorption column 17, a second adsorption column 11, a third adsorption column 20, a first flash tower 10, a second flash tower 14, a third flash tower 15, a liquid ammonia pump 16, a second compressor 12 and valves. According to the invention, the energy microgrid is used for providing a renewable energy source for hydrogen production by water electrolysis and nitrogen production by air separation, then the prepared hydrogen and nitrogen are mixed and then subjected to a synthetic reaction, and the generated high-temperature outlet gas is subjected to adsorption separation again after flash evaporation, condensation and separation, so that ammonia is obtained. The method can realize production of carbon-free ammonia, and the method combining adsorption separation and condensation separation can improve the nitrogen-hydrogen conversion rate and the ammonia synthesis rate in the ammonia synthesis reaction.