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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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 Weird Problem
  • 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 16 replies
  • Subscribers 402 subscribers
  • Views 1168 views
  • Users 0 members are here
  • tutorial
  • help
  • hardware
  • robots
  • prototyping
  • engineering
  • electrical
  • arduino
Related

Weird Problem

dirtdiver
dirtdiver over 13 years ago

I cant find the problem here!

I have a motor hoocked up like shown in the tutorial motors and transistirs, I have a code turnin a PWM pin  high and low  (them i tried with 0 and 255, if there is even a difference)

 

 

 

void setup() {               

 

 

  pinMode(5, OUTPUT);    

}

 

 

void loop() {

  digitalWrite(5, HIGH);  

  delay(1000);             

  digitalWrite(5, LOW);   

  delay(1000);             

}

 

I have 5 volts-0 Volts changing within a second, but when i connect the motor it stays at 0 volts

I hoocked up an LED and it works fine

The motor is not baked, i tried it by connecting it directly to 5 volts and it rotates.

The transistor i used is rated for 1A collector current.

Any ideas where the problem might be?

  • Sign in to reply
  • Cancel

Top Replies

  • YT2095
    YT2095 over 13 years ago in reply to Anonymous-58970 +2
    my circuit works perfectly with the 4k7, I`v just drawn it out for you here: it`s not perfect and may need magnifying a little? but it works great (I have a board with 8 of these on that have been working…
  • YT2095
    YT2095 over 13 years ago +1
    exactly as Pablo said, and you MUST use a resistor from the Arduino pin to the Base, otherwise you have a direct current path from your arduino pin to a power rail, and this can easily destroy that port…
  • mcb1
    mcb1 over 12 years ago in reply to YT2095 +1
    For YT2095 Your circuit works with a 4k7 because the relays don't require as much current as the motor. The 2N2222A 2N2222A has a gain of about 100. That means that if the Base to Emitter current is 1mA…
  • ntewinkel
    0 ntewinkel over 13 years ago

    Sounds like the transistor is the one thing left to check.

     

    Try hooking up the transistor directly (edit: through a resistor!) to 5v on the control pin where the arduino would normally be controlling it. ie, try the whole thing without the arduino control first. Use the arduino just for power and ground.

     

    Check that the transistor is the right type (NPN vs PNP) and that it is not in there backwards.

     

    I know I had a similar issue when I was trying that tutorial a few months ago, but I forget what exactly I did to clear it up.

     

    Cheers,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Anonymous-58970
    0 Anonymous-58970 over 13 years ago

    test that code on another transistor and 1k in base  collector in negitive wire of the motor the emitter pin to gnd if it npn if it pnp positive current side test both if u have npn and pnp

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • YT2095
    0 YT2095 over 13 years ago

    exactly as Pablo said, and you MUST use a resistor from the Arduino pin to the Base, otherwise you have a direct current path from your arduino pin to a power rail, and this can easily destroy that port.

    the Emitter-Base junction is the same as a Diode.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ntewinkel
    0 ntewinkel over 13 years ago

    Here's the Oomlout tutorial, which provides a pretty clear schematic too. Assuming you're using a different tutorial, this might help by giving another angle on it.

    http://www.oomlout.com/oom.php/products/ardx/circ-03

     

    Cheers,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Anonymous-58970
    0 Anonymous-58970 over 13 years ago in reply to ntewinkel

    if that 2.2k miht be the problem i was told 1k resistor  if ur using a 2.2k switch it to 1 k 1/2 watt and i think 1/4 watt be the same

     

    i getting in to arduinos myself so far i know is the 1k resistor is widly used for controlling a transistor

     

    Message was edited by: Pablo Garcia

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • YT2095
    0 YT2095 over 13 years ago in reply to ntewinkel

    quite funny really, I was using the 2N2222A2N2222A yesterday to drive 12v relays with a 5v signal from a TTL And gate image

    I used a 4k7 to feed the base and the base also had a 20k pull-down resistor (so nothing bad happens if I pull the AND chip).

    I`m thinking that IF the transistor is ok, could the Back EMF protection diode be forward biased?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Anonymous-58970
    0 Anonymous-58970 over 13 years ago in reply to YT2095

    4k7 ?

     

    YT2095 u have a schem of that project ?

     

    Message was edited by: Pablo Garcia

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • YT2095
    0 YT2095 over 13 years ago in reply to Anonymous-58970

    No, I haven`t drawn one yet, but I can do if you like, I`ll probably post it in my Blog when I do a write-up for my latest Robot build, it`s very rare that I actually write any of my circuits down to be honest.

    also 4k7 is just the same as 4.7k (4700 ohms), I just write it that way out of habit image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Anonymous-58970
    0 Anonymous-58970 over 13 years ago in reply to YT2095

    it kinda through me off a bit like wtf lol but yea a 4.7k idk i havnt seen any schem other then 1k so if ur having a similer problem try using a 1k seen lot of schem's with 1k if u have the time make a schem in cad soft eagle helps when ur not to sure it allows u to see where u wired it in i fried a L298HN it helps when u build it or draw it making ur own datasheet

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • YT2095
    0 YT2095 over 13 years ago in reply to Anonymous-58970

    my circuit works perfectly with the 4k7, I`v just drawn it out for you here:

    image

    it`s not perfect and may need magnifying a little? but it works great (I have a board with 8 of these on that have been working well for nearly a decade), so this same CCT will also be suitable for the Original post, just swap out the Relay coil for your motor, and the AND gate should be the arduino pin.

    I`m using 12v on mine as that`s what the relays needed, but 5V will work too image

    • Cancel
    • Vote Up +2 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