Go Down

Topic: Led across two outputs? (Read 1 time) previous topic - next topic


I got my Arduino yesterday (and it's a lot of fun)! I just have a (silly) question..

Is it okay to have a led running across a High and a Low output? And is the Low output the same as ground? I am just playing around with a small matrix, but without really any IC's to use -  so I can't connect all the rows (of the matrix) to ground, since then I would lit up the whole column and not a single led.

Thanks for any response.


Dec 15, 2006, 09:58 am Last Edit: Dec 15, 2006, 10:07 am by Daniel Reason: 1
If the leds have a resitor in series with each of them (minimum 220R for red, green and yellow types, 100R for blue) then it should be OK. Without a resistor you would be driving too much current from one pin into another pin. The thing to remember is that any given pin should be sourcing/sinking at most 20ma...

Remember also that the pins can source enough current for one bright led or two dimmish ones, depending on the resitor chosen. So when you are wiring things up, don't ask the Atmega chip to provide enough current to drive more than that. For multiple leds on one pin, use a transistor driver.

(I have to say though, I have seen students do the complete opposite of the advice above, and no one seems to have fried an Arduino yet, the Atmega chip is incredibly robust.)



Thanks for the reply! It makes more sense now.


I've tried this and it works perfect when I connect the arduino board to the USB, but when I do it thought a power supply it doesn't work!

I'm usign a 12v@1A power supply and I've change the jumper to EXT. What I'm doing wrong? I've an ATMEGA168.



Feb 28, 2007, 10:10 pm Last Edit: Feb 28, 2007, 10:11 pm by xSmurf Reason: 1
Did you forget to switch the jumper to external power mode?
"Pilots believe in a clean living... they never drink wisky from a dirty glass."


Feb 28, 2007, 10:34 pm Last Edit: Feb 28, 2007, 10:37 pm by binnary Reason: 1
No, the jumper is correctly selected. I have tried with the same code in another board, this one with a ATMEGA8 and it works, but with the ATMEGA168, there is no way. I've also selected for the IDE de correct version of the chip before programing it!

I've buy it at PCB Europe, and I've the same problem with this two arduinos. The old one based on ATMEGA8 works perfect...

Any idea?

This is the code I'm using:
void setup()
   pinMode(10, OUTPUT);
   pinMode(11, OUTPUT);

void loop()



Sometimes the serial port hangs when you are using external power. The solution is a 10K resistor from RX to ground. see these posts




Feb 28, 2007, 10:51 pm Last Edit: Feb 28, 2007, 10:52 pm by binnary Reason: 1
Thank you very much, it works! But the problem now is that I've to put that resistor every time I start the arduino with the external power supply, and I need that port for the serial comunication. Is there any other solution?

Thanks again



what do you have the RX pin connected to?



The RX pin is connected to the TX of another arduino, and the TX to the RX, so we can comunicate both throught serial comunication. If we can not use the RX pin, we can change the configuration to make the serial comunication with other pins.

But it is possible to make the serial comunication with the 10k resistor and the RX pin conected to the other arduino?

Thanks again!



yes, leave  the 10K resistor, see what happens. It should work fine.

But... you might have another problem. Arduino 1 will not finish booting if it gets any serial data during boot from Arduino 2, and vice-versa.  

The simple way around this is to use a TTL or CMOS gate with enable to turn the connection on once the Arduino's have finished booting.

Here's what's suggested in the FAQ:


Why doesn't my sketch start when I power up or reset the Arduino board?

Most likely because you are sending serial data to the board when it firsts turns on. During the first few seconds, the bootloader (a program pre-burned onto the chip on the board) listens for the computer to send it a new sketch to be uploaded to the board. After a few seconds without communication, the bootloader will time out and start the sketch that's already on the board. If you continue to send data to the bootloader, it will never time out and your sketch will never start. You'll either need to find a way to stop serial data from arriving for the first few seconds when the board powers (e.g. by enabling the chip that sends the data from within your setup() function) or burn your sketch onto the board with an external programmer, replacing the bootloader.


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131