Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Audio / Re: Piezo Speaker & push button on: August 15, 2012, 04:15:27 pm
Ok this is fairly simple. Build up the circuit like in this Button Tutorial: http://www.arduino.cc/en/Tutorial/Button

Then connect the positive wire of the piezo to digital pin 9 and the black wire one piezo the ground pin.

Then upload this code to the Arduino ( modified version of Button Tutorial):

Code:
/*
  Button
 
 Turns on and off a light emitting diode(LED) connected to digital 
 pin 13, when pressing a pushbutton attached to pin 7.
 
 
 The circuit:
 * LED attached from pin 13 to ground
 * pushbutton attached to pin 2 from +5V
 * 10K resistor attached to pin 2 from ground
 
 * Note: on most Arduinos there is already an LED on the board
 attached to pin 13.
 
 
 created 2005
 by DojoDave <http://www.0j0.org>
 modified 17 Jun 2009
 by Tom Igoe
 
  http://www.arduino.cc/en/Tutorial/Button
 */

// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 2;     // the number of the pushbutton pin
int Buzzer1 = 9;

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the piezo as output:
  pinMode(Buzzer1, OUTPUT); 
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);     
}

void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    // play th Music
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,450,225);
      delay(300);
      tone(Buzzer1,450,225);
      delay(500);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,450,200);
      delay(300);
      tone(Buzzer1,600,300);
      delay(300);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,700,300);
      delay(300);
      tone(Buzzer1,700,300);
      delay(500);
      tone(Buzzer1,600,300);
      delay(300);
      tone(Buzzer1,400,200);
      delay(1000);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,650,200);
      delay(500);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,650,200);
      delay(300);
      tone(Buzzer1,650,200);
      delay(500);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,400,200);
      delay(1000);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,600,300);
      delay(500);
      tone(Buzzer1,600,300);
      delay(500);
      tone(Buzzer1,800,300);
      delay(500);
      tone(Buzzer1,800,300);
      delay(500);
      tone(Buzzer1,400,200);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,400,200);
      delay(500);
      tone(Buzzer1,300,150);
      delay(500);
      tone(Buzzer1,300,150);
      delay(500);
      tone(Buzzer1,300,150);
      delay(500);
      tone(Buzzer1,300,150);
      delay(500);
      tone(Buzzer1,300,150);
      tone(Buzzer1,300,150);
      tone(Buzzer1,300,150);
      tone(Buzzer1,300,150); 

  }
}

It looks quite long but it is simple. If i´m wright the buzzer will play a frequency between the two values (Buzzer1,300,150)

If it does not work tell me and i´ll check the code again tommorow.
2  Using Arduino / Motors, Mechanics, and Power / Re: Using 9v power supply with 6v servos on: August 15, 2012, 03:54:26 pm
Is it a battery or wall power?

If it´s a power supply like
Quote
this one then you can just plug the servos into 5V pin on the Arduino

If it´s a battery I would recommend using an external power supply like 3 AA batteries. Then you only have to connect the positive and negative on the servo to the batteries and the 3rd wire goes to a digital pin on the Arduino.
3  Using Arduino / General Electronics / Re: HP laptop battery plugged in not charg..... on: August 08, 2012, 02:54:01 am
HP is trash. And if you send it to a repair shop it will cost allot of money. I had a similar problem with an HP and i send it to  a repair shop only to say that the Laptop was irreparable because the broken parts were not in production any more. So instead of investing money in repair invest in a new Laptop. There is no brand i can recommmend you have to see what is best for you and how high your budget is.
4  Using Arduino / General Electronics / Re: Does the color of the laser make any difference? on: July 30, 2012, 12:38:13 pm
Wow that is so cool would lie to see a video smiley-wink
5  Using Arduino / General Electronics / Re: Does the color of the laser make any difference? on: July 30, 2012, 02:16:02 am
Is there a certain point where red Lasers can not get stronger (mesuared in mW) but blue Lasers can put out more mW. Is there like a rank order ?
Bsp:
5. IR Laser
4. purple Laser
3. green Laser
2. blue Laser
1. UV Laser

I dont mean the brightness because you can see IR and they still put out mW.

anyway Thx for all your replies. smiley-lol
6  Using Arduino / Motors, Mechanics, and Power / Re: Arduino PWM to PC fan Problem :S on: July 27, 2012, 12:11:27 pm
Ok I dont know what is wrong then but i found a similar Tutorial in a book called 30 projects fo the evil Genius. Here is the Website: www.arduinoevilgenius.com

But anyway here is the code:
Code:
int motorPin = 11;

void setup()
{
 
  pinmode(motorPin, OUTPUT);
  analogWrite(motorPin, 0);
  Serial.begin(9600);
}


