Hey! I wonder how i can use a blink sketch and make it blink 130 LED at the same time. I have used two LED lights that blinking like i want it but i cannot have all 130 powered from the Arduino. How can i add external power and at the same time let it blink from the D port.
The simple code runns great for this.
int led = 10;
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(led, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(40); // the blink
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(40); // the blink
}
Hey! I wonder how i can use a blink sketch and make it blink 130 LED at the same time. I have used two LED lights that blinking like i want it but i cannot have all 130 powered from the Arduino. How can i add external power and at the same time let it blink from the D port.
The simple code runns great for this.
int led = 10;
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(led, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(40); // the blink
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(40); // the blink
}
Here is a basic circuit i copied from the web. Determine how much current you need then size the MOSFET accordingly, if it can handle more current all the better. The more current it can handle the cooler it will run. You can switch well over 10A with a TO220 device and hold it in your hand. I assume you will be using these parts in other projects or be purchasing extras. Get Avalanche rated logic level N-Channel MOSFETs. The UIS rating will tell you what it can handle in fly back mode. This eliminates the need for a fly back diode with inductive or other type of loads. Replace the lamp with your LEDs. For LEDs you do not need to worry about the fly back diode unless you have very long wires, the proper MOSFET eliminates the worry entirely. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil
I've merged your other cross-post @makerspaceAndyBTH.
Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.
Repeated cross-posting will result in a suspension from the forum.
In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.
gilshultz:
Here is a basic circuit i copied from the web.
...
And of course, that circuit is a dud because "RGS" is on the wrong side of "RIN", forming an unnecessary potential divider. "RGS" should be across the input, since its function is to hold that point down when the input device is not doing so, during reset.
The "flywheel" diode is only required for inductive loads, and it is most unlikely that the avalanche rating of the FET will be a sufficient alternative for a truly inductive load.