Road to Create | Art of creation

Jun/12

16

Library for the Pololu H-bridge VNH2SP30

For a school project we needed to run four 50Watt peltier elements with an Arduino. Ofcourse pulling the power from the Arduino itself wasn’t an option. Also due to the fact that the Peltiers need 12V to run on full power and the Arduino environment can only supply 5V. Fixing this solution with a bunch of transistors would have been nice, if the total amps needed wouldn’t have been as high as >10A. So this resulted in a big quest over the campus, trying to find a H-bridge we could use, without having to promise we wouldn’t break it. (Common, everyone know I love to watch things burn :p) So Finally we stumbled upon a perfect, relatively cheap solution for our project. The Pololu driver with the VNH2SP30 on board. This neat little board can provide us with up to 14Amp continuous power. Pretty much perfect for now. Sadly there wasn’t an Arduino library available yet, so I decided to build one myself. The library is pretty easy. It provides you with some basic functionality like:

  • PD(PWM pin, FWD pin, RVS pin)  -  Initializes the library (make sure you use a PWM port to actually be able to run PWM!)
  • begin()  -  Initializes the ports and starts the library
  • stop()  -  Stops the driver from driving
  • forward(unsigned byte)  -  Runs the driver in one direction at the given speed
  • reverse(unsigned byte)  - Runs the driver in the other direction at the given speed

There is an expample sketch provided if you are still not sure how to use it.

Is the library not working or do you have any other questions please let me know ;)

Datasheet: http://www.pololu.com/file/0J52/vnh2sp30.pdf

Library: http://douwebartmulder.com/pololudriver.rar

· · ·

No comments yet.

Leave a Reply

<<

>>

Theme Design by devolux.nh2.me