why breadboard led is not working?

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
knsakib
 
Posts: 12
Joined: Tue Jul 22, 2014 6:33 pm

why breadboard led is not working?

Post by knsakib »

I uploaded the hello world led blinking. the on board led is blinking. But i want to blink the led in the bread board that is connected to pin 1. also like to let up leds that are connected to pin 2, 3, 4. there is no tutorial about that. frustrating!!!!!!

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: why breadboard led is not working?

Post by adafruit_support_bill »

Post a photo of your breadboard setup and the code you are using. We'll see if we can spot the problem.

User avatar
michaelmeissner
 
Posts: 1822
Joined: Wed Aug 29, 2012 12:40 am

Re: why breadboard led is not working?

Post by michaelmeissner »

It sounds like this is your first electronics project. Some thoughts:
  • The wires in the LED must be in the correct orientation. On most LEDs, the longer leg must be attached to the power (anode) and the shorter LED must be attached to the ground.
  • In all circuits, there must be a complete circuit. Current has to be able to logically flow from the power source to ground.
  • Until you get to advanced designs, all ground connections must ultimately be connected to each other.
  • You must have an appropriate resistor for the LED in the circuit. It doesn't matter where you put the resistor (i.e. between data pin and LED or between LED and ground). The resistor limits the current to the LED, so that you don't burn it out or burn out your processor. If you don't have the resistor, you may have seen a light for a short time, and then the magic smoke was released. It depends on the LED and your microprocessor what resistor is going to be used. If you don't need maximum brightness, 220 or 330 ohm resistors are typically used. I like the Adafruit sequins (https://www.adafruit.com/products/1758) that include their own resistor. Unlike LEDs, resistors can be installed in either orientation.
  • The LED should be able to be powered by the microprocessor. You can get all sorts of LEDs with different power requirements. Until you are ready to get into the world of transistors and multiple power sources, you want to confine yourself to using LEDs made for Arduino and similar microprocessors (usually bought at the same place you bought the microprocessor).
  • When you are starting out, you want to use breadboards and jumper wire. Don't immediately jump into soldering, as that can have its own issues. Typically 22 gauge wire is used. If you have smaller wires (with a larger gauge size), the wire may not make contact in the breadboard. If the wire is solid core, if you bend it too often, it will break inside. Stranded wire is more resistant to movement, but you can bend it too much and it can break as well. Initially, I recommend using pre-made jumper wires. If you are going to cut your own wires, solid core wires are better for plugging into breadboards, while stranded wires are better for attaching to devices without a breadboard.
  • On most breadboards, with parallel red/black power strips down the board, the power strips on each side are not connected to each other. So, if you hooked up the power/ground to the left side, you need a wire that connects from the left side power to the right side power, and from the left side ground to the right side ground. The breadboard doesn't care which power rail you use, but conventionally, you want to use the red rails for power (anode) and the black rails for ground (cathode).
  • Be sure you connect the right power pin. On a trinket, you have 3 pins (3.3v/5v depending on the trinket, USB+, and Bat+). It depends on what you are doing which one you want. Typically for things like sensors, you want the 3.3v/5v power. For neopixels, you want the Bat+ power. Note, for LEDs, you don't need the power pin at all, since the data pin supplies the power.
  • The functions pinMode and digitalWrite in the blink program control the pins. To change what pin is used for the LED, you need to change the first argument of each function to a different number.

User avatar
michaelmeissner
 
Posts: 1822
Joined: Wed Aug 29, 2012 12:40 am

Re: why breadboard led is not working?

Post by michaelmeissner »

In terms of the Trinket, since they come without the header pins soldered on, that may be your problem. If you soldered on the header pins, you need to make sure that you did not connect two pins with solder (this is called a solder bridge). If you did make a solder bridge, you need to remove it (using solder braid and a soldering iron) for the circuit to work. This is where having a quality high resolution picture of the entire circuit helps.

You do need to make sure there is an electrical connection between the header pin and the board.

If you are not soldering header pins to the Trinket, you can use wires wrapped around the contact hole. You have to make sure the wire connects to the metal part of the connector so that the circuit is made. People at times use alligator clips, but I have damaged some neopixels in the past with alligator clips, and I generally don't use them any more.

Remember, you are learning a new skill, and it will take some time to get past the hurdle. Don't get too frustrated.

User avatar
knsakib
 
Posts: 12
Joined: Tue Jul 22, 2014 6:33 pm

Re: why breadboard led is not working?

Post by knsakib »

I am not new. and when the code is like LED=1 means i use pin 1, the on board led is blinking and no blinking in breadboard led and the there no 5v in between pin 1 and gnd (measured). and when upload the program with LED=3 like below it is repeatedly making connecting and disconnecting sound. (the FQA says it does when the code is wrong!!) . whats wrong ?? pain!!

int LED=3; // blink 'digital' pin 1 - AKA the built in red LED

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(LED, OUTPUT);

}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
delay(1000);
}

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: why breadboard led is not working?

Post by adafruit_support_bill »

Please post a photo of your breadboard setup.

User avatar
knsakib
 
Posts: 12
Joined: Tue Jul 22, 2014 6:33 pm

Re: why breadboard led is not working?

Post by knsakib »

2 pics. with led 1 (took it before when measuring) , then with led 1
rsz_pic1.jpg
rsz_pic1.jpg (932.88 KiB) Viewed 333 times
rsz_pic2.jpg
rsz_pic2.jpg (964.34 KiB) Viewed 333 times

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: why breadboard led is not working?

Post by adafruit_support_bill »

Your code is writing to digital pin 3.

Code: Select all

int LED=3;
From what I can see in the photo:
  • Pin 3 is connected via a resistor to the orange jumper in row 20.
    The orange jumper connects to one leg of the yellow LED in row 32
    I see no path from the other leg of that LED to ground.

User avatar
knsakib
 
Posts: 12
Joined: Tue Jul 22, 2014 6:33 pm

Re: why breadboard led is not working?

Post by knsakib »

why? pin 3 is connected via resistor to (in row 28) to orange jumper. orange jumper is connected to the anode of yellow led. yellow led cathode is connected to push button. the other shorted leg of push button is connected to another orange jumper that goes to (-) row of breadboard, while (-) row is connected to the gnd of trinket via cyan jumper.

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: why breadboard led is not working?

Post by adafruit_support_bill »

why?
Because in your photos we can't see which is the anode, which is the cathode and where the other leg of the yellow led is connected. And your description of the problem only talks about pin 1 and mentions nothing about pushbuttons. We can only base our advice on the accuracy of the information provided.

Does the led blink when you press the button?

Every breadboard connection is an opportunity for problems. If you are questioning the output of the GPIO pin, it is better to simplify your circuit by eliminating all the extra jumpers and pushbuttons and narrow it down to just the GPIO pin, the LED and the resistor, with a direct path to ground.

User avatar
knsakib
 
Posts: 12
Joined: Tue Jul 22, 2014 6:33 pm

Re: why breadboard led is not working?

Post by knsakib »

OK. i am posting simplified circuit. took the picture exactly when on board red is blink(light up) but the bread board led is off.
rsz_dsc_0244.jpg
rsz_dsc_0244.jpg (617.91 KiB) Viewed 312 times

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: why breadboard led is not working?

Post by adafruit_support_bill »

From what I can see, you haven't soldered the headers. You have to solder the headers to get reliable conductivity.

User avatar
knsakib
 
Posts: 12
Joined: Tue Jul 22, 2014 6:33 pm

Re: why breadboard led is not working?

Post by knsakib »

I check the continuity. its connected for sure.

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: why breadboard led is not working?

Post by adafruit_support_bill »

I check the continuity. its connected for sure.
No. From the photo it is obviously not. Any joint will conduct electricity when you poke it with a probe. You need to solder them for reliable operation. Please read this guide and properly solder you headers.
http://learn.adafruit.com/adafruit-guid ... -soldering

User avatar
knsakib
 
Posts: 12
Joined: Tue Jul 22, 2014 6:33 pm

Re: why breadboard led is not working?

Post by knsakib »

OK. pin 4 is clearly visible that it is soldered. uploaded the program.

code:

int LED=4;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(LED, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
delay(1000);
}
rsz_dsc_0245.jpg
rsz_dsc_0245.jpg (971.97 KiB) Viewed 289 times

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”