also from the official site:
" The Arduino Mega 2560 is a microcontroller board based on the ATmega2560. It has 54 digital input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button."
can I be sure I indeed have 69 Digital pins and I can use all of them?
if I do:
void setup(){
for (int i = 0; i < 69; i++)
{
pinMode(i, OUTPUT);
}
will I be able use all the above pins as a digital OUTPUT ?
so apart of pin 0 and 1 that reserve for communication with computer, can I use all the remain 67 Pins as digital outputs? if I declare them to be an output as the follow:
void setup(){
for (int i = 2; i < 69; i++)
{
pinMode(i, OUTPUT);
}
The Mega MCU has four VCC/GND pins, which allow for 100mA each, so 400mA absolute max chip current. So you're ok with 2.27mA per pin.
Using 60 transistors could be a nightmare. Is this for your 12volt/3watt LEDs?
2.27mA seems too low for a 2N3904 to fully saturate with 250mA collector current.
Leo..
The 60 transistor is for driving 60 individual 10mm LEDs. not for 12V/3Watt LEDs.
I have already drive 40 of them with 40 2N3904 using 2k2 resistor from the Arduino GPIO pins to the transistor base. it seems to work just fine/
@R_Gol, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for advise on (nor for problems with) your project.
Replace the 2n3904 with a suitable mosfet and the current consumption of your microcontroller drops to virtually nothing.
Any reason why you need those 10mm leds and e.g. an array of WS2812's doesn't get the job done? What you're doing sounds rather..well, odd. What's the application?
I will look for a suitable MOSFET for next projects. I'm afraid I have only those 2N3904 so I will have to use them for that project.
I need to use individual LED that will be places far array from each other, therefore I can't use a led strip as each data is series connect to the next one..
Iv'e checked my circuit using the 2N3904 transistor and it seems to work just fine with the value I specify.. Why not using it if it is working for what I need in that particular project?
WS2812's don't have to be part of a strip. They come as single element modules as well.
Why use a compromised approach if a better alternative is cheaply available? Suitable mosfets for this purpose are cheap. Even bss123 or 2n7000 would do nicely and they're a dime a dozen - quite literally.
I'm new to this and therefore still can't get it. Those addressable leds have four
terminals: GND, VCC+, Data in, Data Out (?)
in any case if my LEDs should be far away from each other I will need to connect a wire between each LED data out to the next LED data in. isn't it ?
so apart of using only 1 pin in the arduino instead of 60 (which is quite a big difference). I will still need to connect 60 wires between each LED data in to data out? and also each LED GND and VCC+ ?
Is that the way those LED are used ?
Yes, but you can route the Vcc and GND wires in several ways. The data wire needs to run from one led to the next.
Look up some ws2812 tutorials, it'll make things clear.
How far apart will your leds be?
it will be a few groups of around 5 to 10 LED . each group will be around 15Meter away form the Arduino. the distance between LED in each group should not be to far (around 1 meter I think) but the distances between groups could be between 5 to 10 meter..