element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Relay
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 3 replies
  • Subscribers 665 subscribers
  • Views 434 views
  • Users 0 members are here
  • raspberry_pi
Related

Relay

charlesspong
charlesspong over 11 years ago

Does Any One Know Where I Can Get Hold Of A Relay For That Can Drive 5v Of The Raspberry Pi At A Good Price If There Is One On The Store Could Someone Post The Product Name / No.

Thanks In Advance

  • Sign in to reply
  • Cancel
  • bodgy
    bodgy over 11 years ago

    Charles,

     

    Before part numbers are found, a couple of questions.

     

    1. What will the relay be switching and will it be AC or DC?

     

    2. How many amps must the relay be able to switch?

     

    3. Does it just need one contact or two?

     

    You will also need to add a transistor (NPN something like a BC537 or 2N222)  see this webpage http://www.susa.net/wordpress/2012/06/raspberry-pi-relay-using-gpio/ for what you need, and then once you have answered the above questions  we can point you towards a relay.

     

    Colin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • charlesspong
    charlesspong over 11 years ago in reply to bodgy

    Colin,

     

    Thanks For The Help So Far.

    I Am Switching A DC Fan That Runs At 1.2W Or 0.24 Amps At 5 Volts, I Would Only Need 1 Contact.

    Also On The Web Address You Provided I Found A Post That Explained How Someone Else Had Used A Relay In This Way, They Used A N18AW, Relay A Diode, A 1.2Kohm Resistor And A 2N3904 Transistor All From Maplin Electronics (Maplin.co.uk) - Would That Be Good Match For What I Described Above.

     

    Thanks Again Charles

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • bodgy
    bodgy over 11 years ago in reply to charlesspong

    Charles,

     

    Yes the N18W would be fine, you could also use the NA16W, this one only has one contact, but as they are the same price you just don't use the extra set of contacts. The BC series of transistors are likely to be slightly cheaper as they are a European type rather than the 2Nxxxx which are US.

     

    The 2N3904 is fine, though I would go for slightly extra current gain and select the BC549C, this means drawing less current from the Pi chip pins.

     

    You are looking for a transistor that has an IC rating of between 100 to 300mA and has a gain (Hfe) of 200 - 400 min. The base resistor should be between 4k7 to 6k8, 5k1 being the optimal value.  You could use the 1k2 resistor you mention, but you would be at the limit of what the Pi pins can supply.

     

    Pi pin = 3v3 - 0v7  / resistor value.    Pi pin max is 20mA  so  a 5K1 resistor  = 500uA at the base of the transistor to switch it on. The approximate 0v7 value = the voltage drop between the base and emitter.

     

    With an Hfe of 400 this means 500uA will allow the transistor to easily pass the 100mA required by the relay coil.

     

    Colin

    Charles,

     

    Yes the N18W would be fine, you could also use the NA16W, this one only has one contact, but as they are the same price you just don't use the extra set of contacts. The BC series of transistors are likely to be slightly cheaper as they are a European type rather than the 2Nxxxx which are US.

     

    The 2N3904 is fine, though I would go for slightly extra current gain and select the BC549C, this means drawing less current from the Pi chip pins.

     

    You are looking for a transistor that has an IC rating of between 100 to 300mA and has a gain (Hfe) of 200 - 400 min. The base resistor should be between 4k7 to 6k8, 5k1 being the optimal value.  You could use the 1k2 resistor you mention, but you would be at the limit of what the Pi pins can supply.

     

    Pi pin = 3v3 - 0v7  / resistor value.    Pi pin max is 20mA  so  a 5K1 resistor  = 500uA at the base of the transistor to switch it on. The approximate 0v7 value = the voltage drop between the base and emitter.

     

    With an Hfe of 400 this means 500uA will allow the transistor to easily pass the 100mA required by the relay coil.

     

    From Farnell the Finder Relay (part #1872939 the 6v version could be used as well) would be ideal and cheap too, just freight might be expensive. Damn, no longer available in the UK.

     

    Colin

     

    Whoops, sorry the 1K2 would be OK, I misplaced a decimal point or two.

     

    Message was edited by: Colin Barnard Calculation mistake.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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