I am basically a computer engineer and having only basics in electronics and electrical field. I have also searched for the solution but it looks, it would be better if i ask it to experts here...

Micro-Controllers are designed to work only if the input characteristics are met. If wrongly connected, it may damage the board.

What i am trying to achieve is ( OUTPUT ) :

  1. Say i want to accept Point A as Positive Pole, Which goes to VCC
  2. Say i want to accept Point B as Ground Pole, Which goes to GND
  3. Say i want to accept Voltage accross A and B should be 5V

As to the INPUT :

  1. User has two wires coming from DC Battery 12V
  2. User has two points : Point X and Point Y for connecting these two wires
  3. No matter, however user connects two wires coming from DC Battery 12V to Point X and Point Y ( May be + or - to Point X and remaining to the Point Y)

How should i design a circuit which takes above X and Y as input and Produce A and B as output 5v across, So that i can save the micro-controller even if end user mistakenly connects positive and negative wires. Thanking you so much in advance.

  • \$\begingroup\$ You want a bridge rectifier followed by a voltage regulator. \$\endgroup\$ – Hearth May 12 '18 at 19:48
  • \$\begingroup\$ I think, what you really want is save the microcontroller. In that case just search for "reverse polarity protection IC", like this one: ti.com/lit/ds/symlink/lm74610-q1.pdf. It won't work if plugged wrongly, but it won't get damaged, and the efficiency is very high. A simple LED can tell you if it's plugged correctly! \$\endgroup\$ – Andrés May 12 '18 at 19:53

Use a bridge rectifier before your 12 V to 5 V regulator.


simulate this circuit – Schematic created using CircuitLab

Figure 1. The bridge rectifier BR1 will rectify (as in "correct") the voltage so that input polarity does not matter.

  • 1
    \$\begingroup\$ Does work, however very inefficient. If you put 5v in, you might get 3.6v out. \$\endgroup\$ – Andrés May 12 '18 at 19:51
  • \$\begingroup\$ The question specifies 12 V input. Efficiency of polarity protection is 10.6/12 = 90%. \$\endgroup\$ – Transistor May 12 '18 at 19:53
  • \$\begingroup\$ Quantify "very inefficient". This is as efficient as one can hope. Unless you have something better @Andres \$\endgroup\$ – Passerby May 12 '18 at 19:54
  • \$\begingroup\$ I think this might be a XY problem. He states "So that i can save the micro-controller even if end user mistakenly connects positive and negative wires". He doesn't really say that it works when connected both ways, also it goes against normal practice. That's why polarity connectors were invented. BTW, I'm not saying it's not a solution, it does kind of answer the question. \$\endgroup\$ – Andrés May 12 '18 at 19:55
  • \$\begingroup\$ @Andrés, Yes It should work in both ways of connections; Kind attention over point number 3 in INPUT \$\endgroup\$ – Rushikant Pawar May 13 '18 at 5:48

You can use a bridge rectifier, as two other answers have suggested, however if you're in an automotive environment and you have any requirement for other inputs and outputs that probably will not be ideal, because you will not be able to have a common ground.

Another method, which will not allow the device to function if connected in reverse, but will prevent damage is something like this:


simulate this circuit – Schematic created using CircuitLab

The P-channel mosfet in the left schematic conducts in reverse when power is applied in the correct direction (the intrinsic body diode is in parallel with the channel). In reverse, it blocks. D1 protects the MOSFET gate and if you have a MOSFET with a sufficiently high Vgs rating the circuit uses very little current.

Similarly, the relay circuit in the right schematic blocks the input voltage unless it is applied in the correct direction. D2 assures that. D3 absorbs the inductive energy when the relay drops out.

  • \$\begingroup\$ Yes, It will be used in automotive applications only. And i think it should work as @Transistor suggests below, as "we can connect GND to NEGATIVE terminal of dc battery" \$\endgroup\$ – Rushikant Pawar May 13 '18 at 5:57
  • \$\begingroup\$ If you ground both one side of the input to the bridge (standard in cars) and one side of the output, then the bridge will be destroyed when polarity is reversed. \$\endgroup\$ – Spehro Pefhany May 13 '18 at 13:58
  • \$\begingroup\$ Another method if you're regulating the voltage down to 5V or 3.3V is to simply use a series 0.1 cent diode (eg. 1N4005). In automotive situations you also want to deal with load dump and other transients so a TVS can be useful, preferably with some series impedance at the input, but that's outside the scope of this question. \$\endgroup\$ – Spehro Pefhany May 13 '18 at 14:17

A full wave rectifier diode bridge, which is just 4 diodes, would work to ensure that reverse polarity power input would not matter.

A voltage regulator after that would make sure your output is 5V.

Of course there are voltage limits to both, but 12V is easy to rectify and regulate down to 5V. Due to voltage drop across the diode bridge, the end user would not be able to input 5V or less if your target voltage needs to be 5V.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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