Show Posts
Pages: 1 ... 6 7 [8] 9 10
106  Using Arduino / Project Guidance / get the arduino to push the button on: May 24, 2011, 04:34:12 pm
Hello,
I hope this is a simple question...
I am a visual artist and I embed digital photo frames to play videos in my sculptures. The problem is, is that no digital photo frames that I can find play video right away on start up...you always have to press a series of buttons to get the video going.
What I did in the past is just soldered onto the buttons and extended them so that you didn't have to reach into the sculpture to press the button and get the video going. But I'd like to use an Arduino to send a signal to the button to press it. So say I need to press one button, wait a few seconds and press it again, is this is simple as making a digitalOut and setting it to HIGH, delaying, set it to LOW, then setting it to HIGH and LOW again? Would it be even easier(cheaper) to just program a smaller AVR chip to do this, if I really wanted a bare bones setup? There's probably some stuff with voltage that I don't understand so anything you can help me with is much appreciated!
Thanks so much for any feedback!

107  Using Arduino / Programming Questions / turn vin pin on and off on: March 09, 2011, 04:52:00 pm
hello,
if i have two 9v wall adapters, one plugged into normal arduino input and another into vin and ground...is there anyway i can turn the vin on and off? I have a sensor and when it's activated, I want speakers to turn on and make a bunch of noise. the problem is, is when the speakers are always on they make a loud hiss...(they are really amped up in a 386 circuit) so i just want them on when they need to make noise.
thanks
108  Using Arduino / General Electronics / 386, speaker, 9v adapter, arduino on: March 07, 2011, 10:13:16 am
Hi,
I made a post awhile ago about using a 386 audio amplifier chip and an arduino. I got a lot of help and I have it all set up now but I'm having some weird problems.

