element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Blog Make Arduino Relay breakout boards 3.3V ready
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 29 Oct 2022 4:39 PM Date Created
  • Views 21065 views
  • Likes 10 likes
  • Comments 17 comments
  • arduino
Related
Recommended

Make Arduino Relay breakout boards 3.3V ready

Jan Cumps
Jan Cumps
29 Oct 2022

We all have these 5V Arduino relay breakout boards. They work on 5V, and expect a 5V control signal from your controller. 

image

They work very well in that 5V / 5V setup. But these days, most microcontrollers have 3.3V for a logic high, not 5V. And these boards don't work well with that, because:

Electronics (sort of)

The majority of these breakout boards use a traditional BJT transistor to switch the relay, with a 1K basis resistor.

image

The 5V input voltage, with a 1K basis resistor, will drive the transistor in saturation. But when your logic level is 3.3V, it doesn't (if it does, it's marginal). The relay will not switch with confidence.
To make a transistor saturate at 3.3V input, in this scenario, we need more base current (some members may chime in with the correct transistor graphs: the DC resistance of the 5V relay I'm using is +- 40 Ohm so all parameters can be calculated).

I did not go the formal way to investigate what the best resistor would be. The 1K resistor in the original design is a compromise anyway (just like the 1K resistor for the on/of led and input led). I used my jellybean transistor sense and decided that 500 Ohm would do. (well, I know that 500 Ohm is OK-ish, and it allows me to just solder a 1K resistor on top of the one that's already on the breakout board.)

Solution

Use 5V as the relay board Vcc. The coil needs 5V, there's no way around that.
Solder a 1K resistor on top of the basis resistor of your breakout board. That puts 2 1K resistors in parallel and gives us a saturated transistor. The relay will click with confidence.

LTSpice simulation files (I used a 40R resistor to represent the relay):

ltspice_relay_breakout.zip

  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 2 years ago in reply to scottiebabe +1
    I put the collector and emitter there on my schematic because the other way around wouldn't make sense. I have no easy way to check which is what here . Agree that the lower side pin should be the connector…
  • scottiebabe
    scottiebabe over 2 years ago in reply to Jan Cumps +1
    lol it wasn't your design, you saved the day!
  • scottiebabe
    scottiebabe over 2 years ago in reply to Jan Cumps

    lol it wasn't your design, you saved the day!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to scottiebabe

    Yes, rub it in Smile

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • scottiebabe
    scottiebabe over 2 years ago in reply to Jan Cumps

    Summary: The module failed to switch due to poor design! You are exciting the relay coil when the input is low, which is the same for both a 3v3 or 5V MCU. Though with a 3v3 MCU the emitter-follower is still exciting the relay coil with 1V when the MCU drives a logic high.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to scottiebabe

    I could do that, it's just that piggybacking the additional resistor is easier (and cheaper) than replacing the transistor. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • scottiebabe
    scottiebabe over 2 years ago in reply to Jan Cumps

    LOL its circuit sudoku! Or perhaps the LEDs/diodes are backwards:

    image 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube