I am trying to use a irlb3034 as a switch to power an airsoft motor and control it with an arduino. I am using a diode between the source and the drain and a 2.2k resistor between the gate and the source. Do you have any idea how I can control the mosfet with the arduino? Many thanks, Thomas

  • \$\begingroup\$ Do you just want to turn the motor on and off, or control its speed? In your prior post you put up a schematic -- it would be helpful if you made a schematic that calls out the Arduino, the battery input, the motor and MOSFET, and has a box (I would label it "magic") that goes between the Arduino output and the gate. \$\endgroup\$
    – TimWescott
    Commented May 11, 2019 at 16:49
  • \$\begingroup\$ I simply want to turn it on and off. It would be helpful if I could also reverse the direction but I don’t think that’s possible with the currently components. Thanks \$\endgroup\$ Commented May 11, 2019 at 17:00
  • \$\begingroup\$ @ElliotAlderson Nope -- that was about whether you could make 12V from 5 with a linear regulator. This is about how to actually make the motor turn. \$\endgroup\$
    – TimWescott
    Commented May 11, 2019 at 17:19
  • \$\begingroup\$ They are duplicates, but the other question is a purely confused one and should be closed as a duplicate of this. Had the original question not received answers it would have been better to edit this text into it than to repost. \$\endgroup\$ Commented May 11, 2019 at 18:04
  • 2
    \$\begingroup\$ If it hadn’t been answered, I probably would have added more information to my answer to make it more similar to this one. It was answered and Tim answered the confusing question I asked as best as was possible and I didn’t think starting a whole new question in the comments and edits of that one was a good idea. Thanks \$\endgroup\$ Commented May 11, 2019 at 18:19

1 Answer 1

  • Really simple -- get an ESC that's compatible with the motor. I don't know if an "airsoft motor" is a DC brushed motor or a DC brushless -- count the leads. If it's got two, then you need an ESC for a brushed motor; if it's got three, then you need an ESC for a brushless motor. All you need then is a servo output from the Arduino, and that's built into their code base.
  • Complicated-er (for your) and less capable: switch the MOSFET gate voltage with a transistor. Note that, as drawn, the signal from the Arduino means "off", so the motor will go on with battery power until the Arduino comes up. You'll need another 2N3904 stage for the thing to be off when there's no Arduino.


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ Thanks for your answer, I want this whole thing as a pcb with an atmega328p-au in it so unfortunatly the esc is not an option. I have lots of experience with RC electronics so know how to use that kind of technology. For the mosfet circuit, will it handle 200 amps and 7.4-14v okay? Thanks \$\endgroup\$ Commented May 11, 2019 at 18:03
  • \$\begingroup\$ You'll need to work on the 200A part. Expect smoke until you get it figured out. 200A it 7-14V is not the most economical way to handle 1400-2800W -- are you sure you want to use such a low voltage? \$\endgroup\$
    – TimWescott
    Commented May 11, 2019 at 18:24
  • \$\begingroup\$ Unfortunately the motor is capped at 14v and motors for this are very specialist :/. I’ll have a look round for mosfet that will do the trick. I don’t entirely know how this schematic works so I might need to send a few mosfet options and get the thumbs up/down if that’s alright with you \$\endgroup\$ Commented May 11, 2019 at 18:39
  • \$\begingroup\$ This is a dangerous way to drive a propeller (if that's what it is). If you reset the ATMega328 or during power on the motor will turn until the software initializes. In addition the IRF530 is only capable of 10-15A so not appropriate for the application. \$\endgroup\$ Commented May 11, 2019 at 18:54
  • \$\begingroup\$ Maybe something like the uk.farnell.com/infineon/irl3713pbf/mosfet-n-30v-200a-to-220/dp/… maybe? Also, would it be possible to AnalogWrite instead to stop the problem of the digital pins being set to input by default? Thanks EDIT: Also, for the high current could I use a 5KP18A 5kw diode? Thanks – Vosem Media 8 mins ago \$\endgroup\$ Commented May 11, 2019 at 19:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.