Go Down

Topic: Arduino does not activate the digital port (Read 759 times) previous topic - next topic

Rubensg4

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

}

sarouje

what is a digital door here? Are you trying to on/off led here? Please give us more details.
Sony Arouje
http://sonyarouje.com

[Please don't send Personal Messages for any Technical question, use forum instead.]

Rubensg4

The digital door is 8 and 9.
I tryign to active a mini motor using this door.

sterretje

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

If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

UKHeliBob

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 ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Rubensg4

The + is conected with a jumper on 8 and 9. And the - is conected with a jumper on GND.

sarouje

I really not getting the connectivity, +ve is going to 8 and 9. Please share a schematic.
Sony Arouje
http://sonyarouje.com

[Please don't send Personal Messages for any Technical question, use forum instead.]

Rubensg4

When the + 5V is connected to the engine catches . But do not catch the entrances 8 and 9.

vaj4088

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.

Rubensg4

Project Images: http://imgur.com/a/oDEck

sterretje

You're connecting motors directly to the Arduino. I doubt that that is a good idea. What is the specification of those motors?
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Rubensg4

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

aarg

You can not safely drive this motor directly from the Arduino.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

6v6gt

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
As has been clearly  pointed out to you, your motor https://www.sparkfun.com/products/13302 cannot be driven directly from an Arduino pin which has a maximum current rating of about 25mA

Go Up