I'm designing a smart socket using an ESP-32 and a mechanical relay that can drive 5A at 240VAC. Following typical relay driving circuits, I would like to use an optocoupler between the MCU and relay. The relay that I'm using is a Panasonic APAN3105 that operate at a low coil power of 110mW(5V@22mA) based on the datasheet.
Typical relay current driver circuit use an optocoupler connected to a transistor which then drives the relay. Since I'm using low coil power relay, can I drive the relay directly from the optocoupler that is within the max collector current? Are there any downsides to this method?
simulate this circuit – Schematic created using CircuitLab
I have not selected the optocoupler yet but have narrowed down to a few which have generally the same properties (If = 20mA, Ic = 50mA)(EL817S(B)(TU)-F, PC817X2CSP9F, TLP785(GB-TP6,F(C)
What is the best way to drive a relay?