MEGA 2560 with 48 relays

You will almost certainly need a separate power supply for your loads that the relays control. You need to provide a link or data sheet for the ( 6 eight channel relay modules) and/or optocoupler you plan to use.