I have hacked an old broken RC helicopter into a showcase helicopter that would just spin up and down its blades.
I have a problem with the hardware part. i have it connected exactly as shown in the attached picture.
The problem is that when the motor starts spinning up, the arduino will resrt.
Only if i power the motor from a separate power source (with common ground) then it will work correctly.
I have tried many different mosfets like the IRL520, FQPF13n06L, FDPG030BL and none worked while i power the motor from the onboard 5V or 3.3V output.!
Thanks !
I imagine the motor, like almost all motors, needs more current than the Arduino can provide. Arduinos are not intended to be used as power supplies. How much you can get will depend on how the Arduino is powered, something your diagram doesn't show.
Both the arduino power input and the power to the motor come from external 5V supply that can very well handle alot more current. the arduino and the motor supply are in parallel. The motor has a decoupling capacitor to suppress noise.
I am updating the schematic now.
Thanks
I can actually hear the motor tring to spin up when duty cycle is rising from 0% but the mcu resets before the motor can begin turning. I confirm with an Oscope that the pwm signal looks good.
The motors start current (at 5V) is about 2A while its normal working current (at 5V) is 1A. I have tried many different mosfets like the IRL520, FQPF13n06L, FDPG030BL and none worked.
If i connect the motor directly to 5V it just turns like its supposed to.
It works when i use a wall wart 5V psu for the uno and a 18650 lithium battery for the motor. It also works when i use two separate 18650 litlium batteries for the uno and motor. The uno norlammy needs 4.5Volts or more but it can work with 4.2 as well.
I will take pictures and post them later.
Okay, case solved. Scoping the motor revealed the presense of hf noise. Replacing the decoupling capacitor solved the problem. Now the motor steps up and down without a problem.
Thank you all for both your time and willingness to help.