Show Posts
Pages: 1 2 [3] 4 5 ... 18
31  Using Arduino / Project Guidance / Arduino UNO Rev 3 polarity? on: January 19, 2013, 01:37:14 pm
I would like to ask simple question about arduino uno power jack polarity.
which is positive, the needle (at the center of the power jack hole) or the outer circle?
Thank you.
32  Using Arduino / Project Guidance / Re: Can I use this relay to control 12 V DC? on: January 18, 2013, 02:55:47 pm
additional, the powerjack could supply till 2A
33  Using Arduino / Project Guidance / Re: Can I use this relay to control 12 V DC? on: January 18, 2013, 02:52:19 pm
Need help, here is my circuitry, it works on led but not on solenoid:



is there any wrong?
34  Using Arduino / Project Guidance / Re: Can I use this relay to control 12 V DC? on: January 18, 2013, 02:23:42 pm
Yes I do hear a click!
what does it mean? my english is not really good.
Quote
If you put more current through a relay than its ratings, first the life is shortened, and then the contacts weld together. So in either event your solenoid should move.
35  Using Arduino / Project Guidance / Re: Can I use this relay to control 12 V DC? on: January 18, 2013, 02:13:36 pm
But when I connect to that solenoid lock door, and following the code
Code:
//Arduino Sample Code
//www.DFRobot.com
//Last modified on 14th March 2012 by HJS
//This code has been updated to work with the sample code provided in the Wiki
 
int Relay = 3;
 
void setup()
{
  pinMode(13, OUTPUT);         //Set Pin13 as output
  digitalWrite(13, HIGH);     //Set Pin13 High
  pinMode(Relay, OUTPUT);     //Set Pin3 as output
}
void loop()
{
          digitalWrite(Relay, HIGH);   //Turn off relay
          delay(2000);
          digitalWrite(Relay, LOW);    //Turn on relay
          delay(2000);
}

from http://www.dfrobot.com/wiki/index.php?title=Relay_Module_%28Arduino_Compatible%29_%28SKU:_DFR0017%29  <-- here using led

but the solenoid doesn't show any changes. Is it possibly means that the solenoid door lock require more than 5 A?
36  Using Arduino / Project Guidance / Re: Can I use this relay to control 12 V DC? on: January 18, 2013, 01:57:51 pm
I am trying to turn lock and unlocked this solenoid door:
http://www.tokopedia.com/awgmarket/solenoid-door-lock-12v
37  Using Arduino / Project Guidance / Re: Can I use this relay to control 12 V DC? on: January 18, 2013, 01:56:36 pm
Do you know what is the maximum current rating of the relay for 12V DC? I am not sure reading the datasheet.
38  Using Arduino / Project Guidance / Can I use this relay to control 12 V DC? on: January 18, 2013, 01:44:37 pm
Can I use this relay to turn on or off 12V DC electronic equipment?
http://www.dfrobot.com/wiki/index.php?title=Relay_Module_%28Arduino_Compatible%29_%28SKU:_DFR0017%29
39  Using Arduino / Project Guidance / Re: My Relay seems broken? on: January 18, 2013, 01:21:44 pm
I apology to all you because it seems my wrong to do the coding.
I forget that I put attach.servo(3); it means to the same pin with the relay, so it results in flashing, interesting.

Thank you for you kindness to response this post!
40  Using Arduino / Project Guidance / My Relay seems broken? on: January 18, 2013, 01:01:58 pm
I just bought a relay for Arduino and following the tutorial code here: http://www.dfrobot.com/wiki/index.php?title=Relay_Module_%28Arduino_Compatible%29_%28SKU:_DFR0017%29
Code:
//Arduino Sample Code
//www.DFRobot.com
//Last modified on 14th March 2012 by HJS
//This code has been updated to work with the sample code provided in the Wiki
 
int Relay = 3;
 
void setup()
{
  pinMode(13, OUTPUT);         //Set Pin13 as output
  digitalWrite(13, HIGH);     //Set Pin13 High
  pinMode(Relay, OUTPUT);     //Set Pin3 as output
}
void loop()
{
          digitalWrite(Relay, HIGH);   //Turn off relay
          delay(2000);
         
}

But it is only flashing the led and there is a click sound. What happen with my relay? broken?
41  Using Arduino / Motors, Mechanics, and Power / Re: Is it possible to get servo angle ? on: January 18, 2013, 03:24:32 am
What you need is an encoder.

Thank you, it is what I mean!
42  Using Arduino / Motors, Mechanics, and Power / Is it possible to get servo angle ? on: January 17, 2013, 05:01:22 pm
I will use this servo http://geraicerdas.com/mini-servo-turnigy-9g
I could type some code and cause the servo to rotate 0-60 degrees.
It is succesful!

How if I rotate the servo manually (with my hand)
is there a way so I can display in the serial monitor how many degrees I already rotate?

Thank you for reading my post.
Sorry for my bad english, if there is unclear, just let me know  smiley-mr-green
43  Using Arduino / Motors, Mechanics, and Power / Re: Do not know how to run forward the dc motors. on: November 01, 2012, 03:19:08 pm
any help?  smiley-eek-blue
44  Using Arduino / Motors, Mechanics, and Power / Re: Do not know how to run forward the dc motors. on: October 31, 2012, 01:49:57 pm
Okay - do you have the motor shield set for PLL or PWM? The function of the pins changes depending on how you have the board configured.

It would appear that the jumper by the double screw terminal block needs to be set properly.

In PWM mode pin 4 is motor 2 direction and Pin 5 is motor 2 PWM speed control, Pin 7 is Motor 1 Direction and pin 6 is Motor 2 PWM speed control.

