Skip to main content
Arduino

Return to Answer

replaced http://electronics.stackexchange.com/ with https://electronics.stackexchange.com/
Source Link

Note that most Arduino I/O lines are rated to sink or source at most 40 mA current each. Ground and Vcc lines have higher limits, like 200 or 100 mA. For more details see the spec sheet for your processor; also see ArduinoPinCurrentLimitations at arduino.cc, and Real maximum current for ATmega328? Real maximum current for ATmega328? on Electronics SE.

Note that most Arduino I/O lines are rated to sink or source at most 40 mA current each. Ground and Vcc lines have higher limits, like 200 or 100 mA. For more details see the spec sheet for your processor; also see ArduinoPinCurrentLimitations at arduino.cc, and Real maximum current for ATmega328? on Electronics SE.

Note that most Arduino I/O lines are rated to sink or source at most 40 mA current each. Ground and Vcc lines have higher limits, like 200 or 100 mA. For more details see the spec sheet for your processor; also see ArduinoPinCurrentLimitations at arduino.cc, and Real maximum current for ATmega328? on Electronics SE.

added 84 characters in body
Source Link

I don't see any program statements in the code as shown to cause the described behavior, and imagine it is some hardware problem. (I'm assuming you put some non-zero values into the image[][] array; it looks to me like nothing should light up when image[][] is all-zeroes.)

Hardware problems break into several categories: A wiring problem (which we can't see without much better pictures); incorrect software setup of HW; temporary misbehavior of the processor; or permanent damage. For the sake of discussion, suppose temporary misbehavior applies.

Temporary misbehavior can be caused by overheating. Overheating can be caused by drawing or sinking a lot of current for too long a time. (If a large current is a fast transient event, it may have little effect.)

Note that most Arduino I/O lines are rated to sink or source at most 40 mA current each. Ground and Vcc lines have higher limits, like 200 or 100 mA. For more details see the spec sheet for your processor; also see ArduinoPinCurrentLimitations at arduino.cc, and Real maximum current for ATmega328? on Electronics SE.

If an LED is directly connected to 5V, it is likely to draw several times more current than nominal. Connecting an LED directly to an Arduino digital line also will allow it to draw too much current. Connecting 8 LEDs to a single processor IO line is likely to cause enough overheating to damage the processor permanently. You may need to add 8 or 16 resistors to your circuit.

Anyhow, instead of trying to debug while using a 100 μs multiplexing delay in your program, and instead of turning on lots of lights at the same time, try turning on one at a time for a brief but visible period each, and see if the array of lights scans ok, via code like the following:

int rowPins[] = {19, 18, 11, 7, 12, 5, 4, 16}; //assign row lines
int columnPins[] = {13, 17, 9, 10, 2, 8, 3, 6}; //assign col lines
void setup() { 
 int i; 
 for (i=0; i<8; ++i) {
 pinMode(rowPins[i], OUTPUT); 
 digitalWrite(rowPins[i], HIGH);
 pinMode(columnPins[i], OUTPUT); 
 digitalWrite(columnPins[i], LOW); 
 }
}
void loop () {
 int x, y;
 for (y=0; y<8; ++y) {
 digitalWrite(rowPins[y], LOW);
 for (x=0; x<8; ++x) {
 digitalWrite (columnPins[x], HIGH);
 delay(250); // wait about .25 seconds
 digitalWrite(columnPins[x], LOW);
 }
 digitalWrite(rowPins[y], HIGH);
 } 
}

If multiple lights are on there may be miswiring on your project board, or the chip might be damaged, or there may be some roundabout leakage path from columns to ground or from rows to Vcc. If you make the delay longer or add a pushbutton to advance manually, you can check voltages on LEDs and wires, or measure currents in wires, and perhaps deduce what the path is.

I don't see any program statements in the code as shown to cause the described behavior, and imagine it is some hardware problem. (I'm assuming you put some non-zero values into the image[][] array; it looks to me like nothing should light up when image[][] is all-zeroes.)

Hardware problems break into several categories: A wiring problem (which we can't see without much better pictures); incorrect software setup of HW; temporary misbehavior of the processor; or permanent damage. For the sake of discussion, suppose temporary misbehavior applies.

Temporary misbehavior can be caused by overheating. Overheating can be caused by drawing or sinking a lot of current for too long a time. (If a large current is a fast transient event, it may have little effect.)

Note that most Arduino I/O lines are rated to sink or source at most 40 mA current each. Ground and Vcc lines have higher limits, like 200 or 100 mA. For more details see the spec sheet for your processor; also see ArduinoPinCurrentLimitations at arduino.cc, and Real maximum current for ATmega328? on Electronics SE.

If an LED is directly connected to 5V, it is likely to draw several times more current than nominal. Connecting an LED directly to an Arduino digital line also will allow it to draw too much current. Connecting 8 LEDs to a single processor IO line is likely to cause enough overheating to damage the processor permanently. You may need to add 8 or 16 resistors to your circuit.

Anyhow, instead of trying to debug while using a 100 μs multiplexing delay in your program, and instead of turning on lots of lights at the same time, try turning on one at a time for a brief but visible period each, and see if the array of lights scans ok, via code like the following:

int rowPins[] = {19, 18, 11, 7, 12, 5, 4, 16}; //assign row lines
int columnPins[] = {13, 17, 9, 10, 2, 8, 3, 6}; //assign col lines
void setup() { 
 int i; 
 for (i=0; i<8; ++i) {
 pinMode(rowPins[i], OUTPUT); 
 digitalWrite(rowPins[i], HIGH);
 pinMode(columnPins[i], OUTPUT); 
 digitalWrite(columnPins[i], LOW); 
 }
}
void loop () {
 int x, y;
 for (y=0; y<8; ++y) {
 digitalWrite(rowPins[y], LOW);
 for (x=0; x<8; ++x) {
 digitalWrite (columnPins[x], HIGH);
 delay(250); // wait about .25 seconds
 digitalWrite(columnPins[x], LOW);
 }
 digitalWrite(rowPins[y], HIGH);
 } 
}

I don't see any program statements in the code as shown to cause the described behavior, and imagine it is some hardware problem. (I'm assuming you put some non-zero values into the image[][] array; it looks to me like nothing should light up when image[][] is all-zeroes.)

Hardware problems break into several categories: A wiring problem (which we can't see without much better pictures); incorrect software setup of HW; temporary misbehavior of the processor; or permanent damage. For the sake of discussion, suppose temporary misbehavior applies.

Temporary misbehavior can be caused by overheating. Overheating can be caused by drawing or sinking a lot of current for too long a time. (If a large current is a fast transient event, it may have little effect.)

Note that most Arduino I/O lines are rated to sink or source at most 40 mA current each. Ground and Vcc lines have higher limits, like 200 or 100 mA. For more details see the spec sheet for your processor; also see ArduinoPinCurrentLimitations at arduino.cc, and Real maximum current for ATmega328? on Electronics SE.

If an LED is directly connected to 5V, it is likely to draw several times more current than nominal. Connecting an LED directly to an Arduino digital line also will allow it to draw too much current. Connecting 8 LEDs to a single processor IO line is likely to cause enough overheating to damage the processor permanently. You may need to add 8 or 16 resistors to your circuit.

Anyhow, instead of trying to debug while using a 100 μs multiplexing delay in your program, and instead of turning on lots of lights at the same time, try turning on one at a time for a brief but visible period each, and see if the array of lights scans ok, via code like the following:

int rowPins[] = {19, 18, 11, 7, 12, 5, 4, 16}; //assign row lines
int columnPins[] = {13, 17, 9, 10, 2, 8, 3, 6}; //assign col lines
void setup() { 
 int i; 
 for (i=0; i<8; ++i) {
 pinMode(rowPins[i], OUTPUT); 
 digitalWrite(rowPins[i], HIGH);
 pinMode(columnPins[i], OUTPUT); 
 digitalWrite(columnPins[i], LOW); 
 }
}
void loop () {
 int x, y;
 for (y=0; y<8; ++y) {
 digitalWrite(rowPins[y], LOW);
 for (x=0; x<8; ++x) {
 digitalWrite (columnPins[x], HIGH);
 delay(250); // wait about .25 seconds
 digitalWrite(columnPins[x], LOW);
 }
 digitalWrite(rowPins[y], HIGH);
 } 
}

If multiple lights are on there may be miswiring on your project board, or the chip might be damaged, or there may be some roundabout leakage path from columns to ground or from rows to Vcc. If you make the delay longer or add a pushbutton to advance manually, you can check voltages on LEDs and wires, or measure currents in wires, and perhaps deduce what the path is.

added 84 characters in body
Source Link

I don't see any program statements in the code as shown to cause the described behavior, and imagine it is some hardware problem. (I'm assuming you put some non-zero values into the image[][] array; it looks to me like nothing should light up when image[][] is all-zeroes.)

