I have read on many websites to use a separate power supply for relay only. But I've few questions. Can I use some component instead of using a separate power supply ? Or what would really the problem if I use same power supply as microcontroller other than rebooting the microcontroller ?
Relay is 5V and needs to turn off and on an AC ceiling fan motor. And I'm using a relay module which has an optocoupler to switch the NPN transistor attached to input signal pin of relay.