Also - Yu don't give a complee listing - do you have you output pins defined properly?



The motor shield set to PWM. well I have made sure the jumper at the PWM mode.
I would like to correct your statement to:
In PWM mode pin 4 is motor 2 direction and Pin 5 is motor 2 PWM speed control, Pin 7 is Motor 1 Direction and pin 6 is Motor 1 PWM speed control.
Well, I have define the output pins properly like this:
Code:
//=======================================================================
//  2 wheels Robot Platform Template
//  www.e-shore.com.my
//=======================================================================
 
//motor control pin
const int E1=5;    //motor 1 (right) enable pin
const int M1=4;    //motor 1 (right) direction pin
const int E2=6;    //motor 2 (left) enable pin
const int M2=7;    //motor 2 (left) direction pin
 
//  setup function
//=======================================================================
void setup()
{
  //configure all motor control pin as output
  pinMode(E1,OUTPUT);
  pinMode(M1,OUTPUT);
  pinMode(E2,OUTPUT);
  pinMode(M2,OUTPUT);
 
  //disable both motor by default
  digitalWrite(E1,LOW);
  digitalWrite(E2,LOW);
 
}
 
//  loop function
//=======================================================================
void loop()
{
  //right wheel forward at 70 PWM speed
  digitalWrite(M1,LOW);
  analogWrite(E1,40);
 
  //left wheel forward at 70 PWM speed
  digitalWrite(M2,HIGH);
  analogWrite(E2,40);
 
  //delay for 300ms
  delay(300);
 
  //right wheel stop
  digitalWrite(E1,LOW);
 
  //left wheel stop
  digitalWrite(E2,LOW);
 
  //program halt
  while(1); 
}
I got the code from http://www.e-shore.com.my/homepage/all-projects/134-2-wheels-robot-platform-setup.html
I also try this code, but can not work:
Code:
//=======================================================================
//  IR Remote Control Mobile Robot
//  www.e-shore.com.my
//=======================================================================
 
#include <IRremote.h>
#include <IRremoteInt.h>
 
//motor control pin
const int E1=5;    //motor 1 (right) enable pin
const int M1=4;    //motor 1 (right) direction pin
const int E2=6;    //motor 2 (left) enable pin
const int M2=7;    //motor 2 (left) direction pin
 
//IR Receiver Module Pin and variable
int RECV_PIN = 2;
IRrecv irrecv(RECV_PIN);
decode_results results;
 
//  setup function
//=======================================================================
void setup()
{
//configure all motor control pin as output
pinMode(E1,OUTPUT);
pinMode(M1,OUTPUT);
pinMode(E2,OUTPUT);
pinMode(M2,OUTPUT);
 
//disable both motor by default
digitalWrite(E1,LOW);
digitalWrite(E2,LOW);
 
//start IR receiver
irrecv.enableIRIn();
}
 
//  loop function
//=======================================================================
void loop()
{
//IR signal received
if(irrecv.decode(&results))
{
//forward (VOL+)
if(results.value==0xFD807F)
{
motor(40,40);
}
//reverse (VOL-)
else if(results.value==0xFD906F)
{
motor(-40,-40);
}
//rotate left (PREVIOUS)
else if(results.value==0xFD20DF)
{
motor(-30,30);
}
//rotate right (NEXT)
else if(results.value==0xFD609F)
{
motor(30,-30);
}
//forward left (POWER)
else if(results.value==0xFD00FF)
{
motor(10,40);
}
//forward right (FUNC/STOP)
else if(results.value==0xFD40BF)
{
motor(40,10);
}
//reverse left (DOWN)
else if(results.value==0xFD10EF)
{
motor(-10,-40);
}
//reverse right (UP)
else if(results.value==0xFD50AF)
{
motor(-40,-10);
}
 
//receive the next value
irrecv.resume();
 
//short delay waiting for repeating IR signal
// (prevent it to stop if no signal received)
delay(150);
}
//no IR signal received
else
{
//right wheel stop
digitalWrite(E1,LOW);
 
//left wheel stop
digitalWrite(E2,LOW);
}
}
 
//  extra function
//=======================================================================
 
//function to control the motor
void motor(int left, int right)
{
//limit the max speed
if(left>255)left=255;
else if(left<-255)left=-255;
if(right>255)right=255;
else if(right<-255)right=-255;
 
//left wheel forward
if(left>0)
{
//left wheel direction forward
digitalWrite(M2,HIGH);
//left wheel speed
analogWrite(E2,left);
}
//left wheel reverse
else if(left<0)
{
//left wheel direction reverse
digitalWrite(M2,LOW);
//left wheel speed
analogWrite(E2,-left);
}
//left wheel stop
else
{
//left wheel stop
digitalWrite(E2,LOW);
}
 
//right wheel forward
if(right>0)
{
//right wheel direction forward
digitalWrite(M1,LOW);
analogWrite(E1,right);
}
//right wheel reverse
else if(right<0)
{
//right wheel direction reverse
digitalWrite(M1,HIGH);
analogWrite(E1,-right);
}
//right wheel stop
else
{
//right wheel stop
digitalWrite(E1,LOW);
}
}

I think there must be problem with LOW mode of M1 or/and M2.

What do you suggest?
45  Using Arduino / Motors, Mechanics, and Power / Re: Do not know how to run forward the dc motors. on: October 31, 2012, 01:09:03 pm
But according to this http://www.e-shore.com.my/homepage/all-projects/193-ir-remote-control-mobile-robot.html
it should be able to set the M1 or M2 to low, but it doesn't work if I set one or both of them.

What is wrong here?
Is it maybe my motor shield error/broken?
Pages: 1 2 [3] 4 5 ... 18