Friday, April 28, 2017

SeeedStudio's 4A Motor Shield

I recently have been playing a little bit with an Arduino UNO I have at home. I gotta admit that, even though I'm utterly bad at electronics, this microcontroller makes it really easy for people like to build simple prototypes.

One of my pet projects is building a robot car, yes I'm that original 😉. For this, I bought a motor shield[1] from SeeedStudio which makes the Pulse-Width Modulation, PWM, very simple: You connect three cables to the oulets in the shield, program your Arduino sketch (no more than 5 lines) and use the SeeedStudio's library[2] and you will get your motor working. Just that easy!

However, I faced one problem that I was able to manage. In the library, the specified pins are

  • Motor A: 8, 11, 9. Pin 9 is used as PWM.
  • Motor B: 12, 13, 10. Pin 10 is used as PWM.
But for this shield in particular, the pins are different. Based on the schematics[3], I noticed the correct order:
  • Motor A: 5, 6, 9. Pin 9 is used as PWM.
  • Motor B: 7, 8, 10. Pin 10 is used as PWM.
I decided to fork the library in GitHub and make my own modifications to make them available to anyone who's having the same problem as me.


If you have a different board, make sure you are using the correct pins and also make sure that the PWM pin number you're specifying in your Arduino sketch is in fact an enabled PWM pin. They differ from board to board. For instance, in the Edison the default PWM pins are 3, 5, 6 and 9 and if you need pins 10 or 11 you'll need to adjust your PWM swizzlers[4].

Are you as interested as me on these pet projects? Share yours and lets exchange ideas.

Happy reading!

References

[1] https://www.seeedstudio.com/4A-Motor-Shield-p-1954.html
[2] https://github.com/Seeed-Studio/SeeedMotorShieldV2
[3] http://wiki.seeedstudio.com/images/9/93/4A_MOTOR_Shield_v1.0.pdf
[4] http://www.instructables.com/id/PWMSwizzling-an-Edison-Arduino-Breakout-to-work-wi/

13 comments:

  1. very useful to the users and thanks for providing keep updating like this. For more updates get touch with AWS Online Training Bangalore

    ReplyDelete
  2. Very informative and useful historical post. I see you have a lot of other cool stuff available at your website, simply bookmarking it to check in spare time. Thanks and keep the good work up.DataScience with Python Training in Bangalore




    ReplyDelete
  3. I don’t think there is any better study material than Pass4Sure SY0-501 dumps PDF which could have helped me. I am thankful to Marks4sure.com for being there throughout my preparation and the experts guided me with their useful suggestions. CompTIA SY0-501 dumps material made my work many times easier and I aced my certification by the first attempt. It was not easy for me to think of CompTIA SY0-501 exam so I downloaded this expertly written guide. It was an amazing experience so I will suggest all IT candidates of this certification to use CompTIA SY0-501 dumps. security + 501 exam questions and answers

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. The Adobe AD0-E712 Exam is a crucial assessment for professionals aiming to attain the Adobe Certified Expert certification. It evaluates expertise in Adobe Experience Manager (AEM) Assets, including digital asset management and content creation. Passing AD0-E712 showcases proficiency in optimizing AEM for efficient digital marketing and customer experiences.
    Dumpspedia

    ReplyDelete

Enterprise Integration with AWS

Today I published a blog post at IO Connect Services blog where I describe my experience building a solution to achieve enterprise integrat...