Arduino works on PC, mains, but not on battery pack?

I have a Pro Trinket running a sketch that controls ten addressable LEDs using three potentiometers. The potentiometers output to analog pins A0-A2 and that input is used to change the Red Green and Blue components of the LEDs.

If I power it from my PC using the USB port on the Trinket, or if I power it from a mains adapter also through the trinket, it works fine all three potentiometers hae the expected effect on the LEDs.

But if I use one of the phone charger type battery packs, it just flashes the green power light about twice a second and goes no further.

I have confirmed the battery pack is charged (it runs other trinkets just fine). If instead of using the battery pack in the USB port on the trinket, I connect it to the BAT pin on the Trinket, it also works fine.

My normal assumption is that I’ve done something wrong…can anyone tell me what please?

More info...I have a 1000 MicroFarad capacitor connected between the +5v and GN just as it connects to the strip of LEDs.

When I connect this, I get the above problem...but if I disconnect it, all seems fine - except when all potentiometers are set to zero, at which point the LEDs "flicker".

It would seem I'm supplying voltage from somewhere when I shouldn't be! I'll get my multimeter on it, but if someone can advise a common place to look?

Have attached Fritzing file…it looks as I expected it to on the breadboard…but the schematic and PCB look like they have connections I didn’t intend. Hope someone can advise.

What I need is simply three potentiometers that send their value to pins A0 through A2, and four buttons that will pull pins 9 through 13 to “HIGH” when pressed…the values of the potentiometers and the buttons will be used in the sketch and affect the output of pin 8.

Thanks!

Lightbox.zip (25.4 KB)

GreyArea:
I have confirmed the battery pack is charged (it runs other trinkets just fine).

More info...I have a 1000 MicroFarad capacitor connected between the +5v and GN just as it connects to the strip of LEDs.

So...... if the other trinkets worked just fine, then what were you trying to say? Were you trying to say that ---- under the same conditions (with capacitor and LEDs and using that particular battery pack etc) ---- the other trinkets (under the same arrangement) worked just fine?

For the description of your wiring arrangement, the recommendation is to show a photo of how everything is connected (possibly with some labels or text added graphically in a photo editor), and a screen-shot of that 'fritzing' layout --- screenshot....not a file that requires the special software to open.

Indeed as asked before, other projects exactly the same?

Some powerbanks want quite a load on them otherwise they shut them self off to save energy. If you have projected with powerhungry components they might work, I have had trouble with low powerconsumption projects on powerbanks.

What powerbank are you using?

Sorry, same file attached as an image.

The other projects are not identical, but similar and with larger power consumption…this one is only running the ten LEDs - I have others with the same powerpack that will easily run 40 or so of the same LED for an hour or two.

I would have sent a photo too…but it was quite tightly packed and I don’t think would have helped…and since I couldn’t get it to work reliably (that was the strange thing…sometimes it worked, sometimes it didn’t, tho mostly it didn’t) so I’ve dismantled it completely and will try again tomorrow.

I think I’d cross-connected something somehow, or not properly earthed it…I’ve seen flickering like that before when I’ve not given everything a common ground connection. But, I am far from knowledgeable in this area so may very well be mistaken.

Thank you for taking the time to reply.

ALso - sorry realise image in that file is using a Mega...I can't find a fritzing file for the Pro Trinket...but pin numbers are connected as per my setup.

I’ve rebuilt the circuit on my breadboard and the problem persists. It’s obviously a design issue rather than as I thought me soldering something wrong.

I realise the capacitor is not present in this arrangement…if I add that it is causes the fail to start problem - I thought the flickering might be more informative?

GreyArea:
I've rebuilt the circuit on my breadboard and the problem persists. It's obviously a design issue rather than as I thought me soldering something wrong.

I realise the capacitor is not present in this arrangement...if I add that it is causes the fail to start problem - I thought the flickering might be more informative?

Maybe you can get a multimeter and put it in continuity mode to see if there might be a short circuit condition between the terminals of the capacitor. I also assume that you have the capacitor connected with the correct polarity used ---- as I assume it is an electrolytic capacitor.

Make sure you provide an unambiguous description of your situation. For example --- you mention flickering issue. You need to say whether this issue occurs with that battery pack only, or whether it occurs for any voltage supply that you use.

Also....in your diagram ..... you might need to see why the wires with red arrow are wired together like that.

Southpark:
Maybe you can get a multimeter and put it in continuity mode to see if there might be a short circuit condition between the terminals of the capacitor. I also assume that you have the capacitor connected with the correct polarity used ---- as I assume it is an electrolytic capacitor.

Yes, and I'm sure it was the right way round.

