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
Arduino Forum Having trouble switching a relay for my arduino project
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 17 replies
  • Subscribers 392 subscribers
  • Views 1112 views
  • Users 0 members are here
  • arduino
  • relay
Related

Having trouble switching a relay for my arduino project

gub11
gub11 over 10 years ago

I am trying to switch this relay  https://www.sparkfun.com/products/10924  .  I don't think a schematic is necessary so i'll just explain it.  I have my that relay with GND to GND and the signal or vcc or whatever you want to call it pin hooked up to a digital out pin on the arduino, and the pin is writing high then low every 1 second, just to test it.  then i have a positive current running through the relay, that should be switched on and off with a one second delay powering an LED, but it isn't switching, it remains closed.  i have heard that it is because the arduino's digital write high voltage isn't enough to switch the relay, but i'm not sure because it was switching my 10A relay jsut fine.  Ideas?  I realize there is a datasheet but im still new to this kind of stuff so i don't really know what any of it means.

  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 10 years ago +4
    Gabriel; They're trying to teach you how to find and interpret the information, so you can answer your own question. To read a schematic you need to know some of the common lingo, and how things are annotated…
  • shabaz
    shabaz over 10 years ago in reply to gub11 +3
    Gabriel, Please take the time to read it. I quickly scanned it, but it clearly indicated the transistor part number on the schematic, and even provided a URL to the part to help you. How do you expect…
  • shabaz
    shabaz over 10 years ago in reply to gub11 +1
    JP2 is not a transistor. You could have looked up 'transistor' in Wikipedia and identified the symbol if there was any confusion. At this point, I don't know what to suggest I'm afraid. I'm not prepared…
Parents
  • Former Member
    0 Former Member over 10 years ago

    Gabriel;

     

    They're trying to teach you how to find and interpret the information, so you can answer your own question.  To read a schematic you need to know some of the common lingo, and how things are annotated.  For that particular schematic you'd need to know that "Q" is a transistor, "R" is a resistor, "D" is a diode, "JP" is normally a jumper or connector, "U" is a relay, and "LED" is self-explanatory.  The number is somewhat random, but most schematics number from left to right (the circuit is taken to start on the left), and top to bottom. The model or value of component is normally placed by the identifier; so "Q2" is transistor model 2N3904.

     

    Basic two-lead Resistors are easy - There's no wrong way to place it.  Transistors have a base, collector and emitter.  These must be connected properly, to get the desired current flow.  Similarly, a diode has to be connected correctly; normally so that it's forward biased.  LED's are just a diode, so same rules.  Relays can be a pain for anyone, as there's no standard wiring or pinout.

     

    To further complicate things you have "Conventional Current", where the charge flows from positive to negative.  In opposition to this is "Electron Flow" (the way electrons actually move and/or transfer charge), where current flows from negative to positive.  You can thank Benjamin Franklin's mistake in current flow for the two viewpoints.

     

    Most advertisements paint the Arduino, or whatever other microcontroller (or uC) du jour is being presented, as being "easy to use".  They are much easier than programming a bare uC in assembler using individual pin and port configurations.  That doesn't make them easy for someone not familiar with electronics.  The Arduino IDE is very simplistic (for a reason) and easier to use for a non-engineer, than TI's Code Composer Studio or Microchip's MPLab, et al.  You still need to know at least some electronics theory to hook things up yourself.  There are plenty of "this color wire goes here and here" tutorials that will show you how to make something.  I'm assuming you want to go beyond that, judging from your question.

     

    Shabaz is trying to impress upon you that you need a foundation to work from.  When I first read your post I didn't even know if you were speaking of a Normally Open (NO) or Normally Closed (NC) relay; so I wasn't sure whether current was even supposed to flow when the Arduino sent a digital High.  I also looked at the datasheet for that relay, and it states that, for an NC relay at 5VDC, 83mA of current is required to open it.  Arduino I/O pins can't sink more than 20mA, so it's possible that your Arduino pin is now dead.  I know the great folks who designed the Uno put resettable fuses in a number of places, so the pin may be OK.  You'd just have to wait for 30-60 minutes for that line to return to a closed state.  You stated your 10A relay did just fine.  Without knowing anything else I would assume that to activate the relay coil takes <20mA; whatever type it is.

     

    For myself, and all the other engineers I can think of, we started by taking things apart, looking at how it was put together, and then reading up on components we weren't familiar with (usually as kids, when we begun).  The book that Shabaz mentioned is an excellent start.  ALWAYS remember the basics (Ohm's law and the power triangle, especially).  There is also a great series, also by Charles Platt, called "Encyclopedia of Electronic Components", Volumes 1-3 (3 is to come out later this month).  It's better than most of my EE texts at a straightforward explanation of what XYZ component is and does, how to use it, and common gotcha's.  Best of luck with this and your future work.  There are plenty of folks on this site willing to help; but sometimes someone will be pushed toward finding their own explanation.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 10 years ago

    Gabriel;

     

    They're trying to teach you how to find and interpret the information, so you can answer your own question.  To read a schematic you need to know some of the common lingo, and how things are annotated.  For that particular schematic you'd need to know that "Q" is a transistor, "R" is a resistor, "D" is a diode, "JP" is normally a jumper or connector, "U" is a relay, and "LED" is self-explanatory.  The number is somewhat random, but most schematics number from left to right (the circuit is taken to start on the left), and top to bottom. The model or value of component is normally placed by the identifier; so "Q2" is transistor model 2N3904.

     

    Basic two-lead Resistors are easy - There's no wrong way to place it.  Transistors have a base, collector and emitter.  These must be connected properly, to get the desired current flow.  Similarly, a diode has to be connected correctly; normally so that it's forward biased.  LED's are just a diode, so same rules.  Relays can be a pain for anyone, as there's no standard wiring or pinout.

     

    To further complicate things you have "Conventional Current", where the charge flows from positive to negative.  In opposition to this is "Electron Flow" (the way electrons actually move and/or transfer charge), where current flows from negative to positive.  You can thank Benjamin Franklin's mistake in current flow for the two viewpoints.

     

    Most advertisements paint the Arduino, or whatever other microcontroller (or uC) du jour is being presented, as being "easy to use".  They are much easier than programming a bare uC in assembler using individual pin and port configurations.  That doesn't make them easy for someone not familiar with electronics.  The Arduino IDE is very simplistic (for a reason) and easier to use for a non-engineer, than TI's Code Composer Studio or Microchip's MPLab, et al.  You still need to know at least some electronics theory to hook things up yourself.  There are plenty of "this color wire goes here and here" tutorials that will show you how to make something.  I'm assuming you want to go beyond that, judging from your question.

     

    Shabaz is trying to impress upon you that you need a foundation to work from.  When I first read your post I didn't even know if you were speaking of a Normally Open (NO) or Normally Closed (NC) relay; so I wasn't sure whether current was even supposed to flow when the Arduino sent a digital High.  I also looked at the datasheet for that relay, and it states that, for an NC relay at 5VDC, 83mA of current is required to open it.  Arduino I/O pins can't sink more than 20mA, so it's possible that your Arduino pin is now dead.  I know the great folks who designed the Uno put resettable fuses in a number of places, so the pin may be OK.  You'd just have to wait for 30-60 minutes for that line to return to a closed state.  You stated your 10A relay did just fine.  Without knowing anything else I would assume that to activate the relay coil takes <20mA; whatever type it is.

     

    For myself, and all the other engineers I can think of, we started by taking things apart, looking at how it was put together, and then reading up on components we weren't familiar with (usually as kids, when we begun).  The book that Shabaz mentioned is an excellent start.  ALWAYS remember the basics (Ohm's law and the power triangle, especially).  There is also a great series, also by Charles Platt, called "Encyclopedia of Electronic Components", Volumes 1-3 (3 is to come out later this month).  It's better than most of my EE texts at a straightforward explanation of what XYZ component is and does, how to use it, and common gotcha's.  Best of luck with this and your future work.  There are plenty of folks on this site willing to help; but sometimes someone will be pushed toward finding their own explanation.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • gub11
    0 gub11 over 10 years ago in reply to Former Member

    Wow...  Thank you so much, that's the most helpful answer i've ever gotten, not just because you answered my question, but you helped me understand that I can't just ask people for a solution everytime, then I don't learn anything.  I'll be sure to get the book mentioned by shabaz and take a look at the encyclopedia you mentioned.

    Thanks again

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 10 years ago in reply to gub11

    Hi Gabriel,

     

    It was extremely difficult to extract from you that the schematic was the issue. The original post said "I don't think a schematic is necessary so i'll just explain it." which lead me to believe you just needed a few pointers.

    However, it turned out that part of the problem was that reading the schematic was causing the issues.

    Hopefully the books and detailed suggestions by Brian will provide a wealth of information on how to begin reading schematics, and that will empower you to go beyond the fritzing-style diagrams (e.g this one - it would not teach a thing) that are popular with some tutorials but are actually of little use once you want to start learning.


     

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