

A PWM (Pulse Width Modulation) relay is an electromechanical switch designed to control the power delivered to a load using PWM signals. By varying the duty cycle of the PWM signal, the relay enables precise control over parameters such as speed, brightness, or temperature. This makes it an efficient and versatile component for applications requiring variable power delivery.








The PWM relay typically has the following pin configuration:
| Pin Name | Description |
|---|---|
| VCC | Power supply input for the relay module (e.g., 5V, 12V, or 24V). |
| GND | Ground connection for the relay module. |
| PWM IN | PWM signal input to control the relay's switching behavior. |
| NO (Normally Open) | Normally open terminal for the load connection. |
| NC (Normally Closed) | Normally closed terminal for the load connection. |
| COM | Common terminal for the load connection. |
Below is an example of how to control a PWM relay using an Arduino UNO:
// Example: Controlling a PWM Relay with Arduino UNO
// This code generates a PWM signal on pin 9 to control the relay's duty cycle.
const int pwmPin = 9; // PWM output pin connected to the relay's PWM IN pin
int dutyCycle = 128; // Initial duty cycle (50% of 255 for 8-bit PWM)
void setup() {
pinMode(pwmPin, OUTPUT); // Set the PWM pin as an output
}
void loop() {
analogWrite(pwmPin, dutyCycle); // Write the PWM signal to the relay
delay(1000); // Keep the current duty cycle for 1 second
// Increase the duty cycle by 10% every second
dutyCycle += 26; // 26 is approximately 10% of 255
if (dutyCycle > 255) {
dutyCycle = 0; // Reset to 0% duty cycle after reaching 100%
}
}
| Issue | Possible Cause | Solution |
|---|---|---|
| Relay does not switch on/off as expected. | Incorrect PWM signal frequency or duty cycle. | Verify that the PWM signal is within the specified frequency and duty cycle. |
| Load is not powered. | Incorrect wiring of the load to the relay terminals. | Double-check the connections to the NO, NC, and COM terminals. |
| Relay module overheats. | Exceeding the relay's current or voltage ratings. | Ensure the load does not exceed the relay's maximum ratings. |
| PWM signal not detected by the relay. | Insufficient voltage or current from the PWM source. | Use a stronger PWM signal or check the microcontroller's output settings. |
Can I use a PWM relay with an AC load?
What happens if I use a PWM frequency outside the specified range?
Can I control multiple relays with a single microcontroller?
Is optocoupler isolation necessary?
By following this documentation, you can effectively integrate a PWM relay into your projects for precise and efficient power control.