I'm using this schematic: http://www.hobby-hour.com/electronics/lm386-20.gif
(However, I don't have the exact capacitors...instead of a .05uf, I have a .1uf...instead of a 250uf, I have a 220uf of a 330uf.)

Just in case, here is how I have it set up: Pin 1: nothing, Pin 2: Ground, Pin 3: Using a 10k pot - middle goes to pin 3, one side goes into pin 7 in Arduino, other side goes to ground.
Pin 4: ground, Pin 5: 104 cap in two spaces after pin, followed by a 10ohm resistor with the other end in ground, followed by a 220 or 330uf cap which has it's negative side attached to the + end of speaker. Other end of speaker is grounded. Pin 6 goes to the power rail in breadboard. Pin 7&8: Nothing.

I'm trying to power everything from one source...so I'm powering the Arduino through the Vin pin.
I have everything set up in what seems to be the right pins but when I put the power in the rails of the breadboard with a 9v adapter (This one, clipped and breadboard ready: http://www.adafruit.com/index.php?main_page=product_info&cPath=18&products_id=63), the sound is very muffled in the speaker and the chip starts to overheat very quickly and one of my 10ohm resistors turned brown even...
If I power everything with a 9v battery, the sound works fine but the chip starts to overheat after a few resets of the arduino. (I'm just running the SimpleMelody example in the digital examples section in the Arduino IDE).

Any ideas? Is it because my caps are the wrong size? Does anyone have experience using a 386 with Arduino?
Thanks for any help!
109  Using Arduino / Programming Questions / Re: Newbie: Finding Libraries on: February 27, 2011, 06:26:47 pm
hi there...i'm no expert...but that Stopwatch program isn't a library and doesn't appear to use any special libraries. You just copy the code, put it in the IDE and run it. When you save it just save it where you save all your arduino sketches. You are using this? http://www.arduino.cc/playground/Code/Stopwatch

here is where most good contributed libraries are: http://arduino.cc/en/Reference/Libraries

a lot of times sketches you find online are outdated or don't work...but anything on the arduino webpage will usually work just fine...
hope this helps...sorry if you know all this already...
110  Using Arduino / General Electronics / Re: best way to drive some speakers on: February 26, 2011, 05:57:42 pm
thanks so much for your help. ok i think i understand more or less now....i'm going to set up that circuit and see if i can't get it to work :-)
thanks!
111  Using Arduino / General Electronics / Re: best way to drive some speakers on: February 26, 2011, 05:43:09 pm
i'm sorry...i'm really terrible with this stuff...still just learning it.
but ohm's law is that the current is the voltage divided by resistance? so in this case i=.226? what do i do with that?
do i need to drive these speakers with an LM386 or can they work just with an arduino? how do i figure that out?
thanks so much for your help
112  Using Arduino / General Electronics / Re: best way to drive some speakers on: February 26, 2011, 05:30:28 pm
i guess...is that normal?
on the back it says 6(omegasign) 13W
below that: 5L24V
24 volt then?
113  Using Arduino / General Electronics / Re: best way to drive some speakers on: February 26, 2011, 05:19:08 pm
yeah...i thought it was weird, too. it says on the back of the speaker 6(with the little omega sign)13W
I've been using it with just a 100ohm resistor and it works fine...
but will it destroy the arduino eventually?
thanks for any help
114  Using Arduino / General Electronics / best way to drive some speakers on: February 26, 2011, 05:08:45 pm
Hello,
I'm working on a project that has two speakers (6V, 13W) in the Arduino and they make a bunch of noises just using the tone() function.
Everything would be powered from a converter plug in the wall...
I was recently told that if I do this, eventually the pins are going to get worn out on the Arduino and that I should drive the
speakers through an LM386 IC. Would they also need a separate power source?
I'm having a hard time finding any tutorials on how to do this...is it necessary? If I use some 100ohm (or around there) resistors, will the pins be
fine?
If I do need the LM386...does anyone know some decent tutorials on how to wire this up?
Thanks!
115  Using Arduino / Programming Questions / Re: servo moving with hand motion on: February 14, 2011, 09:59:52 am
Thank you so much for your help! You've really helped me with my programming...
Here is the new code. It works pretty good. Just the sensor is a little jittery with its readings...but I bought the cheapest one I could find :-)

Code:
#include <Servo.h>
Servo myservo; 
int inchesOLD, clockwise;

const int pwPin = 7;

long pulse, inches, cm;
void setup() {

  myservo.attach(9);
  Serial.begin(9600);

}

void loop() {

  pinMode(pwPin, INPUT);
  pulse = pulseIn(pwPin, HIGH);
  inches = pulse/147;

  clockwise=0;

  if(inches < inchesOLD)
    clockwise=1;

  if (inches == inchesOLD)
    clockwise=2;

  Serial.print(inches);
  Serial.print("in");
  Serial.println();
  delay(50);

  int off = 0;

  if (inches>30)
    off=0;
  else if (inches >27)
    off = 10;
  else if (inches >24)
    off = 20;
  else if (inches > 21)
    off = 30;
  else if (inches > 18)
    off = 40;
  else if (inches > 15)
    off = 50;
  else if (inches > 10)
    off = 60;
  else if (inches > 5)
    off = 70;

  int pos = 90 + off;

  if(clockwise)
    pos = 90 - off;
 
  if (clockwise==2) //if nothing changes, keep servo still
    pos = 90;
     
  myservo.write(pos);

  inchesOLD=inches;

}





116  Using Arduino / Programming Questions / Re: servo moving with hand motion on: February 12, 2011, 09:22:07 pm
i'm powering it from the arduino...how do you power a servo without an arduino anyway? well...i know how to do it from a battery...but do you know how to do it from an adapter?
i still am pretty sure my code is a little out of whack. i'm trying to say when the variable before is greater than then new one, do this, when it's smaller, do that. I feel like i've read about this algorithm before...but I can't find it anywhere.
thanks for any help!
117  Using Arduino / Programming Questions / servo moving with hand motion on: February 12, 2011, 05:07:48 pm
Hi,
I have a MaxSonar EZ1 Ultrasonic Range Finder hooked up to my arduino with a 360 degree servo. I'm trying to make it so that how I move my hand the servo will move. So if i'm moving my hand toward the range finder, the servo will move clockwise, when I pull away it will move counterclockwise...or visa versa I don't care. Right now it sort of does that but I feel like it could work a lot more solid.
I feel like there's a better algorithm than what I have now. Sometimes it doesn't move counterclockwise when it should and sometimes the servo is very choppy. It works best when my hand is moving back in forth in the middle...but up close and far away it's much more choppy and erratic. I'm getting very good reads in my serial monitor, though, so I know it's not the sensor...just my terrible programming. :-) thanks for any help!

Code:
#include <Servo.h>
Servo myservo;  
int inchesOLD, clockwise;

const int pwPin = 7;

long pulse, inches, cm;
void setup() {

  myservo.attach(9);
  Serial.begin(9600);

}

void loop() {

  pinMode(pwPin, INPUT);
  pulse = pulseIn(pwPin, HIGH);
  inches = pulse/147;
 
  if (inches>=inchesOLD){ //if inches are increasing i.e. you're pulling away, it should spin clockwise
    clockwise=0;
  }
  else if (inches<inchesOLD){
    clockwise=1;       //or else it should go counter clockwise when you're
  }
  Serial.print(inches);
  Serial.print("in");
  Serial.println();
  delay(50);

  if (inches>30) {  
    myservo.write(90);    
  }
  if ((inches<=29)&&(inches>=28)) {
    if (clockwise==1){
      myservo.write(80);
    }
    else {
      myservo.write(110);
    }
  }

  if ((inches<=27)&&(inches>=24)) {
    if (clockwise==1){
      myservo.write(70);
    }
    else {
      myservo.write(130);
    }
  }

  if ((inches<=23)&&(inches>=20)) {
    if (clockwise==1) {
      myservo.write(50);
    }
    else{
      myservo.write(150);
    }
  }

  if ((inches<=19)&&(inches>=16)) {
    if (clockwise==1){
      myservo.write(5);
    }
    else{
      myservo.write(160);
    }
  }

  if ((inches<=15)&&(inches>=11)) {
    if(clockwise==1){
      myservo.write(50);
    }
    else {
      myservo.write(175);
    }
  }

  if ((inches<=10)&&(inches>=9)){
    if(clockwise==1){
      myservo.write(80);
    }
    else {
      myservo.write(170);
    }
  }
  if ((inches<=8)&&(inches>=7)){
    if(clockwise==1){
      myservo.write(85);
    }
    else{
      myservo.write(95);
    }
  }
  if (inches==5){
    myservo.write(90);

  }
  inchesOLD=inches;

}





118  Using Arduino / Motors, Mechanics, and Power / quick servo questions on: February 12, 2011, 01:55:26 pm
Hello,
I have a 360 degree full rotation servo from SparkFun. I have a range finer sensor in front of it and I'm just trying to get it to turn to one angle when someone steps in front of it and then back to its beginning angle when the person leaves. So I'm noticing that with these 360 degree servos...when you do myservo.write(x);, the number you write doesn't give an angle but rather a speed and direction. When I type in 90, the servo is still, if the number is below 90 it goes in one direction, the further from 90 the faster...when the number is between 90 and 180 it goes in the opposite direction...the further from 90 the faster.

So my question is...can I just get it to go in specific angles? So if I want the servo at a 90 degree angle, switch to a 45 and then back to 90...can I do that? It seems difficult to get it back to a specific angle...do I just have the wrong servo? Any way to do this with a 360? Thanks for any help!

This is the code I have now...
Code:
#include <Servo.h>
Servo myservo;  
int potpin = 0;  
int val;    
boolean moving=false;
boolean needtomoveback=false;

void setup()
{
  myservo.attach(9);
  Serial.begin(9600);
}

void loop()
{
  val = analogRead(potpin);  
  Serial.println("RADAR:");  
  Serial.println(val);
  Serial.println("SERVO ANGLE:");
  int servoangle = myservo.read();
  Serial.println(servoangle);
  myservo.write(90);                
  delay(15);      

  if ((val>50)&&(moving==true)&&(needtomoveback==false)) {
    myservo.write(90);
    moving = false;
  }
  if ((val<50)&&(moving==false)) {
    myservo.write(40); //was 40
    delay(500);
    myservo.write(90);
    moving = true;
    needtomoveback=true;
  }
  if ((val>50)&&(needtomoveback==true)) {
    myservo.write(120);
    delay(500);
    needtomoveback=false;
  }
}

119  Using Arduino / Project Guidance / Re: camera to sd to twitter on: January 31, 2011, 08:41:50 pm
wow...thanks everyone for all the feedback! gave me a lot to research...i'm sure i'll have many more questions that i'll post later in the forums once i get started.
120  Using Arduino / Project Guidance / camera to sd to twitter on: January 31, 2011, 10:46:55 am
Hello,
I want to make this kind of sculptural thing where the viewer would sit in a chair with an FSR on it, so the Arduino would know someone is there. When they sit down and look at the sculpture a servo would start spinning on the sculpture, spinning a mechanism to turn a wheel and then when the wheel is in the right place (probably the arduino would know with a light sensor or something), take a picture of the person sitting in the chair and save that picture to an SD card on the Ethernet shield and upload it to Twitter. So it'd be like the artwork would have a twitter account of all the people looking at it...and it would have a database accessible on an SD card inside the sculpture.
I've done most of this stuff before, just not together, and I've never used a camera with an arduino. Here are some questions:

What's the difference between a TTL interface camera (http://www.sparkfun.com/products/10061) and a CMOS one? (http://www.sparkfun.com/products/8739) Is one easier than the other to put the picture on an SD card? I couldn't really find anywhere to get started with cameras and arduinos...how do I wire them, hook them up and everything? Most of the stuff I've found is for more specific projects and I didn't really understand it.

Could all of this be powered from a duemilanove or Mega? I really don't want to use a PC...I want everything to be contained within the sculpture and to turn on with the flip of a switch.

Any other advice on how to get started?

Thanks for any help!
Pages: 1 ... 6 7 [8] 9 10