Show Posts
Pages: 1 ... 383 384 [385] 386 387 ... 541
5761  Using Arduino / General Electronics / Re: Rotary Encoder Tutorial port to Arduino Uno on: January 26, 2012, 09:55:59 am
For an optical encoder you would have four pins:  +5, Ground, A and B.

Is this a mechanical encoder with only three terminals?  In that case you could connect the common to Ground and use pull-up resistors (either the built-in ones or external fro the input pin to +5).  Alternatively you can connect the common to +5 and use pull-dowm resistors from the input pins to Ground.  Without pull-up or pull-down resistors the switches are switching between +5 and floating or Ground and floating.  When left floating the input could read HIGH or LOW randomly.
5762  Using Arduino / General Electronics / Re: Which resistor to use? on: January 25, 2012, 08:35:42 pm
Just as an exercise...

15 Amps at 120 Volts would be 8 Ohms.
10 Amps at 120 Volts would be 12 Ohms so you need an additional 4 ohms.

The 4-ohm resistor would be dropping 1/3 the total voltage (120 * 1/3 = 40).

10 Amps at 40 Volts means that you need a 400 Watt resistor.

The heater will get the other 80 Volts so your 1750 Watt heater now is an 800 Watt heater.

If you put two of the 1750W heaters in series the current should drop to 7.5A making a total of 900W for both.  Not much better.

Try a heftier relay.
5763  Using Arduino / Programming Questions / Re: Problem with String functions? on: January 25, 2012, 08:03:57 pm
Fails for me, too.  

The function trim() does not return a String.  In fact it does the trim 'in place' and returns void.

Change:
Code:
  stringOne = stringOne.trim();

To:
Code:
  stringOne.trim();

It gets worse.  I tried to look up the reference for String.trim():

file:///Applications/Arduino%201.0.app/Contents/Resources/Java/reference/StringTrim.html
No file exists at this address
5764  Using Arduino / Project Guidance / Re: Arduino ethernet networking: feasibility / question on: January 25, 2012, 07:57:37 pm
Is the tablet using WiFi to connect to the router?  If not, how do you connect both through the same Ethernet port on the tablet?

If you have Ethernet to the Arduino and WiFi to the Router:

Assign a fixed IP address, such as 192.168.17.17, to the Arduino sketch.  Last octet must not be '1'.
Assign a fixed IP address, such as 192.168.27.1, to the Ethernet port. First three octets must match the Arduino address.  Last octet must be 1.

From the tablet, try to browse to your Arduino: http://192.168.27.17/

This might be sufficient to get it working.  Otherwise yoy may need to set the subnet mask to "255.255.255.0"
5765  Using Arduino / Programming Questions / Re: Trouble with test program for traxxas rc car with an ESC on: January 25, 2012, 07:48:12 pm
Perhaps a throttle level of 60 is not low enough to get the car moving backward.  Try 30 or even 0 to see if that works better.
5766  Using Arduino / Displays / Re: how to chose LCD on: January 25, 2012, 03:58:59 pm
The Arduino is probably not a good choice if you want to display on a large LCD screen like one would find in a laptop.  Typically we use a display with a built-in controller that has a buffer for the characters or pixels.  Such displays are typically 4x20 (four lines of twenty characters) or 128x64 pixels.
5767  Using Arduino / Project Guidance / Re: Standalone ATMega328 and 3.3v Requirement on: January 25, 2012, 03:50:20 pm
The extra regulator will need its own capacitors.

Using a simple /2 voltage divider (two equal resistors of about 10K) works well for 5V outputs to 3.3V inputs.  Nothing special is needed for 3.3V outputs going to 5V inputs.
5768  Using Arduino / Sensors / Re: IR Tripwire on: January 25, 2012, 03:46:28 pm
These devices are designed for short bursts of pulses used for remote control.  The specification says:

"Some examples of disturbance signals which are suppressed are:
• Continuous signals at any frequency"

After it sees a long burst (>70 cycles at 38KHz, about 2 milliseconds) it ignores that signal until that signal has been gone for four times the burst length.

You need an IR receiver designed for continuous signals.
5769  Using Arduino / Sensors / Re: help with led IR high intensity on: January 25, 2012, 12:15:03 pm
I ask again:
Is the IR light pointed at the receiver or does the receiver have to detect the IR no matter which way it is facing?

If you are trying to send data it might be safer to send a modulated pulse train like a TV remote control uses.  If you are just using time between pulses you will get a wildly different value if you miss a pulse.
5770  Using Arduino / Sensors / Re: help with led IR high intensity on: January 25, 2012, 11:49:19 am
Are you trying to send data or just detect the presence of the IR light?

