I need help with resistance, led, and arduino

Thread Starter

Zane Finner

Joined Jan 29, 2018
30
So the problem is that I don't know how much resistors to add, or even if I should add some. I am using LED's and I always hear "Don't power LED's without resistance". I have been powering about 20 at a time in a simulation of arduino (supplies 4 to 12 volts) and it seems fine but a little dim. Do I need to add resistance? Allow more voltage? How do I add more volts?

My code:
C:
void setup()
{
  pinMode(8, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
}

void loop()
{
  digitalWrite(8, LOW);
  digitalWrite(13, HIGH);
  delay(400); // Wait for 400 millisecond(s)
  digitalWrite(13, LOW);
  digitalWrite(12, HIGH);
  delay(400); // Wait for 400 millisecond(s)
  digitalWrite(12, LOW);
  digitalWrite(11, HIGH);
  delay(400); // Wait for 400 millisecond(s)
  digitalWrite(11, LOW);
  digitalWrite(10, HIGH);
  delay(400); // Wait for 400 millisecond(s)
  digitalWrite(10, LOW);
  digitalWrite(8, HIGH);
  delay(400); // Wait for 400 millisecond(s)
}

Cathodes are connected together and to ground
Anodes are connected to various pins
(Sorry for the minor incoherencies)

Moderators note: used code tags
 

Attachments

Last edited by a moderator:

dendad

Joined Feb 20, 2016
4,480
If you want to run more than one LED at a time fron an Arduino pin, you really need a buffer of some sort. Having the Arduino switch a FET or transistor or driver IC is the way to go.
The Arduino pins can only supply a small current and if you push them to far you run the risk of popping the Arduino.
 

Thread Starter

Zane Finner

Joined Jan 29, 2018
30
If you want to run more than one LED at a time fron an Arduino pin, you really need a buffer of some sort. Having the Arduino switch a FET or transistor or driver IC is the way to go.
The Arduino pins can only supply a small current and if you push them to far you run the risk of popping the Arduino.
Thanks soo much! I understand most of this and what a transistor is and how to operate one(for the most part) but can you show a simple schematic?
 
Top