Design Review: 3.3V Logic to 12V Logic (Uni-directional and Bi-directional)
An optocoupler ( 4N25 for example ) can provide both isolation and level translation, and it is much cheaper and smaller than a relay. For 12V->3.3V translation it is just an optocoupler and two 1k ohm resistors. One resistor to set LED current to 10mA ( roughly ) and the second one to act as a pull-up ( inverting configuration ). The base terminal can be left open. Connect output transistor as an emitter follower if non-inverting configuration is needed. 3.3V to 12V translation is more complex. BBB may not be able to source current required by the optocoupler so a small n-channel MOSFET will be needed on the input side, and to provide 3A to the relays a p-channel MOSFET should be connected to the output of the optocoupler ( along with a 10k pull-up resistor )