• 0
vader92

Connecting a brush dc motor, Pmod HB3 motor shield and Arduino Uno Board.

Question

Hi all,

I just bought a brush dc motor, Pmod HB3 motor shield and want to control it with an Arduino Uno Board.

However, I do not know how to connect all the three components together. Would like to have your help.

And are there any sample codes that I can refer to ?

Thanks.

Regards,

vader92.

Brush  DC motor connection.JPG

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0
7 hours ago, jpeyron said:

Hi @vader92,

Here is a hackster project that uses the uno and the Pmod HB3 along with a motor. It also has code for you to use.

cheers,

Jon

Hi Jon, 

 

Thanks for the reply. However, the dc motor that I am using is not a general one. 

I am using the motor stated below. 

https://store.digilentinc.com/dc-motor-gearbox-1-53-gear-ratio-custom-6v-motor-designed-for-digilent-robot-kits/

Regards,

vader92

 

Share this post


Link to post
Share on other sites
  • 0

Hi @vader92,

The motor you linked to will also work with the code. You will just need use external wires to attach M- on the HB3 to the black wire and attach M+ on the HB3 to the red wire. The additional wires on the motor are for feedback sensors if you are looking to implement some sort of feedback control.

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 0
On 1/27/2018 at 3:07 AM, JColvin said:

Hi @vader92,

The motor you linked to will also work with the code. You will just need use external wires to attach M- on the HB3 to the black wire and attach M+ on the HB3 to the red wire. The additional wires on the motor are for feedback sensors if you are looking to implement some sort of feedback control.

Thanks,
JColvin

Hi @JColvin

Sorry for the late reply and thanks for the suggestion.

 

I actually wanted to create a force feedback system. In other words, when I exert a force to the shaft of the dc motor and let it actuate to a certain angular position,  it will stop.

Do I need to add any more components, or would that be enough ?

Regards,

Chan Yun Hol

Share this post


Link to post
Share on other sites
  • 0
On 1/26/2018 at 2:20 AM, jpeyron said:

Hi @vader92,

Here is a hackster project that uses the uno and the Pmod HB3 along with a motor. It also has code for you to use.

cheers,

Jon

Hi @jpeyron

There is a digital switch module in the circuit that you have shown me. Can I check with you if I can control it without using the digital switch module.

 

Regards,

Chan Yun Hol

Share this post


Link to post
Share on other sites
  • 0

Hi @vader92,

You can control the motor through commands directly from Arduino code. You can also make a state machine to have it rotate base on the state its in. You do not need the switch. You will have to alter the code to work the way you want it. 

cheers,

Jon

Share this post


Link to post
Share on other sites
  • 0

Hi @vader92,

In terms of the force feedback system, a dc motor won't be able to accomplish what you are looking for. The feedback sensors on DC motors are two Hall Effect sensors that provide you information that you can then use to calculate the rpm of the motor; it doesn't provide data about what position the shaft is in. If you are wanting to control how much the shaft rotates from the host board, you will likely want a stepper motor or a servo motor. If you are instead wanting to rotate the shaft externally (manually by hand, etc), I would instead recommend looking at an encoder.

Let me know if you have any questions about this.

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 0
7 hours ago, jpeyron said:

Hi @vader92,

You can control the motor through commands directly from Arduino code. You can also make a state machine to have it rotate base on the state its in. You do not need the switch. You will have to alter the code to work the way you want it. 

cheers,

Jon

Hi @jpeyron,

Can I clarify with you if the state machine you meant is it a hardware or a sofware ?

Regards,

Chan Yun Hol

Share this post


Link to post
Share on other sites
  • 0
6 hours ago, jpeyron said:

Hi @vader92,

Sorry for the confusion, I meant a software state machine. 

thank you,

Jon

Hi @jpeyron,

 

Noted with thanks. Since this is the case, how should I connect the wires on the motor (for the feedback of the motor) between the Brush DC motor and the Pmod HB3 motor shield or the Arduino Board. 

Share this post


Link to post
Share on other sites
  • 0

Hi @vader92,

You would connect the blue and purple wires by either wrapping or soldering to the terminals on J5 for the HB3. On the bottom of page 2 of the reference manual for the HB3 here it shows which terminals on J5. On the right it gives the cable information for the motor in this pdf here. The cables set up is the same for either one or two channel encoders. On a side note the HB5 has a direct connect that would be easier to use in your situation.Then you will need to make code that handles the feed back information.

cheers,

Jon

Share this post


Link to post
Share on other sites
  • 0
6 hours ago, jpeyron said:

Hi @vader92,

You would connect the blue and purple wires by either wrapping or soldering to the terminals on J5 for the HB3. On the bottom of page 2 of the reference manual for the HB3 here it shows which terminals on J5. On the right it gives the cable information for the motor in this pdf here. The cables set up is the same for either one or two channel encoders. On a side note the HB5 has a direct connect that would be easier to use in your situation.Then you will need to make code that handles the feed back information.

cheers,

Jon

Hi @jpeyron,

 

Noted with thanks. Will reply you if I have any doubts again.

 

Regards,

vader92

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now