Arduino Forum

Using Arduino => Programming Questions => Topic started by: Rubensg4 on Jun 24, 2016, 03:05 pm

Title: Arduino does not activate the digital port
Post by: Rubensg4 on Jun 24, 2016, 03:05 pm
Hi , I'm trying to make a stand with arduino . But the digital door does not distribute energy or sometimes program is wrong.
 This is sometimes program :

void setup() { 
  //definindo os pinos digitais  7 e 9 
  //como pinos de saída.
  pinMode(8,OUTPUT); 
  pinMode(9,OUTPUT);
  digitalWrite(8,LOW);
  digitalWrite(9,LOW );
}
 
//OBS:o método loop é executado repetidamente enquanto o
//arduino estiver ligado.
void loop() {   
  digitalWrite(8,HIGH);  //liga a roda esquerda
  delay(4000);          //espera 4 segundos

  digitalWrite(9,HIGH); //liga a roda direita
  delay(4000);          //espera 4 segundos

  digitalWrite(8, HIGH); //liga a roda esquerda
  digitalWrite(9,HIGH); //liga a roda direita, fazendo o carrinho ir para frente
  delay(4000);          //espera 4 segundos

  digitalWrite(8,LOW); //desliga a roda esquerda
  digitalWrite(9,LOW); //desliga a roda direita, fazendo o carrinho ir para frente
  delay(4000);          //espera 4 segundos

}
Title: Re: Arduino does not activate the digital port
Post by: sarouje on Jun 24, 2016, 03:31 pm
what is a digital door here? Are you trying to on/off led here? Please give us more details.
Title: Re: Arduino does not activate the digital port
Post by: Rubensg4 on Jun 24, 2016, 03:49 pm
The digital door is 8 and 9.
I tryign to active a mini motor using this door.
Title: Re: Arduino does not activate the digital port
Post by: sterretje on Jun 24, 2016, 04:02 pm
Double check your wiring, next check it again. Please provide a schematic (scan / photo of hand-drawn one is fine) so we can see how you have (or intent to have) everything connected.

Do you have a link for the mini motor? Motors are usually not connected directly to an Arduino. Normal DC motors always need a flyback diode.

Your code will do the following (in an endless loop)
set pin 8 high
wait 4 seconds
set pin 9 high
wait 4 seconds
keep both pins high
wait 4 seconds
set both pins low
wait 4 seconds

Title: Re: Arduino does not activate the digital port
Post by: UKHeliBob on Jun 24, 2016, 05:24 pm
The digital door is 8 and 9.
I tryign to active a mini motor using this door.
How is the motor connected to pins 8 and 9 ?
Title: Re: Arduino does not activate the digital port
Post by: Rubensg4 on Jun 24, 2016, 07:44 pm
The + is conected with a jumper on 8 and 9. And the - is conected with a jumper on GND.
Title: Re: Arduino does not activate the digital port
Post by: sarouje on Jun 24, 2016, 07:48 pm
I really not getting the connectivity, +ve is going to 8 and 9. Please share a schematic.
Title: Re: Arduino does not activate the digital port
Post by: Rubensg4 on Jun 24, 2016, 07:49 pm
When the + 5V is connected to the engine catches . But do not catch the entrances 8 and 9.
Title: Re: Arduino does not activate the digital port
Post by: vaj4088 on Jun 24, 2016, 07:53 pm
Connecting two output pins to each other is a bad idea, ESPECIALLY when one will be high and one will be low as in this sketch.
Title: Re: Arduino does not activate the digital port
Post by: Rubensg4 on Jun 24, 2016, 08:05 pm
Project Images: http://imgur.com/a/oDEck
Title: Re: Arduino does not activate the digital port
Post by: sterretje on Jun 24, 2016, 08:15 pm
You're connecting motors directly to the Arduino. I doubt that that is a good idea. What is the specification of those motors?
Title: Re: Arduino does not activate the digital port
Post by: Rubensg4 on Jun 25, 2016, 11:35 pm
The motor specification https://www.google.com.br/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiIzIC9kMTNAhUMEZAKHdAzAUcQFggeMAA&url=http%3A%2F%2Fcdn.sparkfun.com%2Fdatasheets%2FRobotics%2FDG01D.pdf&usg=AFQjCNGcGOJEYoLUqDqtgu454Jvxi9IOzg&sig2=NToiVmWhCY0zp9JsezWdig
Title: Re: Arduino does not activate the digital port
Post by: aarg on Jun 26, 2016, 01:59 am
You can not safely drive this motor directly from the Arduino.
Title: Re: Arduino does not activate the digital port
Post by: 6v6gt on Jun 26, 2016, 08:49 am
You would be better off looking at something like these instructions for getting started.
https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/overview (https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/overview)
As has been clearly  pointed out to you, your motor https://www.sparkfun.com/products/13302 (https://www.sparkfun.com/products/13302) cannot be driven directly from an Arduino pin which has a maximum current rating of about 25mA