Hello, I am new at Arduino so sorry for my questions. However, I am wondering if it is possible to have bright LEDs while blinking? I will attach an image of my circuit below. My issue right now is that I have a 9V battery running the Arduino and then another 9V battery on the breadboard since my circuit needs more than 5V to run. When the battery on the breadboard is connected and the LEDs are lit the brightness is very dim. However, when the wire is connected to the Vin on the Arduino board the LEDs are as bright as I want them to be. But, I cannot leave the neg part of the battery connected to the Vin and positive to the breadboard because when I do, the code does not run—oddly enough. I cannot see the LEDs blinking once the neg of battery is connected to Vin and pos to breadboard. Is there a way to make it so that my LEDs are bright and can blink?
P.S. I do have a wire from the 5V pin on the Arduino to the positive bus on the breadboard.
Thank you in advance for your help!
Post the code here using code tags, not a picture of it. It's not useful, nor readable.
How did You calculate that 9 volt for the LEDs? Show Your calculations.
Observation #1: Your MOSFET is in the wrong part of the circuit. Put the battery on top of the LED anodes -> resistor -> MOSFET drain -> MOSFET source -> to ground. The gate connection can remain as is though you might want an additional 100K pull-down resistor on the FET gate to force the LEDs off when the Arduino pin is HiZ (as in after reset before pinMode( 13, OUTPUT ) is executed...)
I am changing the MOSFET to a BJT because I have more BJT's than MOSFET. I just changed the transistor and have the circuit running now. However, the LEDS are not as bright as I would like them. Is there a way I can make the LEDs brighter?
jchia:
I am changing the MOSFET to a BJT because I have more BJT's than MOSFET. I just changed the transistor and have the circuit running now. However, the LEDS are not as bright as I would like them. Is there a way I can make the LEDs brighter?
Use a MOSFET. It usually wastes less output power than a BJT. It's possible also that the 2N2222 max collector current has been exceeded. Meanwhile, post an updated schematic, please. Nobody can possible guess what you constructed.
What are the resistor values left and right of the LEDs?
NPN will have 0.7V drop from E to C.
(9V - (5 x 1.2V) - 0.7V)/(4.7 + 33) = 61mA / 4 strings = 15mA/string if the current splits evenly between the 4 strings.
N-channel MOSFET will have less drop, thus more current can flow. Which MOSFET are you using?
Say it has an Rds of 1 ohm. Then equation changes to:
(9V - (5 x 1.2V))/(1 + 4.7 + 33) = 77.5mA
Lower Rds will yield even more current and brighter LEDs. You don't want to exceed 80mA, I believe that was the max rating on your LEDs from another thread.
"But, I cannot leave the neg part of the battery connected to the Vin"
Negative of the battery goes to GND of the Arduino, not to VIN.
Positive of battery goes to VIN if you are not using a 5V source.
Right now I have a 9V battery running the Arduino and another 9V battery on the breadboard
When the battery on the breadboard is connected the LEDs are very dim.
the wire is connected to the Vin on the Arduino board the LEDs are as bright
WHAT WIRE ????
I cannot leave the neg part of the battery connected to the Vin and positive to the breadboard because when I do, the code does not run
WHAT ??? are you connecting the two batteries in series ?
I cannot see the LEDs blinking once the neg of battery is connected to Vin and pos to breadboard.
Is there a way to make it so that my LEDs are bright and can blink?
I do have a wire from the 5V pin on the Arduino to the positive bus on the breadboard.
it sounds like you are trying to use a 9v battery to run LEDs. a 9v battery has a life of about 30 minutes for that use.
can you use power supplies and not batteries ? then, you could make the lights as bright as they can be.