Is the IR light pointed at the receiver or does the receiver have to detect the IR no matter which way it is facing?
5771  Using Arduino / Programming Questions / Re: DC motor Steering control through POT on: January 25, 2012, 11:43:06 am
Code:
void motorLeft() {
  digitalWrite(leftMotor, HIGH);
}
void motorRight() {
  digitalWrite(leftMotor, HIGH);
}

rightMotor, perhaps?

Yes, that second one should be rightMotor.

(corrected in original post)
5772  Using Arduino / Programming Questions / Re: DC motor Steering control through POT on: January 25, 2012, 11:18:25 am
Try this:
Code:
const int potPin = A0;

const int leftMotor = 10; //PWM pin to the L293
const int rightMotor = 9; //PWM pin to the L293

bool isLeft()          {
  return analogRead(potPin) < 52;
}
bool isLeftOfCenter()  {
  return analogRead(potPin) < 472;
}
bool isRightOfCenter() {
  return analogRead(potPin) > 532;
}
bool isRight()         {
  return analogRead(potPin) > 976;
}

void motorStop() {
  digitalWrite(leftMotor, LOW);
  digitalWrite(rightMotor, LOW);
}
void motorLeft() {
  digitalWrite(leftMotor, HIGH);
}
void motorRight() {
  digitalWrite(rightMotor, HIGH);
}


void setup() {
  Serial.begin(115200);
  Serial.println ("Entering setup.");
}

void loop()
{
  if (Serial.available() == 0)
    return;

  switch (toupper(Serial.read()))
  {
  case 'L':
    Serial.println("New command: L");
    if (isLeft())
      Serial.println("Already Left");
    else
    {
      Serial.println("Heading Left");
      motorLeft();
      while (!isLeft()) /* JUST WAITING */;
      motorStop();
      Serial.println("Is now Left");
    }
    break;

  case 'C':
    Serial.println("New command: C");
    if (isRightOfCenter())
    {
      Serial.println("Heading Left toward Center");
      motorLeft();
      while (isRightOfCenter()) /* JUST WAITING */;
      motorStop();
      Serial.println("Is now Centered");
    }
    else
      if (isLeftOfCenter())
      {
        Serial.println("Heading Right toward Center");
        motorRight();
        while (isLeftOfCenter()) /* JUST WAITING */;
        motorStop();
        Serial.println("Is now Centered");
      }
      else
        Serial.println("Already Centered");


    break;

  case 'R':
    Serial.println("New command: R");
    if (isRight())
      Serial.println("Already Right");
    else
    {
      Serial.println("Heading Right");
      motorRight();
      while (!isRight()) /* JUST WAITING */;
      motorStop();
      Serial.println("Is now Right");
    }

    break;

  }  // end of switch on direction

}  // end of loop
5773  Using Arduino / Displays / Re: What version of Arduino do I need to get the tiger.bmp onto an adafruit shield on: January 25, 2012, 10:45:26 am
Perhaps the SD library you are using doesn't have support for the newer SD-HC format used for 4GB and larger SD cards.  Or maybe the card hads not been pre-formatted for FAT16 or FAT32.
5774  Using Arduino / General Electronics / Re: How on/off device with relay with pulses from Arduino? on: January 25, 2012, 10:30:14 am
Get a dual-coil latching relay with 5V coils that draw less than 40 mA:

http://search.digikey.com/us/en/products/TX2-LT-5V-TH/TX2-LT-5V-TH-ND/2709470

Connect the two coils to two Arduino pins.  One will turn the relay ON permanently.  The other will turn the relay OFF permanently.  No power is needed to keep the relay in position.  The contacts can handle 2A at 250 VAC or 220 VDC.

For higher current (10 A) you could try this one:

http://search.digikey.com/us/en/products/DK1A-L2-5V-F/255-2054-ND/1242202
5775  Using Arduino / Sensors / Re: Logic high? on: January 25, 2012, 08:39:45 am
Logic High means on the output pin:

I think you got the timers mixed up.  The 250 mS was after power-up.  The pulse was 20 uS.

Code:
delay(250);  // or more to make sure power is up on the sensors.
pinMode (pinX, OUTPUT);
digitalWrite (pinX, HIGH);
delayMicroseconds(20);  // Keep the line high for 20 microseconds
pinMode (pinX, INPUT);  // now high impedance
digitalWrite(pinX, LOW);  // Make sure the internal pull-up is off
[/quote]
Pages: 1 ... 383 384 [385] 386 387 ... 541