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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum The MagPi Magazine - Aimed at learners - Printed edition Kickstarter
  • 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 62 replies
  • Subscribers 680 subscribers
  • Views 4891 views
  • Users 0 members are here
Related

The MagPi Magazine - Aimed at learners - Printed edition Kickstarter

bgirardot
bgirardot over 13 years ago

(I have no affiliation with The MagPi Magazine other than happy reader)

 

The MagPi Magazine is an online magazine dedicated to the Raspberry Pi. It focuses on learning about programmming (Python, Scratch, C/C++) and beginner to intermediate level projects of all sorts.

 

I have found it to be very approachable for total new comers to programming and hobbiest tools like the Rasbperry Pi and its GPIO pins.

 

I read a lot of questions that often go along the lines of "I am totally new to programming, where should I start?" and I feel very comfortable telling them to checkout the MagPi magazine among other suggestions.

 

If you have not checked out the MagPi before, I encourage you to do so, even if it is just so you are familer with yet another resource for the Raspberry Pi community. If you want to learn about programming, I would suggest you just start with Issue #1 and work your way forward.

 

I, probably like others, sometimes enjoy having a hard copy of project guide to work with. The MagPi is basically on-line only, but they are currently doing a Kickstarter project to produce a printed set of their first 8 issues.

 

Here is a link to the main MagPi website and if you are interested in getting or supporting the printed editions there is a link to their Kickstarter project:

 

http://www.themagpi.com/

  • Sign in to reply
  • Cancel
  • Former Member
    Former Member over 13 years ago

    On page 6 of the latest magpi, there is a picture of a H bridge motor drive with npn transistors driven from the Pi gpio lines.

    How can the upper transistors ever conduct when they are driven from a 3V3 gpio line?

    Sorry if it's a bit off topic. Just want to warn people who try to build this. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • gdstew
    gdstew over 13 years ago in reply to Former Member

    I have been reading The MagPi since the first issue and I find that it has a good mix of beginner, intermediate, and more advanced articles.

    I definitely recomend it.

     

     

    Luc Cool wrote: How can the upper transistors ever conduct when they are driven from a 3V3 gpio line?

     

    It will work with bipolar junction transisters. With MOSFET transisters it requires a gate voltage that is higher than the source voltage.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • johnbeetem
    johnbeetem over 13 years ago in reply to gdstew

    Gary Stewart wrote:

     

    I have been reading The MagPi since the first issue and I find that it has a good mix of beginner, intermediate, and more advanced articles.

    I definitely recomend it.

     

     

    Luc Cool wrote: How can the upper transistors ever conduct when they are driven from a 3V3 gpio line?

     

    It will work with bipolar junction transisters. With MOSFET transistors it requires a gate voltage that is higher than the source voltage.

    From my understanding of the circuit, you can get the upper transistors to conduct, but you'll only be able to get a volt or so across the motor.  Assuming the upper left and lower right transistors are switched on and the other two are off, your current path from RasPi is through the upper left resistor (maybe a 1V drop), across the upper left transistor's BE junction (0.6V drop), through the motor, and then through the saturated lower right transistor (0.3V drop).  With a 3.3V supply, that leaves only 1.4V across the motor which won't run very fast unless it's a really low voltage motor.  If you need more voltage across the motor, the upper transistor can't switch on.

     

    Wikipedia's article on the H-bridge says:

    A solid-state H bridge is typically constructed using opposite polarity devices, such as PNP bipolar junction transistors or P-channel MOSFETs connected to the high voltage bus and NPN BJTs or N-channel MOSFETs connected to the low voltage bus.

     

    The most efficient MOSFET designs use N-channel MOSFETs on both the high side and low side because they typically have a third of the ON resistance of P-channel MOSFETs. This requires a more complex design since the gates of the high side MOSFETs must be driven positive with respect to the DC supply rail. However, many integrated circuit MOSFET drivers include a charge pump within the device to achieve this.

    You can't directly use PNP transistors with RasPi if the motor voltage is above 3.3V, but you could add two additional NPN transistors to act as inverters to control upper PNP transistors.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 13 years ago in reply to johnbeetem

    Your conclusions are the same as mine John. I posted this on the official pi forum as well, but so far no serious response.

    Another addition I would strongly recommend is an over current protection. This can be a small resistor in the negative line. If the voltage on that exceeds 0.7V, it can drive a transistor that pulls the base drive of the 2 lower transistors low. Another good protection would be diodes preventing the higher motor voltage to return to the pi gpio lines in case one of the transistors breaks. Darlington pnp and npn transistors might be a better choice as they will have a much higher current gain. MOSFETS could be used as well, but they usually require a gate source voltage of at least 5V (the high current ones), so they will need a more complex drive circuit.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 13 years ago in reply to Former Member

    It's a truly dreadful ciruit and has obviously not been tested - a motor driver chip would be the best way to go - if you choose the right one you get all the protection and level shifter bits built in.

     

    Michael Kellett

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 13 years ago in reply to michaelkellett

    I agree, but motor driver circuit are often expensive and difficult to find.

    Besides that, for the purpose of learning how things work, the setup with separate transistors is better.

    If you want to add the protections, it quickly becomes a more complicated circuit.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • gdstew
    gdstew over 13 years ago in reply to Former Member

    Luc Cool Wrote:

    Wikipedia's article on the H-bridge says:

    A solid-state H bridge is typically constructed using opposite polarity devices, such as PNP bipolar junction transistors or P-channel MOSFETs connected to the high voltage bus and NPN BJTs or N-channel MOSFETs connected to the low voltage bus.

     

    The most efficient MOSFET designs use N-channel MOSFETs on both the high side and low side because they typically have a third of the ON resistance of P-channel MOSFETs. This requires a more complex design since the gates of the high side MOSFETs must be driven positive with respect to the DC supply rail. However, many integrated circuit MOSFET drivers include a charge pump within the device to achieve this.

    You can't directly use PNP transistors with RasPi if the motor voltage is above 3.3V, but you could add two additional NPN transistors to act as inverters to control upper PNP transistors.

     

     

    Google L298, a  bipolar transistor H-bridge driver IC and download PDF. It clearly shows NPN transistors high and low side.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 13 years ago in reply to gdstew

    The datasheet only shows the block diagram.

    Since they show the drive of the upper and lower transistor inverted, it makes sense to show 4 npn transistors.

    John Beetem's article from wikipedia looks correct and describes it accurate.

    I don't see a voltage charge pump in the block diagram of the L298, so either the block diagram is highly simplified or the actual

    silicium uses pnp transistors for the upper ones.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • johnbeetem
    johnbeetem over 13 years ago in reply to gdstew

    Gary Stewart wrote:

     

    Google L298, a  bipolar transistor H-bridge driver IC and download PDF. It clearly shows NPN transistors high and low side.

    You can have upper NPN drivers provided that you can get the base voltage higher than the emitter voltage.  The L298 diagram doesn't show the details of the AND gates that drive the upper NPNs.  I suspect they convert TTL input levels to "Vs".  Preferably you'd like those base voltages higher than "Vs" so the upper NPN turns on fully, but that requires a charge pump.  Delving into the L298 data sheet, I see voltage drops of 1.35V (typ at 1A) on the high side and 1.2V (typ at 1A) on the low side.  That's a total of 2.55V at 1A = 2.55W, hence the large ground pads.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 13 years ago

    I sent my rpi or rip back to cpc cos the ethernet and updates didn't work and I got fed up with reflashing img. Might buy another when it's more mature.I liked PIC usage and this looks interesting.good luck to whoever is involved in providing info,it is most welcome.stan

    • 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 © 2026 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