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.
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?
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.
No, as your experience shows. The LED flickering is due to voltage drop in the power supply.
No.
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.
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.
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).