If it's an Arduino , Habe you considered using a h bridge hat for the job.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?
Just so the TS isn’t confused, Arduinos don’t have hats. In the Arduino environment, stacking peripherals are called shields.If it’s an Arduino. Habe you considered a… hat for the job
Duh.Just so the TS isn’t confused, Arduinos don’t have hats. In the Arduino environment, stacking peripherals are called shields.
if you search for Arduino motor shield , you’ll find what I mean (provided link is just an example)
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.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?
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...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
by Aaron Carman
by Jake Hertz
by Duane Benson
by Duane Benson