void loop()
{
  if (Serial.available())
  {
    char ch = Serial.read();
    if (ch>= '0' && ch<= '9')
    {
     
        int speed = ch - '0';
        analogWrite(motorPin, speed*28);
     }
   }
}

I quickly copied it from the book so if there are any mistakes in the code you can download it from the link at the top. When you send values from 0 to 9 to your Arduino you can control the speed of the motor.

BEFORE UPLOADING:
This project requieres additionaly to th arduino and the fan an BD139 power transistor and a 270Ohm 0.5W resistor.

Connecting it: (sorry I didn´t find a circuit diagramm smiley-sad)

Arduino:
Digital Pin 11 to 270 Ohm resistor

Transistor:
B:270 Ohm Resistor
C:Motor
E:GND

Motor:
12V
Collector of Transistor

With this tutorial you also don´t have to worry about the 2 other cables on the Motor you just need the positive an negative cabel. But remember THIS IS NOT MY TUTORIAL.

Hope I could help you.

 
7  Using Arduino / Motors, Mechanics, and Power / Re: Arduino PWM to PC fan Problem :S on: July 27, 2012, 10:28:15 am
Did you tried it? It won´t damage your Arduino?
8  Using Arduino / General Electronics / Does the color of the laser make any difference? on: July 27, 2012, 10:26:27 am
Hi arduino Forum

I wanted to know if the color of a laser pointer has anything to do with how strong it is ( mW, W, MW, dont know strong lasers can be ).
Many people say that red lasers are the weakest and blue or green ones the strongest. But I have already seen green ones with 5mW and red ones with 250mW. And what about purple an Infra red lasers? I think the element to color them is called Yttrium so does maybe have effect on the wavelenght?
9  Using Arduino / Motors, Mechanics, and Power / Re: Arduino PWM to PC fan Problem :S on: July 27, 2012, 10:13:45 am
@missisipihipi
 
Hi
so the cabel to control your motor is connected to a digital pin on your Arduino. Why do you use an analog command then?

Code:
analogWrite(pcFan, 0);

You have to use an digital command ( sorry if that is called different ).

Code:
digitalWrite(pcFan, 0);

So try it with this code :

Code:
int pcFan = 3; // PC fan is connected to the Digital pin 3
int led = 13; // I'm using the built-in LED on pin 13 to tell me when the fan should be moving at full speed or not.

void setup()
{
  pinMode (pcFan, OUTPUT);
  pinMode (led, OUTPUT);
}

void loop()
{
  digitalWrite(pcFan, 0); // Turn Fan and LED off for 5 seconds
  digitalWrite(led, LOW);
  delay(5000);

  digitalWrite(pcFan, 255); // Spin Fan at full speed and turn on LED on for 5 seconds
  digitalWrite(led, HIGH);
  delay(5000);
}
10  Using Arduino / Motors, Mechanics, and Power / Re: Why are Magnets not allowed in an airplane? on: July 26, 2012, 12:50:07 pm
So in a suitcase it would not cause any damage but its safer not to take them. Thx for your replies.
11  Using Arduino / Motors, Mechanics, and Power / Why are Magnets not allowed in an airplane? on: July 26, 2012, 05:49:32 am
Hi

I always when I go on an airplane I think why cant I take Magnets in my suitcase? The magnets would be far enough away from any electronics. Hope you can help me.
12  Using Arduino / Motors, Mechanics, and Power / Re: Can a battery explode on: July 14, 2012, 03:12:55 am
Thanks for all your help. I know use non-recharable batteries and modified the project so that nofire hazard is possible. Thx.
13  Using Arduino / Motors, Mechanics, and Power / Re: Can a battery explode on: July 13, 2012, 12:52:19 pm
So lets say a normal AA battery can not burn my house down if it is shorted or exposed to heat (max. 45°C).
14  Topics / Robotics / Re: Controlling Robot Using Xbox 360 controller on: July 13, 2012, 05:40:51 am
Has your controller got USB because then you could use the USB shield if it is compatible with the arduino mega. Look at this Tutorial:

http://www.circuitsathome.com/category/mcu/arduino/usb-shield

https://github.com/felis/USB_Host_Shield/blob/master/examples/arm_mouse.pde

The code should be similar. Hope I could help you.
15  Using Arduino / Motors, Mechanics, and Power / Can a battery explode on: July 13, 2012, 05:09:57 am
Hi everyone
I just thought about exploding batteries (who doesn´t smiley-lol). So my question : Can batteries (AA; AAA; LiPo; 9V, 6V Lantern, 4,5V; etc.) under some conditions like in the sun or if they are shorted or crushed... I was only interested in safety so I hope you can help me.
Pages: [1] 2 3 4