3
\$\begingroup\$

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.

\$\endgroup\$
5
  • \$\begingroup\$ Old question I realize, but: The model of those relays whose coil runs from 12V only requires 75mA, not 3A. You can easily switch that from the BBB with a single transistor. If you need isolation between BBB and the relay coil, you can use an optoisolator driving a transistor to switch the relay. For input (ie: 12V --> 3.3V --> BBB), just use an optoisolator, no relay required or useful. \$\endgroup\$
    – gwideman
    Commented May 2, 2019 at 23:07
  • 1
    \$\begingroup\$ Thanks for the input @gwideman. I did mean the 3A part though. "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." So I understand that I only need a 75mA for a single relay. The purpose of the board is to control a line which will be connected to many more relays on the 12V side which could draw up to 3A total. \$\endgroup\$ Commented May 3, 2019 at 2:22
  • \$\begingroup\$ OK, fair enough! Though that's a lot of relays... and won't that invite the desire to control them individually? \$\endgroup\$
    – gwideman
    Commented May 3, 2019 at 2:56
  • \$\begingroup\$ "I like the isolation and safety it provides" In general we only purposely add galvanic isolation when it adds something. You need some specific requirement like "the secondary is definitely dangerous" (like 230VAC) or "the customer can't be trusted to provide a clean ground" and similar. Otherwise it is not necessary. As for the high side driver, it is completely overkill - these parts are used for relay replacement not for driving relays - any standard MOSFET can do that. And do you really need these high currents? \$\endgroup\$
    – Lundin
    Commented Feb 7, 2023 at 12:28
  • \$\begingroup\$ Question 1: I think you could do this with a logic-level FET with appropriate current rating (if you don't mind the inversion - or two FETs - one small signal and one power FET to get rid of the inversion. ) Question 2: Yes, a divide by 4 (approx) voltage divider. Two resistors. \$\endgroup\$
    – Troutdog
    Commented Jun 7, 2023 at 17:13

2 Answers 2

1
\$\begingroup\$

Since you've attempted to use relays, I imagine that these signals don't switch very fast. If the loads on the 12V side are non-inductive and referenced to ground, then going from 3.3V to 12V is basically a non-inverting op-amp with gain of 12/3.3 (a bit under 4x), with an emitter follower attached to the output, within the feedback path, with a minimal load resistor, say 10k to ground.

Going from 12V to 3.3V is even easier: a resistive divider is all you need. CMOS logic inputs are fairly high impedance and a resistive divider is all it takes to drive them from higher voltages.

You'll also want transient overvoltage protection on the 3.3V side of the divider. That won't be very hard since the divider provides current limiting already.

\$\endgroup\$
0
\$\begingroup\$

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 )

\$\endgroup\$
2
  • \$\begingroup\$ The relay coils don't need 3A, only 75mA. I think OP is confused between coil rating and contact rating. \$\endgroup\$
    – gwideman
    Commented May 2, 2019 at 23:08
  • \$\begingroup\$ I am definitely confused by many parts of this project, but that coil rating vs contact rating is one that I think I understand :) I understand that a single 12V relay only requires 75mA, but I'm looking to control a signal which would be connected to many more relays. That signal may be used to power 40 relays (40 * 75mA = 3A requirement). Of course, I would want some margin for safety too. Sorry for not being clear or using incorrect terminology in all this. I'm not a hardware guy (hence the request fr feedback). Your input is appreciated! \$\endgroup\$ Commented May 3, 2019 at 2:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.