Poll
Question: interfacing of dc motor, h-bridge and arduino diecimila.
The right program to run the circuit
Interfacing

Pages: [1]   Go Down
Author Topic: trouble shooting  (Read 616 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have tried to connect the arduino with the h-bridge connected to the dc motor. Using the connections defined by the program below, but its not running the dc motor.

My sketch

#define motorpin1 2
#define motorpin2 3
#define motorpin3 4
#define motorpin4 5
#define enablepin 8

void setup() {
  pinMode(motorpin1, OUTPUT);
  pinMode(motorpin2, OUTPUT);
  pinMode(motorpin3, OUTPUT);
  pinMode(motorpin4, OUTPUT);

  // set speedPin high so that motor can turn on:
  digitalWrite(enablepin, HIGH);
}

void loop() {
    digitalWrite(motorpin1, LOW);  
    digitalWrite(motorpin2, HIGH);  
    digitalWrite(motorpin3, LOW);  
    digitalWrite(motorpin4, HIGH);
    delay(500);
    digitalWrite(motorpin1, LOW);  
    digitalWrite(motorpin2, LOW);  
    digitalWrite(motorpin3, LOW);  
    digitalWrite(motorpin4, LOW);
}
    

Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What type of H-bridge are you using?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Anachrocomputer,

Am using a pololu MD03A 12 volt dc h-bridge. Am not sure of the grd connection from the h-bridge. Am sure that the hardware are okey!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 596
Posts: 33283
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't cross post it's not nice.
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

did you remember to connect Arduinos ground to the H bridge ground ?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi MikMo,
 I have grounded the h-bridge at the arduino power pin and at the same time tappes a +5 from the arduino. Or should i ground it on the digital pin of the arduino?
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Connect the Ground pin of the Arduino to the Ground (or 0V) pin of the H-bridge.

You might also want to follow the advice of another poster (in the other thread) and add another 500ms delay at the end of "loop()".
« Last Edit: March 27, 2009, 08:41:52 am by anachrocomputer » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have managed to move my dc motor!! The peroblem was simply that i had missed to connect the pwm from the h-bridge to the pwm of the arduino.
Logged

Pages: [1]   Go Up
Jump to: