Show Posts
Pages: 1 ... 82 83 [84] 85 86 ... 155
1246  Using Arduino / Motors, Mechanics, and Power / Re: Power/ Motors on: November 29, 2012, 11:20:29 am
You probably won't "smoke" the Arduino, but due to the power hungry nature of the motors/servos you're most likely to cause power fluctuations that will cause the Arduino to reset or make your analog readings go nutty.

This mosfet tutorial shows how to connect external power for your motor/transistor. Assuming the external power is 5V then the servo can also take power from it; connect the red and black wires to the power source and the signal line (white or orange) stays connected to the Arduino.

There should always be a ground connection between the Arduino and any external power supply.
1247  Community / Bar Sport / Re: 8) - Batteries V Capacitors? Which will win? on: November 28, 2012, 11:13:20 pm
  I'm betting on batteries, unless they ever do release the hidden patent the energy companies are secretly sitting on for the FLUX capacitor, then it will be back to the future for sure.  smiley-wink

That was released a long time ago.
1248  Using Arduino / Project Guidance / Re: Live tracking weight changes on: November 28, 2012, 10:47:59 pm
Get a digital bathroom scale and disassemble/reassemble it enough until it fits your water cooler nicely. Then either hack into the onboard electronics (sometimes the amplified reading from the load cell is available) or replace those electronics with an instrumentation amp. If you need more then the 10bit accuracy provided by the Arduino's ADC then you'll also need a different ADC to go with it.
1249  Using Arduino / Motors, Mechanics, and Power / Re: Need to build 2 amp multi output (5s volts,12s volts) power supply on: November 27, 2012, 09:11:03 pm
You seem to be on a budget; any chance you could find an old computer power supply?
1250  Using Arduino / Motors, Mechanics, and Power / Re: Bi-directional tube motor with 4 Relay Module on: November 27, 2012, 09:02:33 pm
Yes, your relay wiring is as I described. I'm still not clear on those four motor wires though so I'm leaving that to your discretion; I'm assuming that it's some type of AC motor and I'm not knowledgeable enough in AC motors to offer advice that could blow up someone else's stuff smiley-wink

Your relay module should be fine for this task. The critical thing to look out for is the amperage of the relays (which, as an aside, don't care if it's AC or DC current so long as you stay under the limits printed on the relay). Your board shows 10A relays and that should be more than plenty for a motor lifting this light of a load. Also be aware that your relay board is capable of optical isolation -- without a jumper between the JD-VCC pin and VCC pin it's expected that you have a second 5V power supply providing power to JD-VCC and GND and the Arduino's GND pin is not connected. Again, the link to the wiki I posted above explains this.
1251  Using Arduino / Sensors / Re: Can anybody identify this sensor? on: November 27, 2012, 06:56:33 pm
http://www.rainsensors.com/how_it_works.php
http://arduino.cc/playground/Learning/LEDSensor

Basically, rain on the windshield will cause some form of reflection of the IR light back to the sensor.

You would still need to do a lot of work in characterizing the intermittent nature of the reflections of raindrops vs. driving under a tree, bug on the windshield, etc.
1252  Using Arduino / Project Guidance / Re: How to execute a function for "t" time without delay + using external interrupt on: November 27, 2012, 09:27:27 am
Just FYI:

Code:
#include <Time.h>
#include <TimeAlarms.h>

void setup() {
  Serial.begin(9600);
  Serial.println("Waiting for command");
}
 
AlarmID_t temptimer;
 
void loop() {
       
  // this is where the "polling" occurs
  if(Serial.available()){
    char ch=Serial.read();
    switch(ch)
    {
      case '1':
      // start recording?
      temptimer = Alarm.timerRepeat(1, Tempfunct);
      break;
     
      case '2':
      // stop recording?
      Alarm.disable(temptimer);
      break;
           
      default:
      Serial.print(ch);
      Serial.println(" : unknown command!");
    }   
  }
}

// function to be called
void Tempfunct() {
   // do whatever reading
   Serial.println(analogRead(A0));
}

This is perhaps kinda heavy for what you appear to be doing (should use the "blink without delay" method), but just wanted to followup.

Also, TimeAlarms.cpp needs to be updated for Arduino 1.0.

Replace:
Code:
#include <WProgram.h>

With:
Code:
#if ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
1253  Using Arduino / Motors, Mechanics, and Power / Re: Bi-directional tube motor with 4 Relay Module on: November 27, 2012, 08:50:02 am
I have no idea what a "tube motor" is so I'm assuming that you understand the pinout there and have the power connections right.

Looking at how you have your relays wired, you have the potential to create a short circuit if both relays are energized. That's not a good idea unless you're the type of person that never writes software bugs and never has a hardware failure.

The + from your main power should go to the common of the first relay, the NO output of that first relay to the common of the second relay, and then the NC and NO of that second relay should go to 3 and 4 of the motor. This way the first relay controls power on/off and the second relay controls direction.

Terry's wiki on relay boards does a great job explaining how to hook these things up.
1254  Using Arduino / Project Guidance / Re: Controlling the computers mouse on: November 27, 2012, 08:36:17 am
To do this you would want to write a program (on the PC) to listen for commands on the serial port from the Arduino and control the mouse. You would need to look into available libraries for this for whatever OS and whatever programming language you're using. The InterfacingWithSoftware page provides a large number of examples for various programming languages.

On the other hand, if you're just trying to build a sort of Arduino mouse then my answer stinks and you should follow HazardsMind's link. I'm assuming you still want to be able to communicate that analog reading to the PC.
1255  Using Arduino / Project Guidance / Re: How to execute a function for "t" time without delay + using external interrupt on: November 27, 2012, 08:25:09 am
Look in the example for the "TimeAlarms" addition in the [http://www.arduino.cc/playground/uploads/Code/Time.zip]Time[/url] library.

You topic subject mentions "+ using external interrupt"; I assume you meant for the timing only or is there something else you were trying to accomplish?
1256  Using Arduino / Project Guidance / Re: Plug it in a Wall and Use Bluetooth to Move Mountains on: November 27, 2012, 08:11:23 am
Just explain exactly what it is you're trying to accomplish. Don't make it into some kind of mystery -- you're not going to get a good answer.
1257  Using Arduino / LEDs and Multiplexing / Re: Weak IR LEDs on: November 27, 2012, 08:07:22 am
I'd suggest testing with a bright red or white LED so you can see obvious problems, and either of those should get you a meter distance minimum. Once you get that working then you can switch to the infrared LED.

These receivers don't require "940nm" LEDs but rather that is just the optimal wavelength. But, y'know, premature optimization is the root of all evil.
1258  Using Arduino / Project Guidance / Re: Attiny85 Communication with Arduino UNO on: November 27, 2012, 07:44:20 am
Code:
// ATMEL ATTINY45 / ARDUINO
//
//                  +-\/-+
// Ain0 (D 5) PB5  1|    |8  Vcc
// Ain3 (D 3) PB3  2|    |7  PB2 (D 2)  Ain1
// Ain2 (D 4) PB4  3|    |6  PB1 (D 1) pwm1
//            GND  4|    |5  PB0 (D 0) pwm0
//                  +----+

Pins 6 and 7 are digital 1 and digital 2. Adjust txPin and rxPin appropriately.

You can find the above info in hardware/attiny/variants/tiny8/pins_arduino.h
1259  Using Arduino / LEDs and Multiplexing / Re: More shift register problems? on: November 25, 2012, 12:48:18 am
Try throwing in a short delayMicroseconds() after each digitalWrite. Or it might be just needed before you throw the latch high.
1260  Using Arduino / Motors, Mechanics, and Power / Re: Interfacing Arduino with Pololu JRK21v3 help please! on: November 24, 2012, 10:50:58 am
Just need to smooth out your analogRead() somehow.

Code:
void loop() // run over and over
{
  static int lastRawA2D;

  char Command[10]={0xAA,11,0x45,0xAF};
  int RawA2D;
  RawA2D=analogRead(AN0pin);
  while(1){ 
    if (analogRead(AN0pin) > lastRawA2D) {
      RawA2D += 1;
    } else if (analogRead(AN0pin) < lastRawA2D) {
      RawA2D -= 1;
    }
    lastRawA2D = RawA2D;

    Command[2]=0xC0 + ((char)RawA2D & 0x1F);
[...]
Pages: 1 ... 82 83 [84] 85 86 ... 155