A universal digital dimmer comprising: an electromagnetic radiation control circuit, a zero level detector, a leading/trailing edge automatic detector, an encoded signal generator, a first no-load detection circuit, a power supply circuit, and a state indicator, characterized by further comprising a dual-core or multi-core microcontroller for comparing a power waveform with a dimming waveform including an output controller, wherein the dual-core or multi-core microcontroller is connected to the zero level detector, the leading/trailing edge automatic detector, the encoded signal generator, the first no-load detection circuit, the power supply circuit, the state indicator; wherein the EMR control circuit is connected to an alternating current input; wherein the EMR control circuit is connected to a rectifier circuit, a switch circuit, a low-power current amplifier and speed-up loop and the output controller in turn so that the output controller provides a load AC power; wherein a partial current flows through the EMR control circuit to the power supply circuit so that the power supply circuit provides the dual-core or multi-core microcontroller 5V direct current; wherein the leading/trailing edge automatic detector is configured to provide for automatic switching to activate a leading edge control mode or a trailing edge control mode, while the zero level detector has a functionality of detecting a waveform of the input waveform in the leading edge control mode and the trailing edge control mode; wherein the dual-core or multi-core microcontroller includes a maximum value/minimum value setting circuit (701, 702), an over-temperature protection circuit, a dimming up/down detection circuit (704, 705), a slow-start and memory module built in ON/OFF switch, an auto-hibernation circuit, an auto-wake-up circuit, a leading edge/trailing edge signal generator, a second no-load detection circuit, a waveform abnormality detection circuit microcontroller, and an abnormal waveform detection, comparison and correction circuit; wherein one end of the maximum value/minimum value setting circuit (701, 702) is connected to the power supply circuit, while the other end of the maximum value/minimum value setting circuit (701, 702) is connected to the output controller, wherein the universal digital dimmer further comprises an adjustable resistance, said adjustable resistance being connected between the power supply circuit and the end of the maximum value/minimum value setting circuit (701, 702); wherein one end of the over-temperature protection circuit is connected to the first no-load detection circuit while the other end thereof is connected to the output controller; wherein one end of the dimming up/down detection circuit (704, 705) and one end of the slow-start and memory module built in ON/OFF switch are connected to the encoded signal generator respectively while the other end of the dimming up/down detection circuit (704, 705) is connected to the output controller; wherein the slow-start and memory module built in ON/OFF switch, the auto-hibernation circuit, the auto-wake-up circuit, the leading edge/trailing edge signal generator, and the second no-load detection circuit are connected to the output controller; one end of the waveform abnormality detection circuit microcontroller being connected to the zero level detector while the other end thereof being connected to the abnormal waveform detection, comparison and correction circuit; the abnormal waveform detection, comparison and correction circuit being connected to the output controller; wherein one dual-core or multi-core central processing unit of the dual-core or multi-core microcontroller is used for detection, while the other/another dual-core or multi-core CPU thereof is used for automatic dimming control, so that detection and automatic dimming control are performed independently by the dual-core or multi-core microcontroller, wherein said detection includes waveform abnormality detection in said input waveform in the leading edge control mode or the trailing edge control mode with the zero level detector detecting a signal of a zero point of the input waveform, wherein, when the input waveform has irregular changes and no trigger signal is detected, a preset waveform in the dual-core or multi-core microcontroller is used as a baseline for correction of a waveform distortion between the power waveform and the dimming waveform.