Driving DC Motors w...
 
Notifications
Clear all

Driving DC Motors with Microcontrollers

35 Posts
6 Users
10 Reactions
5,300 Views
(@davee)
Member
Joined: 4 years ago
Posts: 1871
 

Hi Ron @zander,

   I quite understand, as for 95%-99% of projects, you would obviously want maximum battery life.

   I maybe wrong, but I think this Halloween job maybe the exception that breaks, or at least bends, the rule.

I just hope Rob understands the risks and consequences, which we have both tried to explain.

Best wishes, Dave

 


   
ReplyQuote
(@compas)
Member
Joined: 5 months ago
Posts: 2
 

Can anyone give me the wiring diagram and an example code, of the DBH-12 Dual H-Bridge motor controller for rasberry pi 3+

Thank you in advance


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7728
 

@compas Start with Bill's article and video at ARTICLE and VIDEO also check out the following VIDEO and ARTICLE. That will get you started. Using a Pi is a minor difference you should be able to handle.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
(@davee)
Member
Joined: 4 years ago
Posts: 1871
 

Hi @compas,

  My simple answer, erring on the cautious side, is don't use a DBH-12 with a Raspberry Pi  ... even though, it might work!

---------

  Please note, I have never seen one of these driver boards, and this reply is based solely on what I can find on the web. If I had bought one, then I could have done some measurements and circuit tracing, which might have enabled me to provide a more optimistic, as well as informative answer.

  As Bill (@dronebot-workshop) notes, in his blog at //dronebotworkshop.com/dc-motor-drivers/

This module has a minimal amount of documentation, some of which is inaccurate. One of the most serious inaccuracies is that a few diagrams show the V+ pin as a logic voltage input. This is false, it is a motor voltage output. Confusing the two can cost you a microcontroller!

So far as I can see, 'minimal amount of documentation' is being used as a polite synonym for 'no specification and no documentation'.

My concern is that Bill's article uses a 5V logic Arduino ... All Raspberry Pi s are 3.3V logic. Connecting them to an undocumented and unspecified 5V circuit poses two risks:

  • 5v from the DBH-12 may damage the R-Pi
  • The 3.3V logic levels may be insufficient to reliably drive the input of the DBH-12

-------------

The only 'document' I found, that might be about the driver board, is a minimal block diagram suggesting LM398 comparators are used for the input circuit. Unfortunately, comparators are essentially analogue components, which need external resistors (and possibly other circuitry), to define their operation, so I don't know what voltages they may expose the R-Pi logic to

Equally, the reduced voltage drive of 3.3V may not be high enough, to trigger the DBH-12.

Logic voltage levels are chosen with substantial margins, so that small changes due power supply, temperature, operating frequency, etc., do not adversely affect their operation. Mismatching 3.3V and 5V circuits can remove the margins, leaving a circuit with 'flaky' operation.

---------------

Certainly, some boards with minimal documentation, that are widely sold are 5V logic only. Whether this is one of them, I can't tell.

----------------

A particularly frustrating problem, when someone mixes 5V and 3.3V logic, is that it might work, and not immediately show any adverse symptoms, but that does not indicate, whether or not, the 3.3V device has been damaged, and may fail completely sometime in the future, or it may show intermittent faults. So treat any comments of the type 'I connected my board up, and it is working fine', with as much caution as wish.

I have seen a thread on another forum discussing R-Pi driving this board, and much of it was wrong.

I looked for reviews on an Amazon advert for the product. There were only 4 written reviews, 3 of which reported success, but did not say what controller they had connected it to. The 4th used an ESP32, another 3.3V controller, who said "Had some trouble getting 3.3v PWM from my ESP32 to register on the driver but I fixed it by using the MCPWM library pre-built into the ESP32 and setting the PWM frequency to 24000Hz.", which suggests that something may have been mismatched.

-----------------

So, if you don't mind taking the risks, then Bill's article that Ron (@zander) suggested, and I mentioned above, shows the general principle.

If you could discover the true specification or input circuit of the DBH-12, then it might be possible to suggest a more positive answer, maybe even suggesting a conversion interface, but as I do not have a DBH-12 to examine, and I couldn't find any documentation, then sorry, I can't help you.

Best wishes, Dave


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7728
 

@compas It might help if you explained your project.

Although you would have found out by watching Bill's videos I mentioned, Dave did the work for you in explaining why the DBH-12 is probably not the best choice for you.

I favour the TB6612FNG if it is a good power match for the motor, otherwise try Pololu and look for a mosfet type as they are more efficient and cooler like the TB6612FNG.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Page 3 / 3