Driving motors with atmega

Thread Starter

Clowo

Joined Nov 24, 2022
1
asdasdsad.JPG

Is this circuit okay to drive dc motors with atmega? While sending to one signal input other one will be grounded from microcontroller. If not okay what additions or substractions are needed to create ideal h-bridge for dc motors to drive with atmega?
 

DickCappels

Joined Aug 21, 2008
9,509
Are you sure you are going to have enough gate drive with only a 7.5 volt power supply, driving the gates through emitter followers?

Can you tell us what the stall current and running current of the motors will be?
 

drjohsmith

Joined Dec 13, 2021
541
View attachment 281349

Is this circuit okay to drive dc motors with atmega? While sending to one signal input other one will be grounded from microcontroller. If not okay what additions or substractions are needed to create ideal h-bridge for dc motors to drive with atmega?
If it's an Arduino , Habe you considered using a h bridge hat for the job.
Has all the bits you need , and in my experience is much cheaper than i could make.
 

shell.albert

Joined Jul 23, 2014
14
For your uploaded circuit, I think it can work well with a little wired.
The two low sides of NMOS , Q3 and Q4 are okay.
But two high side of PMOS, Q2 and Q1, you boost current with a NPN transistor.
It means the component of output PWM_Signal has high sink rating current.
When PWM_Signal was pull down to GND, Vg=0V, Vs=7.2V, Vgs<-Vth, PMOS turns ON.
But you also need four diodes to protect four MOSFET from reverse voltage damaging.
 

sarahMCML

Joined May 11, 2019
199
How about this.

Example.jpg

The two NPN transistors could also be MOSFETs. Just don't exceed the MOSFET gate voltages! If using a low supply voltage, they should probably all be Logic level devices. R3 to R6 are just to prevent any chance of oscillation, and you may get away without.
P.S. I left out the 4 protection diodes across the MOSFETs!
 

Irving

Joined Jan 30, 2016
3,188
View attachment 281349

Is this circuit okay to drive dc motors with atmega? While sending to one signal input other one will be grounded from microcontroller. If not okay what additions or substractions are needed to create ideal h-bridge for dc motors to drive with atmega?
Your original circuit isn't going to work well. The problem is, with pwm1 held at 0 and Q1 on, pwm2 should only turn on M3, but as you turn M3 off- slowly, M2 turns on at the same rate. So you are getting massive shoot-through - current through M2 is going through M3 to ground - see simulation below You need to control M. You need to actively control all 4 devices, or ensure sufficient gate-voltage management to ensure that top and bottom devices on one side are never on together.

1669414184418.png
 

Reloadron

Joined Jan 15, 2015
7,075
You can roll your own from any of several online schematics or simply just buy an off the shelf H Bridge motor driver. When rolling your own just be sure your chosen design can handle the motor load to include start current. Also in your code consider if your chosen motor can go from FWD to REV less a delay in your code. A Google of H Bridge modules should bring up plenty of choices. The older L298 is used on many available online but there are newer versions. Most are 5.0 logic compatible suitable for uC boards like Arduino or similar. Most will also take a PWM input.

Ron
 

Irving

Joined Jan 30, 2016
3,188
You can roll your own from any of several online schematics or simply just buy an off the shelf H Bridge motor driver. When rolling your own just be sure your chosen design can handle the motor load to include start current. Also in your code consider if your chosen motor can go from FWD to REV less a delay in your code. A Google of H Bridge modules should bring up plenty of choices. The older L298 is used on many available online but there are newer versions. Most are 5.0 logic compatible suitable for uC boards like Arduino or similar. Most will also take a PWM input.

Ron
I agree. Unless you have a strong desire to build you own (which WONT be cheaper than ready-made) the DIY v off-the-shelf war has long been won by single chip examples. The venerable bipolar L298 is as cheap as chips but limited, its MOSFET equivalent is only marginally better (L6203), but there are a slew of other options such as DRV8874, DRV8876, LMD18200, LMD18245 etc. As most are SMD parts its much easier to buy off-the-shelf boards in various form factors. A lot depends on the motor you are trying to drive and the demand you put on that motor - not knowing that, its hard to suggest further...
 
Last edited:
Top