I have been trying to get a circuit to work that would power an Arduino from a set of 4 18650 batteries. It needs to turn on with a button press, then stay on for 30 seconds, then completely power down.
My plan was to have the pushbutton connect the ground wire of the voltage regulator so it would be a physical switch to turn on power. Then in the logic of the Arduino turn on digital pin 5 right away and keeping it on until its ready to power down. That digital pin would control a mosfet which keep the power on.
I have the following components in my current almost, but not working scheme.
- Arduino Nano
- MP1584EN DC-DC 3A power Step-Down Amazon link
- N-Channel MOSFET Digi-Key link
- 10k OHM Resistor
- Pushbutton Image Link
- 330 OHM Resistor
- 4 18650 Batteries producing about 14v
I am using a 10k ohm resistor connecting the gate to the battery ground in order to pull it low so it does not float. I am using a 330ohm resistor between the gate and the digital pin on the Arduino for protection.
Everything seems fine until I plug in the Arduino to breadboard. That is I use my voltage tester to check that the Arduino VIN and GND pins do measure at 5v. Also if I press the button then connect a wire to the mosfet gate pin to my 5v rail the power does stay on. So it seams if I plug in the Arduino and it sets the digital pin high (5v) on the mosfet it would work.
Instead of working like I had hoped. There is a little smoke from the Arduino and its trashed. Another weird thing is if I have my voltage meter measuring the outputs of the voltage regulator, the output suddenly reads a much higher voltage. I was not sure where that change comes from, maybe its my voltage meter interacting with the voltage regulator in the Arduino. I found if I don't connect the mosfet drain to the battery ground the Arduino seems to work correctly, does not smoke and get fried, and I still get the weird high voltage reading. When the drain is connected the Arduino is instantly fried.
Any help would be greatly appreciated.