Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: Wireless TV Remote Light Control on: July 28, 2013, 12:13:27 am
How to I find the kind of remote I am using for my automatic light switch?
2  Using Arduino / Project Guidance / Wireless TV Remote Light Control on: July 27, 2013, 11:05:17 pm
Hi all,

I am making a TV remote-controlled light switch using an Arduino Uno. I believe it is done using an infrared sensor to receive the TV remote signal, but I am not sure. Can you please correct me if I am wrong?

Thanks,

I_Got_Pi
3  Using Arduino / Project Guidance / Re: Servo Motors Won't Budge in Project on: June 10, 2013, 11:03:07 pm
Thanks! I will try that!
4  Using Arduino / Project Guidance / Servo Motors Won't Budge in Project on: June 10, 2013, 09:36:53 pm
Hello,

I am working on a copying arm. This includes a control arm and a copy arm. The user manipulates the control arm through potentiometer joints, and the servos attached to the joints on the copying arm mimics that manipulation. I am working on the guts of the project, which means that I am connecting the potentiometers and servo motors to the arduino. I have two servo motors - a radioshack micro servo motor and a parallax standard servo connected to pins 6 and 9 with an external power source of four AA batteries. The potentiometers work fine, but the servo motors have the problem. When I plug in the arduino and upload the sketch, the motors start moving. A few seconds later, they freeze and start to vibrate. What is going on? How can I fix this?

If this is any help, here is my code.

#include <Servo.h>

Servo elbow; //create servo object elbow
Servo hand; //"""""""""""""""""""""hand
int elbow_j = 0; //sets potentionmeter 1 to 0
int hand_j = 1;  //''''''''''''''''''''2 to 1
int degreeOne;
int degreeTwo;

void setup()
{
  elbow.attach(9);
  hand.attach(6);
}

void loop()
{
  degreeOne = analogRead(elbow_j);
  degreeTwo = analogRead(hand_j);
  degreeOne = map(degreeOne, 0, 1023, 0 , 179);
  degreeTwo = map(degreeTwo, 0, 1023, 0 , 179);
  elbow.write(degreeOne);
  hand.write(degreeTwo);
  delay(15);
}

Thanks in advance.
5  Using Arduino / Sensors / Re: Trouble with Ping))) Sensor PLEASE HELP! on: March 17, 2013, 09:54:37 am
Thanks, I'll try that.
6  Using Arduino / Sensors / Trouble with Ping))) Sensor PLEASE HELP! on: March 16, 2013, 10:59:17 pm
Hello,

I am building a robot that uses a Ping))) sensor as the "eyes" of the robot. The problem occurs after I upload the code to the arduino. It seems that the arduino is executing fine, but my Ping))) sensor has some strange behavior. Whenever the arduino starts to execute the code, the Ping))) sensor flashes on then off. It only collects data for the first half-second.

Here is my setup:
Two Continuous Rotation Servo Motors Connected to 5V, ground, and pins 9 and 6.
Ping))) Sensor connected to 5V(Same as servos), pin 7, and Ground.
-There are no resistors, capacitors, transistors, or any other electronic parts. Just motors and the Ping))) sensor.

If this also helps, here is my code:
Start of Code:

#include <Servo.h>
int SensorPin = 7;//ping pin
Servo left_wheel; //right and left
Servo right_wheel;
unsigned long pulseDuration=0;
int distance;
int state=0;

void setup() {
  left_wheel.attach(9);
  right_wheel.attach(6); //pin that servo is plugged into
}

void loop() {
  if (state == 0) {
    state=state+1;
  } else {
    state=state-1;
  }
   //The State stuff is to give the servos and the Ping))) sensor "turns"
  if (state==0){
    pinMode(SensorPin, OUTPUT); //sends Ping
    digitalWrite(SensorPin, HIGH);
    delayMicroseconds(5); //wait...
    digitalWrite(SensorPin, LOW); //Sets up for receiving the ping
    
    pinMode(SensorPin, INPUT); //More setup for receiving ping
    pulseDuration=pulseIn(SensorPin, HIGH); //recieves ping
    pulseDuration=pulseDuration/2;
    distance = int(pulseDuration/29); //calculates distance in cm
  } else {
      if (distance < 13) {
        while (distance < 13); {
          left_wheel.write(0);
          right_wheel.write(180); //turns the robot
          pinMode(SensorPin, OUTPUT); //sends new Ping
          digitalWrite(SensorPin, HIGH);
          delayMicroseconds(5); //wait...
          digitalWrite(SensorPin, LOW); //Sets up for receiving the ping
      
          pinMode(SensorPin, INPUT); //More setup for receiving ping
          pulseDuration=pulseIn(SensorPin, HIGH); //recieves ping
          pulseDuration=pulseDuration/2;
          distance = int(pulseDuration/29); //calculates distance in cm
          delay(20);
        }
      } else {
        left_wheel.write(180); //FORWARD!
        right_wheel.write(180);
        delay(20);
      }
  }
}

End of Code:

Is there anything I could correct in my setup or code so that the Ping))) sensor works again?

Thanks,

I_Got_Pi
7  Using Arduino / Installation & Troubleshooting / Re: Strange Arduino Behavior with the 9 Volt Power Supply on: March 03, 2013, 10:34:16 am
Thanks a lot! Your help solved my problem!
8  Using Arduino / Installation & Troubleshooting / Re: Strange Arduino Behavior with the 9 Volt Power Supply on: March 02, 2013, 11:55:09 pm
Just to let you know, I am using an arduino uno. (If this is helpful)
9  Using Arduino / Installation & Troubleshooting / Re: Strange Arduino Behavior with the 9 Volt Power Supply on: March 02, 2013, 11:28:58 pm
I have a multimeter to check it... but how? I am also new to electronics and I can't understand your instructions from your previous post.
10  Using Arduino / Installation & Troubleshooting / Re: Strange Arduino Behavior with the 9 Volt Power Supply on: March 02, 2013, 11:23:52 pm
My project involves a speaker and a ping sensor. It is a simple theremin of some sort. The closer to the ping sensor, the lower the pitch. The problem is, when I plug in my 9V battery, instead of playing the tones according to my hand and the ping sensor, it gives one long, low tone.
11  Using Arduino / Installation & Troubleshooting / Strange Arduino Behavior with the 9 Volt Power Supply on: March 02, 2013, 11:06:46 pm
Hello,

I am new to the arduino platform and code, so the answer to this problem may be obvious to you, but not me. I have been powering my arduino project with a 9 volt battery for a while. It worked fine for the passed few days, until today. Whenever I plug in my power supply, I am getting strange behavior. After this, I plugged the arduino into my computer and it worked fine.

What is going on?

Thanks,

I_Got_Pi
12  Using Arduino / Project Guidance / Ping Sensor is Somewhat Working- Random distance reads on: February 21, 2013, 01:28:39 am
Hello,

This is not the same question I had earlier about the audio jack. I have finally set up my whole "air piano," and tested it with arduino coding. As a recap, the air piano uses a ping sensor and a 1/8'' audio jack female output. The ping sensor reads the distance between your hand and the sensor, and the arduino determines the sound to output in relation to that distance. My code seems to make sense, and my actual project does to. Here is the setup of my project, and my code.

Setup for Project:
Ping Sensor
-Signal connected to pin 7

1/8'' Audio Female Jack:
-Signal connected to pin 3
-Resistor: 220 ohms

Code:
Code:
int SensorPin=7;
int AudioPin=3;
int distance;
int note;
unsigned long pulseDuration=0;


void setup() {
  pinMode(AudioPin, OUTPUT);
}

void loop() {
  
  pinMode(SensorPin, OUTPUT); //Sends Ping
  digitalWrite(SensorPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(SensorPin, LOW);
  
  pinMode(SensorPin, INPUT); //Receives ping and calculates centimeter distance
  pulseDuration=pulseIn(SensorPin, HIGH);
  pulseDuration=pulseDuration/2;
  distance = int(pulseDuration/29);
  
  if (distance > 262){
    noTone(AudioPin);  //Makes sure that the sound stays within one C major octave
  }
  
  if (distance < 131){
    noTone(AudioPin);
  }
  
  else{
    distance = note;
    tone(AudioPin, note);
  }
  delay(20); //Take a break
}

My problem is that the speaker ends up outputting random pitches. What am I doing wrong?

Thanks,

I_Got_Pi
    

Moderator edit: [code] [/code] tags added.
13  Using Arduino / Project Guidance / Re: Output Sound with 1/8'' Audio Stereo Jack PLEASE HELP NEED GUIDANCE on: February 21, 2013, 12:38:03 am
Thanks guys! With all the information you gave me, I was able to complete my "air piano!" You helped a lot.
14  Using Arduino / Project Guidance / Re: Output Sound with 1/8'' Audio Stereo Jack PLEASE HELP NEED GUIDANCE on: February 21, 2013, 12:14:18 am
I know that, but I was also wondering about how to wire the 1/8'' jack. It is a female jack, with three pins from radio shack. Any ideas on how to wire it?
15  Using Arduino / Project Guidance / Output Sound with 1/8'' Audio Stereo Jack PLEASE HELP NEED GUIDANCE on: February 20, 2013, 11:37:06 pm
Hello,

I am quite new to the arduino platform. I am trying to create an "air piano" with a ping sensor. The ping sensor reads the distance between your hand and the sensor, and converts it into sound. I am trying to output the sound to plug into headphones. To output the sound, I am trying to use a 1/8'' headphone stereo jack. Is there any way with the coding to output sound based on the data given from the ping sensor?

Thanks,

I_Got_Pi
Pages: [1]