Tungsten diselenide (WSe2) and related transition metal dichalcogenides exhibit interesting optoelectronic properties owing to their peculiar band structures originating from the valley degree of freedom. Although the optical generation and detection of valley polarization has been demonstrated, it has been difficult to realize active valley-dependent functions suitable for device applications. We report an electrically switchable, circularly polarized light source based on the material's valley degree of freedom. Our WSe2-based ambipolar transistors emit circularly polarized electroluminescence from p-i-n junctions electrostatically formed in transistor channels. This phenomenon can be explained qualitatively by the electron-hole overlap controlled by the in-plane electric field. Our device demonstrates a route to exploit the valley degree of freedom and the possibility to develop a valley-optoelectronics technology.