Hello,
For Primary side regulation controller , I proposal UCC28704 which don't need 431 and opto-coupler, 5% voltage regulation can meet 24Vout requirement. you can use a DC/DC converter for 5V on secondary side for a accurate 5Vout , you can find some…