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…
Parents
  • 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
Reply
  • 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
Children
No Data
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