Please forgive my ignorance; I'm basically an electronics moron stumbling my way into Arduino-land.
I have a Lilypad Arduino, and I'm trying to control a grid of LEDs by using six digital outputs to control the rows, and eight for the columns. All of the rows have appropriate pulldown resistors.
My problem is that I can't seem to get more than 3.5V to drive the array, even on a port with no lead out, and so my LEDs are quite dim when I do hook them up (the actual voltage under load is more like 3V). I'm never driving more than one row at a time, but even when only one row and one column are live the problem persists.
I understand that the digital pins are supposed to go to five volts, and I'm scratching my head why I can't get there.
How are you powering the LilyPad Arduino? A digital output pin can only go high equal or slighty less the voltage powering the board, depending on how much current you are driving from the pin.
.. and don't forget to adapt the resistor values for 3V.
red LEDs (1,5) volts: around 100 Ohms, will draw 16 to 18mA
green LEDs (2,1) volts: 68 Ohms, will draw 15 to 17mA
@mowcius: What do you mean? Nearly all LEDs below 500mW are "3 Volt compatible". Problems can start with bright white and blue LEDs... But if not pulsing them, you better use a current limiting resistor.
Opinions WRT pulsing LEDS however are devided....
You did say you were new to electronics, so forgive the following question....
Is your Lillypad a 5v Lillypad or a 3.3v Lillypad? I'm not sure that the Lillypad comes in both "flavors", but some Arduinos and clones do! And several respondants above seem to be assuming your device is a 3.3v device.
If it is... just recalculate the resistances for your current limiting resistors for the LEDs. You DO have CLRs, don't you?.....
Thanks for all the replies and suggestions, folks.
Re the board: it's an ATAmega168. I'm having a devil of a time reading the datasheet and getting the output voltage, but apparently 3.3 isn't that unusual.
Re the LEDs: yeah, my LED should be happy at 3V. I started with a 200ohm CLR, then tried a 50. Here are the results:
200ohm resistor yields 6mA, 3.1V from pinout to ground
50ohm yields 14mA at 2.7V, and a somewhat brighter light
Now, who can explain why these measurements don't obey Ohm's Law? (ie., 200*.006=1.2, not 3.1; 50*.014 = .7, not 2.7)
Anyway, I'm thinking of just trying 10 and 20-ohm CLRs on a test LED and see how it goes, figuring that if it doesn't blow under continuous power, then it should be okay under pulsing.
...speaking of which, the LED wants 1/10 duty cycle, .1ms pulses. How can I tell the cycle time when programming it?
Well, it's connected on input directly to USB off my laptop, which I assume should be providing plenty of current. At output (for the pin I'm testing, anyway), there's just a short length of copper wire, the LED, the resistor, and enough clips to connect them together. I ground to the '-' pin on the Lilypad. Seems like a pretty lossless configuration to me.
Now, the garment as a whole is another story. I've got regular 5mm LEDs wired into a grid, where their pins are in fact in contact with the fabric. I've wondered if I've not got some low-grade loss there...
Oh, sorry, lots of questions to keep up with. At present it's running off the USB cable on my laptop. So, 5V, right?
Well lets take another tack. With your multimeter, or however you were measuring output pin voltage, measure between ground and the Vcc pins on the JP-2 connector while it's plugged into your USB cable and tell us the value read.