LED flickering with motor activated by mosfet

Here is my schematic:

Pretty basic setup:

  • a button with pull down resistor
  • a motor enabled by mosfet
  • a led connected to 3V
  • a 3.7V LiPo battery powering a LolinD32 board and the motor mentioned above

I know that ideally I should use 2 different power supply but the goal here is to make the smallest setup possible and the motor is turned on very occasionally and for only a few seconds.

Every time the mosfet turns the motor on, there is a small voltage drop (from 3.3V to 3.15V on the board). I thought that a capacitor would solve this, I tried to put a 100uF capacitor in parallel with the Led+resistor but it does not change anything.

Why? And how can I prevent the flickering?

Just because you want to design something that has a small foot print does it mean you can.

  • Your battery capacity may not be HIGH enough.

  • The wire gauge might not be big enough.

  • You may need a motor designed to run at lower current.

So it has nothing to do with a capacitor?

  • My battery is 2000mAh, it should be enough I think?
  • I am currently using 22AWG which I think is enough as well for my setup?
  • The motor is running at 0.3A, is it too much?

First, thank you for a proper schematic and not a Fritzing mess.
Is the 100uf capacitor on the 3v3 pin to ground?
You might slow the motor turn on by a few microseconds by raising the value of the gate resistor.

Is it just the LED flicker you want to solve, and not the dip in the 33 pin voltage? Try putting the capacitor across the LED.

Have you tried driving the LED from the battery since it just looks like an "on" indicator.

Have you considered driving the LED from a spare GPIO pin?

The wire gauge is probably okay.


Confirm the battery is fully charged ?

Is this an old battery ?

Confirm the battery voltage once the motor is running ?

i.e. does it go to 3.15v and stay there or does it go back to 3.3v while the motor continues to run.


Try this.

Feed the controller Vdd thru a Schottky diode.

Place a 470uF capacitor from the diodes cathode to GND.

The battery is fully charged and brand new.

When the motor is running, the battery goes from 3.8V to 3.65V (this is powering the motor and board).
The board has a volage regulator, when the motor is running, it goes from 3.3V to 3,15V (this is powering the led).

The voltage stays there (at 3.65V and 3.15V) until the motor stops, then everything goes back to normal.

Okay I'll try what you suggested in the next few days, will keep you posted, thanks.

  1. No, as your experience shows. The LED flickering is due to voltage drop in the power supply.
  2. No.
  3. The motor start/stall current is probably 10 times that, or 2-3 Amperes. It will draw that current every time it starts moving.

Avoid using breadboards for motors and servos. Breadboards are for low power logic circuits, and the tracks will burn with currents of over a few hundred mA.

What voltage regulator ? :thinking:

If it is linear type, 3.15v in will not give you 3.3v out.

Implies the battery cannot supply the load current.

What is the resistance of the motor ?

Hi,

question for MOSFET experts: IRLZ44

Is this mosfet that OP is using for logical level?

The datasheet says:
https://www.mouser.com/catalog/specsheets/international%20rectifier_irlz44n.pdf

VGS Gate-to-Source Voltage ±16V

Yes

TKs @LarryD

The LolinD32 uses a ME6211.
I'm not saying 3.15V will give me 3.3V out, let me clarify.
When motor is NOT running, I have a battery that outputs 3.8V to the voltage regulator, this gives me 3.3V out on the board.
When the motor is running, the battery voltage drops to 3.65V provided to the voltage regulator, this gives me 3.15V out on the board.
Is it clearer?

I tested the resistance of the motor: varying between 50 and 100ohm. Seemed quite high, so I tried another one that I have and it gave me 1.8 ohm very stable.
I'm guessing, this motor that I'm using is not good anymore.

Interesting, I didn't know about start/stall current, I calculated it and it's about 2A.

The end goal here is to use a perf board, so even for testing/developing, breadboard are not a good option with motors?

And so the solution here, would be to use a battery >2000mAh?

On what basis? If the winding resistance is 1 Ohm and you apply 3.8V, the starting current is 3.8A. It is as simple as that.

so even for testing/developing, breadboard are not a good option with motors

Correct.

Sorry I edited my answer, I meant 1.8 Ohm, so it's 3.8/1.8=2.1A

So should I look for another battery and if so, how do I choose?

Battery maximum discharge current ratings are given in units of "C", where C is the battery capacity (dropping the "h" or hours term).

Example: "1 C" battery with 2000 mAh capacity can be discharged at 2000 mA (2 A) maximum. Batteries for RC vehicles can have 10C ratings or higher.

The fact that the battery voltage drops significantly when the motor runs suggests that the battery has a low C rating, or the wiring is inadequate.

Thanks, these technical terms allowed me to do some more research and understand. I highly recommend beginners like me to read this blog post on batteries:

I checked the battery datasheet that I use and it has a max discharge of 4A, so the bottleneck here is likely the cable/breadboard.

I will try on a perf board, how should I choose the gauge of the cables I'm going to use? I googled "gauge amp chart" but I get a lot charts with very Amperage or high voltage while my setup is only for 3 amps max and 3.8V.

For motor and battery wiring, you should use the lowest gauge stranded wire that is easy to work with, and solder all connections or use screw terminals (often provided on motor drivers).

Pololu, supplier of robotics parts, has lots of good advice. See for example Pololu - 4.1. Connecting Power and a Motor

Check out other robotics suppliers, too, like ServoCity, for tutorials.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.