Hardware problems break into several categories: A wiring problem (which we can't see without much better pictures); incorrect software setup of HW; temporary misbehavior of the processor; or permanent damage. For the sake of discussion, suppose temporary misbehavior applies.

Temporary misbehavior can be caused by overheating. Overheating can be caused by drawing or sinking a lot of current for too long a time. (If a large current is a fast transient event, it may have little effect.)

Note that most Arduino I/O lines are rated to sink or source at most 40 mA current each. Ground and Vcc lines have higher limits, like 200 or 100 mA. For more details see the spec sheet for your processor; also see ArduinoPinCurrentLimitations at arduino.cc, and Real maximum current for ATmega328? on Electronics SE.

If an LED is directly connected to 5V, it is likely to draw several times more current than nominal. Connecting an LED directly to an Arduino digital line also will allow it to draw too much current. Connecting 8 LEDs to a single processor IO line is likely to cause enough overheating to damage the processor permanently. You may need to add 8 or 16 resistors to your circuit.

Anyhow, instead of trying to debug while using a 100 μs multiplexing delay in your program, and instead of turning on lots of lights at the same time, try turning on one at a time for a brief but visible period each, and see if the array of lights scans ok, via code like the following:

int rowPins[] = {19, 18, 11, 7, 12, 5, 4, 16}; //assign row lines
int columnPins[] = {13, 17, 9, 10, 2, 8, 3, 6}; //assign col lines
void setup() { 
 int i; 
 for (i=0; i<8; ++i) {
 pinMode(rowPins[i], OUTPUT); 
 digitalWrite(rowPins[i], HIGH);
 pinMode(columnPins[i], OUTPUT); 
 digitalWrite(columnPins[i], LOW); 
 }
}
void loop () {
 int x, y;
 for (y=0; y<8; ++y) {
 digitalWrite(rowPins[y], LOW);
 for (x=0; x<8; ++x) {
 digitalWrite (columnPins[x], HIGH);
 delay(250); // wait about .25 seconds
 digitalWrite(columnPins[x], LOW);
 }
 digitalWrite(rowPins[y], HIGH);
 } 
}

I don't see any program statements in the code as shown to cause the described behavior, and imagine it is some hardware problem. (I'm assuming you put some non-zero values into the image[][] array; it looks to me like nothing should light up when image[][] is all-zeroes.)

