Author Topic: Push button power circuit for Arduino... trying to modify it for 12V input  (Read 10018 times)

0 Members and 1 Guest are viewing this topic.

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 11394
Re: Push button power circuit for Arduino... trying to modify it for 12V input
« Reply #50 on: November 21, 2021, 09:31:50 am »
@CBF: For the record, what circuit did you end up with that was successful?
 

Offline CBF

  • Contributor
  • Posts: 6
  • Country: au
Re: Push button power circuit for Arduino... trying to modify it for 12V input
« Reply #51 on: November 22, 2021, 05:09:57 am »
@CBF: For the record, what circuit did you end up with that was successful?

Yes for the record! I took out the delay element and went with a circuit I found similiar to this with the mosfets I had handy and ditched the timing component for a hold down to turn on. My arduino boots up almost instantly. I added a pull-down resistor on the sense:
 
The following users thanked this post: Ian.M

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 11394
Re: Push button power circuit for Arduino... trying to modify it for 12V input
« Reply #52 on: November 22, 2021, 07:41:57 am »
Yes, with a 6K8 pulldown on the SENSE input to keep the max. signal just under 5V, that looks reasonable.   The only flies in the ointment are that the switched power isn't debounced so is likely to glitch during power up, and the switch has to handle the entire load current till the MCU turns the MOSFET on.  An Arduino has enough onboard decoupling to ride through the power glitches, and if it doesn't have other significant loads on Vin or +5V is unlikely to draw enough current to be problematic for most small button switches, but it may not work so well for other applications.
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 1373
  • Country: us
Re: Push button power circuit for Arduino... trying to modify it for 12V input
« Reply #53 on: November 22, 2021, 03:55:55 pm »
I'd still like to understand why the first circuit in the video doesn't work for CBF.  Below is a bit cleaner schematic but essentially the same except the capacitor is missing.  The circuit worked in Chris' video and in the video the circuit came from, so I wonder what the problem is with CBF's circuit.  Did Chris wait until the button was released before taking the output pin low?  It doesn't look like that in the video.  Anyway, is there any way to get to the bottom of this?

 

Offline CBF

  • Contributor
  • Posts: 6
  • Country: au
Re: Push button power circuit for Arduino... trying to modify it for 12V input
« Reply #54 on: November 22, 2021, 11:54:40 pm »
I'd still like to understand why the first circuit in the video doesn't work for CBF.  Below is a bit cleaner schematic but essentially the same except the capacitor is missing.  The circuit worked in Chris' video and in the video the circuit came from, so I wonder what the problem is with CBF's circuit.  Did Chris wait until the button was released before taking the output pin low?  It doesn't look like that in the video.  Anyway, is there any way to get to the bottom of this?

Yes I would too. When I get some time I will play around with it a bit more, but first I have to finish this project.
« Last Edit: November 23, 2021, 12:08:22 am by CBF »
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 1373
  • Country: us
Re: Push button power circuit for Arduino... trying to modify it for 12V input
« Reply #55 on: November 23, 2021, 04:02:34 pm »
Could it be switch bounce?  I wouldn't think there would be much bounce when releasing the button.  Well if I have time over the weekend, I'll set up the circuit with a Nano and see what happens.

It seems the safest thing might be to wait until the button is released before turning off the NPN. It really shouldn't make any difference as long as you bring the output pin low and keep it low forever.  Then everything should shut down when the button is released.  But waiting for button release, if it still misbehaves, that would indentify the Nano as the problem - output pin glitching high as it powers down.
 

Offline CBF

  • Contributor
  • Posts: 6
  • Country: au
Re: Push button power circuit for Arduino... trying to modify it for 12V input
« Reply #56 on: November 26, 2021, 06:18:59 pm »
Yes, with a 6K8 pulldown on the SENSE input to keep the max. signal just under 5V, that looks reasonable.   The only flies in the ointment are that the switched power isn't debounced so is likely to glitch during power up, and the switch has to handle the entire load current till the MCU turns the MOSFET on.  An Arduino has enough onboard decoupling to ride through the power glitches, and if it doesn't have other significant loads on Vin or +5V is unlikely to draw enough current to be problematic for most small button switches, but it may not work so well for other applications.

I can't believe I am still having problems with such a simple circuit. I have the arduino connected to a MOSFET controlled motor driver than can spike up to 1.5A. The circuit is unable to deliver this. Could this be the Rds of the MOSFET? The voltage seems to drop and the motors stall. When I remove the above circuit and power directly from the powerbank there are no problems.

I need a solution quickly for this project and I'm struggling to get anywhere. I'm sure there is lots wrong thats why I'm here:
« Last Edit: November 26, 2021, 09:30:24 pm by CBF »
 

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 1373
  • Country: us
Re: Push button power circuit for Arduino... trying to modify it for 12V input
« Reply #57 on: November 27, 2021, 12:11:40 am »
I couldn't find an IRZ44N.  If it's really IRFZ44N, then it's not a logic level mosfet, and if the source is at 5V, then the gate threshold voltage is way too high to turn on the mosfet fully when the GPIO controlling it goes to ground.

 
The following users thanked this post: Ian.M

Offline CBF

  • Contributor
  • Posts: 6
  • Country: au
Re: Push button power circuit for Arduino... trying to modify it for 12V input
« Reply #58 on: November 27, 2021, 04:04:36 am »
I couldn't find an IRZ44N.  If it's really IRFZ44N, then it's not a logic level mosfet, and if the source is at 5V, then the gate threshold voltage is way too high to turn on the mosfet fully when the GPIO controlling it goes to ground.

Thanks so much, I had it lying around and remembered it being logic level, doh! I should have checked the datasheet - this explains my probblems with my first circuit. Will update  :)
 

Offline zbyhu

  • Newbie
  • Posts: 1
  • Country: pl
Re: Push button power circuit for Arduino... trying to modify it for 12V input
« Reply #59 on: December 14, 2021, 03:25:46 pm »
Hi All,
I have a question to Ian.M's circuiit.

I used DMG1013UW as M1 and BSS214 as M2.
Vbatt is around 3.8V.
What I observe is that M2 is turned on right after power is connected.
D1 and D2 are SKM14 from DIOTEC.

Double checked the MOSFETs pinout and it is correct.

Why circuit behaves like this?


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf