1
\$\begingroup\$

I am trying to make a Nano Quadcopter using my Atmega328 microcontroller powered by a 3.7v 600mAh Lipo battery. I am using very Small Brushed Motors. If I directly connect motors to PWM pin of Atmega328, it will fry up my Atmega.

My question is How can I connect motors to PWM pin of Atmega328 without frying up my Atmega?

I saw many similar articles but none could give me the solution.

The motors I am using are: http://www.amazon.com/Hubsan-Mini-Quadcopter-Spare-Motor/dp/B00B3RO0GE

\$\endgroup\$
1
  • \$\begingroup\$ The control side of this will not be a simple project. On the driver side, for the motors from simple single-cell quads, you typically want a good logic-level, low-loss MOSFET in a sot-23 surface mount package, the DMN2041L being a common enthusiast "upgrade" and so a potential place to start for motors than need no more than an amp or two. Bipolar transistors will not work \$\endgroup\$ Apr 14, 2016 at 16:04

2 Answers 2

0
\$\begingroup\$

Sounds like this might be a first experience with motors for you? Here are a couple pointers to get you started. You're going to need use your micro to switch a higher voltage supply. One problem that I'm seeing with your current battery is the relatively low voltage. I'm not privy to the specifics of your micro, but typically they run off of a 3.3V or similar supply voltage. I would guess that after the voltage drop in your switch, you won't have a lot of oomph left to run your four motors.

What needs to happen is you need to control a switch with your PWM signal. The reason that you do this is because your chip can only source(put out) a relatively small amount of current. The effect that the PWM'd switch has is to leverage the capability of the micro to turn a switch off an on rapidly. At one extreme, the switch could be off, on the other, fully on. By changing the duty cycle of the PWM (time it is high vs low), you can effectively chop up that voltage so the motor sees the amount of voltage that you choose from 0V up to the supply voltage, and anywhere in between(ideally).

The problem with your low voltage is that these switches are never ideal. We use transistors as switches, and supply a current (for BJT devices) or a voltage (for FET devices) to turn them on or off, but they have a voltage drop associated with them. Take a look at this very simple circtuit: enter image description here

I'm just using this as an example. I'm not recommending you just copy component numbers or values for your circuit. The output of the micro is hooked up to the base of the transistor through a current limiting resistor. That 10V up top will drop through the load, and then drop through the transistor. Effectively, the load will see a lower potential than the 10V because of the non-idealities in the 'switch'. With 3.3V, you're not giving yourself a lot of wiggle room. Here's how I'd proceed if I were you. Research anything that I've written that doesn't make total sense to you. Think about the resistance in the coil windings of your motors, the voltage drop across the transistor you might use, and how much current (proportional to torque) you're gonna need and how much current your motors can handle. This is a big boy project, and implementing the control algorithm for that quadcopter is no small feat. Start small, work your way to your goal. You're not gonna get there successfully without some hard work and research!

PS: Another typical way to control motors is with an H-Bridge circuit. This would allow you to drive current in two directions and allow you to make your motor go in both directions depending on which side of the circuit you drive. Since you're planning a copter, you probably don't need to go both ways, but it could be a valuable stepping stone for you. Note the diode across the load in the circuit. This is pretty crucial for many applications as the changing current in the motor can cause some dangerous voltage spikes.

Best of luck.

\$\endgroup\$
5
  • \$\begingroup\$ Unfortunately, this answer makes wrong guesses and is written uninformed by how quadcopters actually work. You simply cannot use a bipolar junction transistor. These devices run directly off the single lipo cell the poster mentioned, and require good FETs with low on resistance at 3v gate drive. \$\endgroup\$ Apr 14, 2016 at 12:13
  • \$\begingroup\$ It was an example circuit. There are books written about this stuff, the idea was to get him started. \$\endgroup\$
    – RYS
    Apr 14, 2016 at 14:55
  • \$\begingroup\$ The problem is starting someone who doesn't know any better in a direction that will not work. Last month there were suddenly two questions here about similarly unworkable bipolar designs. There are plenty of places online to find information about how working ones actually work, so inaccurate posts are not helpful. \$\endgroup\$ Apr 14, 2016 at 15:04
  • \$\begingroup\$ This guys was not even familiar with the idea of switching, as evidenced by his question. This example was to illustrate that basic concept. I state specifically that this example was not to be copied, and also mention the problem with his low voltage. Are you just expecting me to give this guy an engineering education in a single answer on stack exchange? \$\endgroup\$
    – RYS
    Apr 14, 2016 at 15:16
  • \$\begingroup\$ There is no problem with the low voltage - actual quadcopters work with it fine. The point is that instead of misleadingly introducing concepts with types of components that could not possibly work, a good answer would have used those that could, or else less left the switching devices purely conceptual without mentioning grossly unsuited parts. Your post has the potential to waste a great deal of a readers time and energy - real people are building real, fatally flawed projects using this type of bad advice. \$\endgroup\$ Apr 14, 2016 at 15:24
1
\$\begingroup\$

You can run dc motor with microcontroller using mosfet transistor, but if you want to run small dc motor for quadcopter you need very lightweight mosfet. I am using D10N05 SMD Mosfet Transistor to run mini motor, it's a lightweight SMD transistor. I am sharing the useful link about this topic. In this article he is showing how you can run mini quadcopter motor with Arduino pro mini.

http://www.circuitmagic.com/arduino/run-small-brushed-motor-for-mini-quadcopter/

\$\endgroup\$
1
  • \$\begingroup\$ Indeed, the drive circuit of actual single-cell micro quadcopters actually is that simple - a MOSFET driven by a ~3v MCU output pin and a resistor from gate to ground. However the threshold voltage of the D10N05 is a little high for a 3v drive, implying either reduced performance or needing a boost converter to operate the MCU on 5v. Actual products typically operating the MCU around 3v using a good low dropout regulator from the lipo, and various cheap SMD FET's. A common aftermarket "upgrade" choice for them is the DMN2041L which should easily handle the motors in question. \$\endgroup\$ Apr 14, 2016 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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