vader92 Posted January 25, 2018 Share Posted January 25, 2018 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. Link to comment Share on other sites More sharing options...
jpeyron Posted January 25, 2018 Share Posted January 25, 2018 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 Link to comment Share on other sites More sharing options...
vader92 Posted January 26, 2018 Author Share Posted January 26, 2018 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 Link to comment Share on other sites More sharing options...
JColvin Posted January 26, 2018 Share Posted January 26, 2018 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 Link to comment Share on other sites More sharing options...
vader92 Posted February 6, 2018 Author Share Posted February 6, 2018 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 Link to comment Share on other sites More sharing options...
vader92 Posted February 6, 2018 Author Share Posted February 6, 2018 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 Link to comment Share on other sites More sharing options...
jpeyron Posted February 6, 2018 Share Posted February 6, 2018 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 Link to comment Share on other sites More sharing options...
JColvin Posted February 6, 2018 Share Posted February 6, 2018 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 Link to comment Share on other sites More sharing options...
vader92 Posted February 7, 2018 Author Share Posted February 7, 2018 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 Link to comment Share on other sites More sharing options...
jpeyron Posted February 7, 2018 Share Posted February 7, 2018 Hi @vader92, Sorry for the confusion, I meant a software state machine. thank you, Jon Link to comment Share on other sites More sharing options...
vader92 Posted February 8, 2018 Author Share Posted February 8, 2018 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. Link to comment Share on other sites More sharing options...
jpeyron Posted February 8, 2018 Share Posted February 8, 2018 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 Link to comment Share on other sites More sharing options...
vader92 Posted February 9, 2018 Author Share Posted February 9, 2018 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 Link to comment Share on other sites More sharing options...
Question
vader92
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.
Link to comment
Share on other sites
12 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.