Erbium-doped magnesium zinc oxides were prepared through spray pyrolysis deposition at 450 °C with an aqueous solution containing magnesium nitrate, zinc acetate, erbium acetate, and indium nitrate precursors. Diodes with different erbium-doped magnesium zinc oxide thicknesses were fabricated. The effect of erbium-doped magnesium zinc oxide was investigated. The crystalline structure and surface morphology were analyzed using X-ray diffraction and scanning electron microscopy. The films exhibited a zinc oxide structure, with (002), (101), and (102) planes and tiny rods in a mixed hexagonal flakes surface morphology. With the photoluminescence analyses, defect states were identified. The diodes were fabricated via a metallization process in which the top contact was Au and the bottom contact was In. The current–voltage characteristics of these diodes were characterized. The structure resistance increased with the increase in erbium-doped magnesium zinc oxide thickness. With a reverse bias in excess of 8 V, the light spectrum, with two distinct green light emissions at wavelengths of 532 nm and 553 nm, was observed. The light intensity that resulted when using a different operation current of the diodes was investigated. The diode with an erbium-doped magnesium zinc oxide thickness of 230 nm shows high light intensity with an operational current of 80 mA. The emission spectrum with different injection currents for the diodes was characterized and the mechanism is discussed.