I have that 4 identical figure lights. And they haven't got any flickering problem at the time. And their original circuit diagram is on the figure-1.
And then I want to add bluetooth feature to them with arduino. The circuit diagram I used is on the figure-2.
As a power source I used 5v 2.1A USB adapter (I measured it with multimeter and results are 4.3v-4.9v and 2.5A) connected to the 4 port USB hub. Then I connected those figure lights to the USB hub.
And I having this flickering led issue (LEDs are kind of fluctuating) even though I connect them directly to the USB charger one at the time.
You are driving 6 LEDs with a digital output, which should not be used as a power supply. It can drive maybe one LED but not much more. The maximum current before damaging the output is 40mA.
One solution is to use a transistor controlled by the digital output
OK then I gonna connect the power and ground through the USB mini socket.
So about the resistors, I didn't touch anything on the original LEDs wiring stuff. I mean I just cut the power and ground wires from the battery then I connected them to the Arduino. So they probably used different kind of LEDs from we usually used for Arduinos I guess, but it was working correctly with the double 1.5v AA batteries before. And it did not harmed LEDs for weeks except the flickering problem after with my Arduino and HC-05 extension
For HC-05 connection I used this diagram as a reference:
Does it harms LEDs if I connect LEDs to the 5v pin and connect ground pin of the LEDs to digital pin so that way I can have control over the LEDs? does it makes any sense at all? That's just my hobby so I don't have a strong knowledge, sorry
Ok! I had a similar issue with my lighting I did on an R/C car! Is it possiable for you to get a few
relays? is this a space limited project? 'Cause I recommend using relays since they don't have any flickering!
No it's the same thing, same limitations, you cannot sink or source more than 40 mA absolute max (15-20 mA recommended max) from a digital pin, they are made for signalling, not driving
Yeah, you was so right about that, I have tested it.
I gave the power to Arduino from the USB mini cable which is connected to the USB hub then the USB charger.
Yep, fluctuations gone and LEDs are even got brighter.
And that's my last question it's about resistors. These LEDs seems different to me from the LEDs I used with Arduino. So how do I know how much ohm resistor I need?
That will depend on how many LEDs you propose to put in parallel - if you still want to drive them directly from an Arduino pin.
If you are just using the LED string, a single 100 Ohm resistor between the Arduino pin and the LED string will be appropriate. The LEDs may be somewhat dim, but you will be doing the important thing of protecting the Arduino.