The invention discloses a device for optically generating a microwave signal. The device comprises a narrow linewidth adjustable laser (1), a first optical fiber coupler (2), a first optical amplifier(3), a four-port optical circulator (4), a first Brillouin gain optical fiber (5), a three-port optical circulator (6), a second Brillouin gain optical fiber (7), a second optical amplifier (8), a second optical fiber coupler (9), a third optical fiber coupler (10) and a photoelectric detector (11). Laser output by the narrow-linewidth adjustable laser (1) is used as a Brillouin pump. The Brillouin pump generates stimulated Brillouin scattering in the first Brillouin gain optical fiber to generate first-order Stokes, the first-order Stokes generates cascaded stimulated Brillouin scattering inthe second Brillouin gain optical fiber to generate third-order Stokes light, the third-order Stokes and the pump generate beat frequency, and the beat frequency light is converted into a microwave signal through the photoelectric detector. The photo-generated microwave signal is simple in structure and low in cost, and has an application prospect in optical wireless communication, microwave photons and optical fiber sensing.