Is it possible to produce sound and power an LED without using a breadboard?

I am a beginner and I was wondering whether it is possible for me to produce sound and at the same time light up the LED without using a breadboard. I do not have the required budget and I need my project to be as small in size as possible. So, is there any way?

Because it looks as though the Arduino board has only one ground pin which can be used for output.

'the' LED is on the board - you mean, an LED ?

What kind of sound?

ground pin for output ? ? ?

A breadboard is just a collection of wires, set up for ease of connectivity - you don't ever strictly need one.

See, in most tutorials I have seen in which it was required to use LED and sound at the same time, the person used a breadboard. I say that ground pin was used for sound because I tried with other pins (1-13) and none of them flashed the LED if the cathod of the LED was not connected in the gnd. So it seemed to me that the gnd was something which was necessary to supply voltage to something.

Ground pin for output? My UNO has 3 ground pins and none of them are output.

What Arduino board are you using?

If you can solder, you can put circuits together without a breadboard. Maybe use a piece of cardboard or plastic, even a box to hold the bigger parts in place if you have any.

Soldering is slower than breadboarding so you might want to learn enough that you don't solder wrong circuits.

I think that you need to learn more electronics if you think that ground pins are for output.
One source of parts is thrown-out electronics including toys. But if you don't know about capacitors then even that could be dangerous.

akshattripathi:
See, in most tutorials I have seen in which it was required to use LED and sound at the same time, the person used a breadboard. I say that ground pin was used for sound because I tried with other pins (1-13) and none of them flashed the LED if the cathod of the LED was not connected in the gnd. So it seemed to me that the gnd was something which was necessary to supply voltage to something.

I don't know what board you have but pin 13 has a led and resistor built into Arduino boards.

Load the Blink sketch and when it runs you should see led 13 blink.

I'm using Arduino UNO. Also, I know what ground pins do. But since I was not able to light up the LED, I thought that it had some connection to current supply. Anyway, is there anyway that I can use multiple LEDs and not use anything other than the Arduino board, the cable and the LEDs?

Yea, I do have the LED blinking in the 13th pin. I want to do the same with the other pins (1-12).

So, just change pin number from 13 to whatever you want!

Look at Nick Gammon's example :

// Which pins are connected to which LED
const byte greenLED = 12;                   // pin number 12
const byte redLED = 13;                      // pin number 13

// Time periods of blinks in milliseconds (1000 to a second).
const unsigned long greenLEDinterval = 500;
const unsigned long redLEDinterval = 1000;

// Variable holding the timer value so far. One for each "Timer"
unsigned long greenLEDtimer;
unsigned long redLEDtimer;

void setup () 
  {
  pinMode (greenLED, OUTPUT);
  pinMode (redLED, OUTPUT);
  greenLEDtimer = millis ();
  redLEDtimer = millis ();
  }  // end of setup

void toggleGreenLED ()
  {
   if (digitalRead (greenLED) == LOW)
      digitalWrite (greenLED, HIGH);
   else
      digitalWrite (greenLED, LOW);

  // remember when we toggled it
  greenLEDtimer = millis ();  
  }  // end of toggleGreenLED

void toggleRedLED ()
  {
   if (digitalRead (redLED) == LOW)
      digitalWrite (redLED, HIGH);
   else
      digitalWrite (redLED, LOW);

  // remember when we toggled it
  redLEDtimer = millis ();  
  }  // end of toggleRedLED

void loop ()
  {

  // Handling the blink of one LED.
  if ( (millis () - greenLEDtimer) >= greenLEDinterval)
     toggleGreenLED ();

  // The other LED is controlled the same way. Repeat for more LEDs
  if ( (millis () - redLEDtimer) >= redLEDinterval) 
    toggleRedLED ();

/* Other code that needs to execute goes here.
   It will be called many thousand times per second because the above code
   does not wait for the LED blink interval to finish. */

}  // end of loop

akshattripathi:
I know what ground pins do.

You don't.

But don't take that the wrong way, you can go very far not knowing and it's all good jumping in and trying things - I mean that, some personality types learn best that way...

But I really think you need to do a weee bit more reading - maybe scope out some very basic electronics tutorials first

waski:
So, just change pin number from 13 to whatever you want!

Look at Nick Gammon's example :

// Which pins are connected to which LED

const byte greenLED = 12;                  // pin number 12
const byte redLED = 13;                      // pin number 13

// Time periods of blinks in milliseconds (1000 to a second).
const unsigned long greenLEDinterval = 500;
const unsigned long redLEDinterval = 1000;

// Variable holding the timer value so far. One for each "Timer"
unsigned long greenLEDtimer;
unsigned long redLEDtimer;

void setup ()
  {
  pinMode (greenLED, OUTPUT);
  pinMode (redLED, OUTPUT);
  greenLEDtimer = millis ();
  redLEDtimer = millis ();
  }  // end of setup

void toggleGreenLED ()
  {
  if (digitalRead (greenLED) == LOW)
      digitalWrite (greenLED, HIGH);
  else
      digitalWrite (greenLED, LOW);

// remember when we toggled it
  greenLEDtimer = millis (); 
  }  // end of toggleGreenLED

