Electronic – Arduino battery power stay on for button – Not quite working

arduinobatteriesmosfet

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.

  1. Arduino Nano
  2. MP1584EN DC-DC 3A power Step-Down Amazon link
  3. N-Channel MOSFET Digi-Key link
  4. 10k OHM Resistor
  5. Pushbutton Image Link
  6. 330 OHM Resistor
  7. 4 18650 Batteries producing about 14v

In the following diagram the +14v and GND on the left side represent the battery connections.
Wiring diagram
Circuit on the breadboard

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.

Best Answer

Your DC-DC converter is not isolated, and it places the whole supply at its output when its negative input terminal is floating.

This means that the Arduino has the full input supply from its Vdd and Gnd terminals to the 330ohm resistor on its output and from there it should turn on the mosfet.

If you have Gnd otherwise connected to the Arduino, then you have 19V across it.

You should use a high-side switch, or a converter with an enable/shutdown pin instead.