I need to build a transistor circuit to go up from 3.3v (output of serial port) to drive some mechanical relays which require 24v input. Thoughts?


2 Answers 2


I would suggest you find some power source and use an npn transistor to switch your relay. Imagine the relay needs 100mA then you would have to provide some 720mA from your source!

Better to switch as following

V+ -------------------|
                     |  |           _
                     |  | Relay     ^  Diode
                     |  |           |
                      |             |
serial ----- [R1]---| Transistor
          |          \
         |R|          |
         |2|          |
          |           |
Gnd ------------------|

Calulate the resistors according to the Hfe of your transistor

  • \$\begingroup\$ Or a mosfet for even easier drive. Searching for relay driver and low-side switches should yield a lot of examples. Looking up open drain/collector may also be enlightening if the concept isn't familiar. \$\endgroup\$
    – XTL
    Commented Jun 29, 2010 at 5:31
  • \$\begingroup\$ I have no real experience with mosfets, and this solution is the one I implemented a few weeks ago (using TTL levels). But your answer is as good as any. \$\endgroup\$
    – Erik
    Commented Jun 29, 2010 at 5:51
  • \$\begingroup\$ Resistor R2 serves no function and can be omitted. \$\endgroup\$
    – stevenvh
    Commented Apr 29, 2012 at 8:13

You need a DC-DC boost converter to generate the 24v. However you didn't mention what your current requirements are.

I have used the following chip to generate a higher voltage for an OLED display: TPS61080. It can generate at least 24v at 100 mA from a 3.3V input.

  • 2
    \$\begingroup\$ Since you probably don't have enough power from the serial port to drive the TPS61080, you may want to combine my answer with Erik's -- create V+ (24v) from your 3.3v supply using the TPS61080 (unless you have another source of 24v), and drive the transistor from the output of the serial port. \$\endgroup\$
    – tcrosley
    Commented Jun 28, 2010 at 21:08
  • 1
    \$\begingroup\$ @PeterJ: How is "mention" better grammar than "say"? We're not talking literature here, are we? \$\endgroup\$
    – Johan.A
    Commented Sep 11, 2013 at 12:28
  • \$\begingroup\$ @Johan.A everything on EE.SE should be a work of art. \$\endgroup\$
    – PeterJ
    Commented Sep 11, 2013 at 12:35
  • \$\begingroup\$ @PeterJ, cleaning up web links and fixing punctuation is okay, but changing the original poster's words when they aren't totally wrong is a bit overboard. Just write your own answer if you think the existing ones are unclear. \$\endgroup\$
    – The Photon
    Commented Sep 11, 2013 at 16:12
  • \$\begingroup\$ -1 as I doubt a DC-DC boost converter powered from a UART will generate enough current 24v to switch a relay... what's needed here is a simple buffer or driver circuit as per Erik's answer and thousands of similar answers on here about "how do I control a relay from my *duino???LOL" \$\endgroup\$
    – John U
    Commented Sep 11, 2013 at 18:19

Your Answer

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