void toggleRedLED ()
  {
  if (digitalRead (redLED) == LOW)
      digitalWrite (redLED, HIGH);
  else
      digitalWrite (redLED, LOW);

// remember when we toggled it
  redLEDtimer = millis (); 
  }  // end of toggleRedLED

void loop ()
  {

// Handling the blink of one LED.
  if ( (millis () - greenLEDtimer) >= greenLEDinterval)
    toggleGreenLED ();

// The other LED is controlled the same way. Repeat for more LEDs
  if ( (millis () - redLEDtimer) >= redLEDinterval)
    toggleRedLED ();

/* Other code that needs to execute goes here.
  It will be called many thousand times per second because the above code
  does not wait for the LED blink interval to finish. */

}  // end of loop

I have an LED with an anode and a cathode. How do I fit it in a single pin?

1:1:
You don't.

But don't take that the wrong way, you can go very far not knowing and it's all good jumping in and trying things - I mean that, some personality types learn best that way...

But I really think you need to do a were bit more reading - maybe scope out some very basic electronics tutorials first

Isn't it the pin which provides the lowest voltage on the board? (Using a Youtube tutorial for now. Do have an eBook, will read it when I start to get in depth with electronics. :slight_smile: )

I have an LED with an anode and a cathode. How do I fit it in a single socket?

You really need to read more about simple electrical connections :wink:

Take a short, thin wire. Remove insulation from both ends. Put one end to GND pin on arduino. Connect all cathodes together ( using wire or just by twisting them together ) , connect the wire from GND to all cathodes. Put LED's anodes to pins 13, 12, 11 ..etc . That's it.

akshattripathi:
But since I was not able to light up the LED, I thought that it had some connection to current supply.

That says you don't know. You read somethings and are willing to guess.

Ground is where the current must flow to be pushed through the power source. Circuit must be complete.

You can solder parts and wires together and put wire ends in Arduino holes.
You can put holes in cardboard or plastic and push led leads through, then solder on the back side.
So much of food packaging can serve. Just make sure it's not conductive unless that's what you want.

I have an LED with an anode and a cathode. How do I fit it in a single socket?

You get a resistor 220 ohms or more and you twist 1 lead of the resistor and the short led lead together real tight and maybe solder them together but don't have to. Then you stick the led long lead into a pin hole and the unconnected end of the resistor into a GND hole and when you output HIGH on that pin, the led will light.

Please learn more electronics. This should all be obvious. Conductors, current, resistance, etc.

waski:
You really need to read more about simple electrical connections :wink:

Take a short, thin wire. Remove insulation from both ends. Put one end to GND pin on arduino. Connect all cathodes together ( using wire or just by twisting them together ) , connect the wire from GND to all cathodes. Put LED's anodes to pins 13, 12, 11 ..etc . That's it.

All right, thanks a ton, really appreciate it. Though, what if I don't wanna use a wire either. I want to see 3 LEDs in the arduino board (nothing else). Is this possible?

GoForSmoke:
That says you don't know. You read somethings and are willing to guess.

Ground is where the current must flow to be pushed through the power source. Circuit must be complete.

You can solder parts and wires together and put wire ends in Arduino holes.
You can put holes in cardboard or plastic and push led leads through, then solder on the back side.
So much of food packaging can serve. Just make sure it's not conductive unless that's what you want.

You get a resistor 220 ohms or more and you twist 1 lead of the resistor and the short led lead together real tight and maybe solder them together but don't have to. Then you stick the led long lead into a pin hole and the unconnected end of the resistor into a GND hole and when you output HIGH on that pin, the led will light.

Please learn more electronics. This should all be obvious. Conductors, current, resistance, etc.

Ya, I will as soon as I am done with this project. Will try it with the resistor but that's not I what I want to do. I just want to use LEDs, the arduino board and power supply and that's it. Is it possible?

Will try it with the resistor but that's not I what I want to do. I just want to use LEDs, the arduino board and power supply and that's it. Is it possible?

" I don't know how to drive a car. I don't even know how to turn it on. And I don't want to learn. But I just bought a car and want to drive it. NOW. Oh ! And i don't want to use wheels. Is it possible ? "

waski:

Will try it with the resistor but that's not I what I want to do. I just want to use LEDs, the arduino board and power supply and that's it. Is it possible?

" I don't know how to drive a car. I don't even know how to turn it on. And I don't want to learn. But I just bought a car and want to drive it. NOW. Oh ! And i don't want to use wheels. Is it possible ? "

See, I have to make this project in a couple of days. That's why I wanted to be done with it and later I can read up more. Also, I did watch some Youtube tutorials and that's how I was able to make the blinking LED program in the first place.

You got all answers. You got a diagram. Learn it or leave it.

waski:
You got all answers. You got a diagram. Learn it or leave it.

So, the diagram is the one you provided? Also, I didn't get to know whether I can use the other LEDs in the other pins to light them up without using any other external wire/resister. Extremely sorry for being annoying, but I need to get this project done ASAP and don't really have time to complete the tutorial.

Put anode to pin 13. Put cathode to pin 12. Blink pin 13. Make pin 12 LOW

digitalWrite(12, LOW )