Hello, I have a small circuit which is used to activate a relay. Whenever 15V supply is applied, it should turn on the relay. Since the current is so small, a tiny MCU is programmed in such a way that when pin 2(analog pin) reads a voltage greater than 3V it will send high output via pin 5(PWM output) which activates the relay and if its less than that pin 5 will be low thus turning off the relay. MCU gets a constant 5V supply. This circuit was working fine when tested in a breadboard. However when tested in a PCB, the relay is flickering continuously whenever pin2 reads high voltage and for the low voltage it stays off. I am not sure what i am missing here.
Also if there is any other easy way i could turn on the relay without using MCU, i would appreciate it.