I am not very experienced with relays but I need to control the state of a relay with a PWM signal such that if the microcontroller is damaged and the controlling pin gets stuck in a high or low state the relay will not get power. I am hoping to implement this with passive components only.
In the image below is my circuit with basic control Digital high = relay off and so on.
If I add a capacitor between the microcontroller and the transistor I will filter out DC but now I need the transistor to stay open when a PWM frequency is applied, or the relay to say closed.
I have tried to simulate it and found that adding a parallel resistor and capacitor after the transistor helped, but not enough as seen below.
I have also changed the duty cycle but this has little to no effect.
The red arrow(red simulated output @ 20KHz) refers to the output from the microcontroller and the blue arrow is the output fed into the relay(blue simulated output).
I have played around with the value of these components and this is as low as I can get voltage (the relay will see) to go.
I am also worried that this might put the relay into an unknown state due to this 3V offset.
I have seen other systems, they use the inherent properties of the inductor in the relay when controlling it with a PWM signal but as this is a 16A relay I am hesitant to do that and I don't want contact welding.
Any help or insight to this design problem is appreciated.