Hardware problems break into several categories: A wiring problem (which we can't see without much better pictures); incorrect software setup of HW; temporary misbehavior of the processor; or permanent damage. For the sake of discussion, suppose temporary misbehavior applies.

Temporary misbehavior can be caused by overheating. Overheating can be caused by drawing or sinking a lot of current for too long a time. (If a large current is a fast transient event, it may have little effect.)

Note that most Arduino I/O lines are rated to sink or source at most 40 mA current each. Ground and Vcc lines have higher limits, like 200 or 100 mA. For more details see the spec sheet for your processor; also see ArduinoPinCurrentLimitations at arduino.cc, and Real maximum current for ATmega328? on Electronics SE.

If an LED is directly connected to 5V, it is likely to draw several times more current than nominal. Connecting an LED directly to an Arduino digital line also will allow it to draw too much current. Connecting 8 LEDs to a single processor IO line is likely to cause enough overheating to damage the processor permanently. You may need to add 8 or 16 resistors to your circuit.

Anyhow, instead of trying to debug while using a 100 μs multiplexing delay in your program, and instead of turning on lots of lights at the same time, try turning on one at a time for a brief but visible period each, and see if the array of lights scans ok, via code like the following:

int rowPins[] = {19, 18, 11, 7, 12, 5, 4, 16}; //assign row lines
int columnPins[] = {13, 17, 9, 10, 2, 8, 3, 6}; //assign col lines
void setup() { 
 int i; 
 for (i=0; i<8; ++i) {
 pinMode(rowPins[i], OUTPUT); 
 pinMode(columnPins[i], OUTPUT); 
 }
}
void loop () {
 int x, y;
 for (y=0; y<8; ++y) {
 digitalWrite(rowPins[y], LOW);
 for (x=0; x<8; ++x) {
 digitalWrite (columnPins[x], HIGH);
 delay(250); // wait about .25 seconds
 digitalWrite(columnPins[x], LOW);
 }
 digitalWrite(rowPins[y], HIGH);
 } 
}

I don't see any program statements in the code as shown to cause the described behavior, and imagine it is some hardware problem. (I'm assuming you put some non-zero values into the image[][] array; it looks to me like nothing should light up when image[][] is all-zeroes.)

Hardware problems break into several categories: A wiring problem (which we can't see without much better pictures); incorrect software setup of HW; temporary misbehavior of the processor; or permanent damage. For the sake of discussion, suppose temporary misbehavior applies.

Temporary misbehavior can be caused by overheating. Overheating can be caused by drawing or sinking a lot of current for too long a time. (If a large current is a fast transient event, it may have little effect.)

Note that most Arduino I/O lines are rated to sink or source at most 40 mA current each. Ground and Vcc lines have higher limits, like 200 or 100 mA. For more details see the spec sheet for your processor; also see ArduinoPinCurrentLimitations at arduino.cc, and Real maximum current for ATmega328? on Electronics SE.

If an LED is directly connected to 5V, it is likely to draw several times more current than nominal. Connecting an LED directly to an Arduino digital line also will allow it to draw too much current. Connecting 8 LEDs to a single processor IO line is likely to cause enough overheating to damage the processor permanently. You may need to add 8 or 16 resistors to your circuit.

Anyhow, instead of trying to debug while using a 100 μs multiplexing delay in your program, and instead of turning on lots of lights at the same time, try turning on one at a time for a brief but visible period each, and see if the array of lights scans ok, via code like the following:

int rowPins[] = {19, 18, 11, 7, 12, 5, 4, 16}; //assign row lines
int columnPins[] = {13, 17, 9, 10, 2, 8, 3, 6}; //assign col lines
void setup() { 
 int i; 
 for (i=0; i<8; ++i) {
 pinMode(rowPins[i], OUTPUT); 
 digitalWrite(rowPins[i], HIGH);
 pinMode(columnPins[i], OUTPUT); 
 digitalWrite(columnPins[i], LOW); 
 }
}
void loop () {
 int x, y;
 for (y=0; y<8; ++y) {
 digitalWrite(rowPins[y], LOW);
 for (x=0; x<8; ++x) {
 digitalWrite (columnPins[x], HIGH);
 delay(250); // wait about .25 seconds
 digitalWrite(columnPins[x], LOW);
 }
 digitalWrite(rowPins[y], HIGH);
 } 
}
Source Link
Loading

AltStyle によって変換されたページ (->オリジナル) /