Author Topic: H-Bridge/Arduino question  (Read 10217 times)

0 Members and 1 Guest are viewing this topic.

Offline fynfloodTopic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
H-Bridge/Arduino question
« on: December 31, 2007, 06:59:17 AM »
I'm a noob, so bear with me  ;D

I'm building a bot with an Arduino. I'll be using 2 dc motors to drive it. I've made 2 h-bridges to control them. My questions is, can the h-bridge handle variable speeds. or is it ON and OFF?

I'm using the 6 transistor h-bridge, I'm not sure if that matters any. I guess I need to know if I should be using a digital output with PWM or not. I'd like it to go faster if there isn't anything nearby.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,659
  • Helpful? 169
    • Society of Robots
Re: H-Bridge/Arduino question
« Reply #1 on: December 31, 2007, 04:22:37 PM »
Quote
I've made 2 h-bridges to control them. My questions is, can the h-bridge handle variable speeds. or is it ON and OFF?
yeap you want to use PWM, which is basically turning your motor on and off really really fast. By varying the on/off ratio, you can effectively vary the speed of your motor.

Quote
I'm using the 6 transistor h-bridge
don't H-bridges have only 4 transistors? :P

Offline fynfloodTopic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Re: H-Bridge/Arduino question
« Reply #2 on: December 31, 2007, 05:27:58 PM »
Thanks! Now I've got to figure out how to code the thing ; )

I built a couple of these:


They're easy, and I had the stuff laying around

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: H-Bridge/Arduino question
« Reply #3 on: December 31, 2007, 07:53:32 PM »
lol transistors switching on other transistors in your schematic

wat robot are you making?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline fynfloodTopic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Re: H-Bridge/Arduino question
« Reply #4 on: January 01, 2008, 01:09:44 PM »
lol transistors switching on other transistors in your schematic

what robot are you making?

Just a little guy that moves about, some basic obstacle avoiding. Something wrong with the schematic? It's been around for years.

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: H-Bridge/Arduino question
« Reply #5 on: January 01, 2008, 01:21:13 PM »
the schematic is fine, just you could have used 4 transistors, the 6 transistors makes it slightly easier to use
with 4 u would switch 2 transistors at a time with 6 u would switch one at a time ( that one transistor controlled two others)

its a bit difficult to explain without a drawing, so whatever

the h bridge you made is fine  :)
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Half Shell

  • Robot Overlord
  • ****
  • Posts: 225
  • Helpful? 0
Re: H-Bridge/Arduino question
« Reply #6 on: January 01, 2008, 03:58:00 PM »
fynflood, you should drop me a message sometime. I've built a few robots doing arduino and am actually planning to build a few more soon.

http://itp.nyu.edu/physcomp/Labs/DCMotorControl

This tutorial uses the Texas Instruments SN75440NE dual h bridge. It has complete schematics and shows you code for arduino to on getting variable control.

I hope this helps. Feel free to contact me for help and I would love to know how the bot comes out.

Offline maverick monk

  • Robot Overlord
  • ****
  • Posts: 204
  • Helpful? 0
Re: H-Bridge/Arduino question
« Reply #7 on: January 02, 2008, 02:47:10 PM »
sorry to threadjack, but for simpler programming can you use simple on/off commands???

also,can simple i/o commands be used on pins labled pwm on the arduino board?

Offline Half Shell

  • Robot Overlord
  • ****
  • Posts: 225
  • Helpful? 0
Re: H-Bridge/Arduino question
« Reply #8 on: January 02, 2008, 03:40:01 PM »
I'm not entirely sure if I understand what you're asking, but I'll try my best to answer it.

If you want your motor to simply go full power or off, then you can merely use digitalWrite(#, HIGH); or digitalWrite(#, LOW); where # is the pin # you are outputting on the Arduino.

For the pins of the arduino that are labeled as PWM pins, you can declare them as outputs and merely use the analogWrite(#, #); The first # is the pin that you have it plugged into and the second # is an integer from 0 to 255. The PWM will be variable speed.

 


Get Your Ad Here