Electronic – Driving 12v logic from an MCU

converterlogic-level

I'm looking to drive 12v logic signals (logic level shift) from a PIC24FJ MCU, which can do 3.3v and 5v logic. In one instance, I need to switch a 12v line to LOW, and in an other, I need to provide a pretty constant HIGH 12v. Both of these lines appear to sink a couple mA at most.

Would a relay be my best option for driving these lines? If so, are there any small SMD relays suitable for the job?

Response should be within milliseconds and they do not necessarily need to be low power consumption.

Best Answer

This will drive a 0-12V digital signal from a 0-3.3V processor pin, by pulling a resistor low. It may not achieve 1ms rise times, depending on the capacitance you need to drive, and if you need to supply current, it'll have problems there, too. But it's simple.

Circuit on the left:

  • 0V in -- 12V out (assuming no load pulling low).
  • 3.3V in -- 0.2V out (assuming load less than 2mA or so)

Circuit on the right:

  • 0V in -- 0V out (assuming no load pulling high)
  • 3.3V in -- 12V - 0.2V out (assuming sink current less than 5mA or so)

schematic

simulate this circuit – Schematic created using CircuitLab