Electronic – Design Review: 3.3V Logic to 12V Logic (Uni-directional and Bi-directional)

beaglebone blacklevel-translationlogic-levelreviewschematics

I'm looking for feedback and improvements on my design below. Specific questions are at the end. I created this as an attempt to answer my own, previous question. From my feedback there, it seems like I needed to be more clear in my requirements.

These are screenshots from Eagle. If there's a better way to share, please let me know so I can correct it.

Entire board

Schematic of Entire Board
The overall purpose of this board is to translate between 12V logic, and 3.3V logic. The top portion of the board represents the 12V side. The LEDs are placeholders to indicate whether the 12V signal is HIGH or LOW. In practice, these would be replaced with more 12V relays, requiring up to 3A. The switches are also placeholders, allowing one to manually turn the 12V signal on and off. They are only for test purposes, the "real" 12V signal would be coming as the output from other relays.

The bottom half is the 3.3V side. This will be connected to a BeagleBone Black (BBB). The board will connect to 2 output GPIO pins and 2 input GPIO pins of the BBB.

Overall, I want to translate the 3.3V I/O from the BBB to the 12V signals on the other side (to control more relays and read their signals). I have designed 3 modules to control both directions individually, and together.

3V3_TO_12V Module

3V3 to 12V converter

This module converts the 3.3V GPIO output from the BBB to a 12V signal on the other side. When the 3.3V signal is low, the 12V signal is low. When the 3.3V signal is high, the 12V signal is high.

To do this, the 3.3V GPIO output is connect to a high side power switch, which turns a 12V SPST relay on and off. This switches the 12V power as output of the module to be used elsewhere.

12V_TO_3V3 Module

12V_TO_3V3 Module
This module converts a 12V signal to 3.3V signal, to be read by a GPIO input from the BBB on the other side. When the 12V signal is low, the 3.3V signal is low. When the 12V signal is high, the 3.3V signal is high.

To do this, the 12V signal simply turns a 12V SPST relay on and off. This switches the 3.3V power to be read as input by the BBB.

DUAL_12V↔3V3 Module

DUAL_12V↔3V3 Module

This module combines the previous two modules to create a bidirectional translation. If the 12V side is high, the 3.3V input to the BBB GPIO should be high. If the 3.3V output from the BBB GPIO is high, then the 12V side should be high too. It's similar to a logical OR, if either side is high, the corresponding signal on the other side should be high too. A single 12V signal has to be split into individual input and output signals on the 3.3V side for the BBB.

Questions

  1. Is the high side power switch and 12V SPST relay combination overkill for having the BBB GPIO output control the 12V power line? I like the isolation and safety it provides, but it seems too much (in terms of cost and board space)
  2. Is there a better solution for the 12V to 3.3V conversion. I like the simplicity of the 12V SPST relay switching a 3.3V signal, but it takes up lots of room.
  3. Does the DUAL_12V↔3V3 Module (which combines each translation direction) even make sense? This seems wasteful to use 2 relays and a high side driver, but I haven't found simpler solution that achieves the same result.
  4. Should I add pulldown resistors for the BBB GPIO inputs, or are the internal pulldown resistors good enough?

Any other feedback is welcome. I'm new to electronic design.

Best Answer

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 )