I expect the components in my project to draw about 1.5amps when fully connected, although this is assuming that all LEDs and segments are on (which won't be the case).
I am using an Arduino nano, which is driving:
2 max7219's with 8x 7segment displays each
19x LEDs driven by 3x74HC595 shift registers
Several momentary push buttons
I wish to power the whole project from a battery, including the Arduino. Everything I find online so far suggests to use an external power supply to provide sufficient current, which is fine and i understand the pins on the arduino will be exceeded otherwise, but I can't find anything that shows me how to wire this! It might be an extremely basic or simple question, but I don't want to be frying my components.
My thoughts are:
Attach a battery (with min 6.5v) to input of a mini360 buck converter
This is variable so set output to 5v
connect all VCC pins of components to positive output from buck converter
all ground pins from components and the GND of arduino to negative from buck converter
push buttons all wired straight to 5v output, GND and analog pins on arduino
I then need to power the arduino. Do I also then connect the 5v pin to the output pin on the buck converter? I thought 5v on the arduino board was an output pin, but something I've just seen on youtube suggests otherwise, but it's unregulated unlike the VIN or barrel jack (which would require 7-12v).
Perfectly OK, make sure the battery can supply enough current, which I suggest will be at least 1.5A
That's OK too.
That requires more explanation, buttons are generally wired between 0V and a digital input (most of the inputs labelled 'analogue' on most Arduinos are also digital inputs). Here is my take on connecting buttons: Buttons and other electro-mechanical inputs (introduction)
There are other tutorials here with other people's ideas, but connecting buttons between 0V and an input is standard practice, don't forget to enable the internal pull up resistors.
It can be used to power the board too, as in as an input from a 5V power supply. Be aware that you should not put 5V on the 5V pin while the board is connected to your computer via the USB cable. As long as the 5V on the pin is within about 0.5V of the 5V PSU in your computer you will get away with having both connected, but one day...
You don't have to spend long reading the various topics on this forum to realise that Vin and the barrel jack are close to useless. Actually they are worse than useless because they fool beginners into thinking they are useful places to connect power to.
Thanks for the reply, I’ll look at sourcing a battery case and buck converter.
Regarding the buttons, I currently have 8 connected to a single analog pin and using a resistor ladder will read the input to figure out which is pressed, I might end up with 16 of them across 2 pins in the end though. I also have some 74hc165n shift registers that I could alternatively use to the digital pins for them, which might be better suited.
I got an 18650 shield, which I got wired up and powered everything from there. But the LED displays are very dim and don't behave as expected, after a couple of button presses they reset or display odd values. I assume that this is a current problem?
I would expect a single 18650 to be able to supply enough current, the one I am using is rated for 24amps. The module is supposed to have a 1.5amp supply steady, with 3amp max at burst.
I have some dual 18650 battery holders that I will run through a buck converter to see if that makes a difference, but my confidence has been shot in the solution so far!
ok, so I have my project working! The 18650 shield which has an advertised 1.5amp rating was very dim, and next to useless, I don't think it was providing the amperage advertised, or at the very least that figure is for spike draws and it should be running much less than that as a constant.
I wired in my mini360 buck converter powered by a 2 cell 18650 battery holder, and everything is exactly as it should be, no random characters on the LED displays anymore! Once setup, it's unbelievably simple, but finding information on how to do it in the first instance is no easy feat.