Southpark:
Make sure you provide an unambiguous description of your situation. For example --- you mention flickering issue. You need to say whether this issue occurs with that battery pack only, or whether it occurs for any voltage supply that you use.

It happens with any "portable" supply...anything "cabled" (wall socket, desktop power supply or PC cable) doesn't show the flickering

Southpark:
Also....in your diagram ..... you might need to see why the wires with red arrow are wired together like that.

Ha! Well spotted - because I am an idiot! The black wire going to the LED should be connected to Ground rail, not live of course...but it's only on the diagram I made this mistake. _I have a neurological condition that makes controlling the mouse difficult sometimes...you can see it's just a bit of extra wire I accidentally dragged onto the live rail)

I did some reading/searching and I think it's just "noise" from the pots - the reason the wired power supplies don't show it is because the analog reference is more stable than on the portable ones. Does that sound reasonable?

GreyArea:
I did some reading/searching and I think it's just "noise" from the pots - the reason the wired power supplies don't show it is because the analog reference is more stable than on the portable ones. Does that sound reasonable?

It might only sound reasonable if there is an explanation of how such noise leads to the flickering. If the flickering occurs when the 'wiper' (the sliding terminal) is moved to the 'ground side' region, then one would expect roughly zero-voltage for the wiper terminal. In this case, one wouldn't expect flickering activity for hypothetically 'zero-level values' for analogRead outputs.

Also, there is another area that might have been overlooked. The program code that you're using.

You could show the source code.

Also, for testing ----- you could also do something like send the values obtained from the analogRead to the serial monitor. In this way, you can monitor the analogRead values. If everything is well-behaved in terms of the analogRead values, then at least you know that the issue isn't due to some unwanted values.

Also....... in your fritzing diagram ---- what is that green board? Should give details of it. Might need to explain the setup of that board. What is that board used for?

I've seen that effect on early LED flashlights with near dead batteries, the batt volts fall below the LED Vf, it stops conducting, light off, with no current flow, batt revives a little and voltage sneaks above Vf, light on for a few milliSeconds, rinse and repeat.
You might prevent that by setting PWM value to zero if pot value is below (say) 10.

Thank you helpful people!

I see the flickering at zero levels, yes...but that may just be that at higher levels it is masked by the actual input (hard to see a dimly flickering red against a very bright green...)

You want to see my code...sigh...the trouble with that is that it is badly written and has many (many. MANY) errors in it that I am trying to track down...and it's loooooooong...

It does what I need though (or will do once I've punched it around a bit)...but...well yes I'll post it up and you can all scratch your heads and go "Oh My dear Lord, what a noob, why is he doing it like THAT???"

Trinket, unfortunately doesn't have a serial monitor function :frowning: though I have now shunted the same sketch onto my Mega for the same testing reasons. I actually suspect when i get the test setup that it will be variation form the pots caused by unknown source or effect..

The green board...is just a placeholder for i couldnt find an icon for a blown bulb

...And the moral is, do not type when you are falling asleep...the green board is a placeholder for my WS2182B LEDs, as I could not find a specific icon for them...

I think outsider had it right...put all my battery packs on recharge and the flickering seems to have gone.

Thanks all, sorry for the false alarm...

Thanks for reporting back on how this was solved, might help others later on.

GreyArea:
It happens with any "portable" supply...anything "cabled" (wall socket, desktop power supply or PC cable) doesn't show the flickering.

Thanks for reporting that the situation is under control.

Looks like the 'any portable power supply' information you gave was misleading.

Also...... if your battery pack was flat ..... then a good question is.... why do the LEDs flicker when potentiometer is set to zero ...... while your battery pack had no problem with lighting up those LEDs when you dialled up the potentiometer.

One would expect that a flat battery is not going to make the LED array light up real bright for any decent amount of time. And it was even powering the arduino.

Southpark:
Thanks for reporting that the situation is under control.

Looks like the ‘any portable power supply’ information you gave was misleading.

Also… if your battery pack was flat … then a good question is… why do the LEDs flicker when potentiometer is set to zero … while your battery pack had no problem with lighting up those LEDs when you dialled up the potentiometer.

One would expect that a flat battery is not going to make the LED array light up real bright for any decent amount of time. And it was even powering the arduino.

Yes, now I am worried when you phrase it like that. Perhaps my recharging of the powerpack simply coincided with my inept poking, prodding and resoldering accidentally locating and correcting the real culprit.

That said…the important thing is it now works…flawlessly. If folks are interested, please see the link below to a video of the (still unfinished physically, but electronically, fully functional) final article. With apologies for my somewhat meandering running commentary.