Skip to main content

How to Connect the Hercules Dual 15A 6-20V Motor Controller, Load its Library and Program it



The Hercules Motor Controller Board


First, if you don't have the Arduino Integrated Development Environment (IDE) installed, please download and install it from this following link: https://www.arduino.cc/en/Main/Software

Once you go to the link above, scroll down to the following section:





If you are using a Windows PC, click on Windows Installer link for fast and easy installation process. 
If you are using  a Raspberry Pi, click on the Linux ARM link. For other Linux distros (Ubuntu, etc...) use either Linux 64 or Linux 32 depending on what operating system you have installed.


Second, download the software library provided by the manufacturer. Don't use the link on the official website of the product as the library there doesn't work. Instead, use the one on github. Here is the link: https://github.com/Seeed-Studio/Hercules_Motor_Driver

Once you open the link above, click on 'clone or download' then 'Download ZIP' (YOU DON'T HAVE TO EXTRACT IT).



Now, open the Arduino IDE. You should see a window that looks similar to this:



Click on Sketch > Include Library > Add .ZIP Library




After you click on 'Add .ZIP Library', a window will pop up. Locate the library ZIP file you downloaded from github, click on it then click on open.




Now, it is time to connect the board. Use female-to-female jumper wires to connect the UartSBee to the Hercules motor controller.



Female-to-Female Jumper Wires









Make sure you connect the wires correctly:

DTR on to the Hercules Motor Controller <    > DTR on the UartSBee
      TX on the Hercules Motor Controller  <    > RXD on the UartSBee
      RX on the Hercules Motor Controller  <    > TXD on the UartSBee
      5V on the Hercules Motor Controller  <    > VCC on the UartSBee
  GND on the Hercules Motor Controller  <    > CTS on the UartSBee
   GND on the Hercules Motor Controller  <    > GND on the UartSBee



Now, we will use a micro USB Type B cable to connect the UartSBee to a PC or a Pi.


Micro USB Type B Cable









Once you have connected the USB cable to a PC, wait few seconds for the UartSBee device to be automatically recognized and installed by the operating system.


Moving on, close the Arduino IDE then reopen it. From there, click on Tools > Boards, select Arduino Duemilanove or Diecimila.

Why do we do this? the microcontroller on the Hercules board is an ATmega328P, the same microcontroller on the Arduino Duemilanove. So, in order to program the Hercules, we need the IDE to know which type of microcontroller it is dealing with to avoid any compatibility issues.





To make sure we have the correct processor, go to Tools > Processor > ATmega328P



Then make sure to select the USB port (if you have one microcontroller connected, then only 1 port will show up on the list).



Now we are ready to program the controller. Let's use an example provided by the library. Click on File > Examples, scroll down all the way until you see 'Hercules_Motor_Driver-master', click on it and select 'DC_Motor'




After doing so, a new window will open that contains source code for the example you selected:


Now click on the check mark on the top left, and wait for a green bar to load on the bottom right. After the green bar finished loading, you will see a message saying 'Done Compiling'. Now click on the right arrow icon (next to the check mark) or press Ctrl + U, then wait for the green bar to load and for a confirmation message saying 'Upload Complete' or 'Upload Successful' to show up.


Popular posts from this blog

Logic Gate Truth Tables - Reference Guide (Cheat Sheet)

A logic gate is the implementation of a Boolean function. It performs a logic operation on one or more binary input. By binary I mean that the input can either be 1 or 0, nothing else. This guide is intended to be quick guide\reference, I will dive into more details about each gate on transistor\diode level in other posts. The guide cover gates with 2 inputs, meaning that each truth table will have 4 cases (2^2 = 4) AND Gate: Boolean Logic Operator: Q = A  •  B  Input Output A B Q 0 0 0 0 1 0 1 0 0 1 1 1 Summary: in order to achieve 1 on the output, both inputs A AND B must be 1 OR Gate: Boolean Logic Operator: Q = A  +  B  Input Output A B Q 0 0 0 0 1 1 1 0 1 1 1 1 Summary: in order to ...

LTspice Tutorial: How to Design and Simulate a Circuit in LTspice

 If you do not have LTSpice already installed on your machine, please head over to LTSpice's page on Analog Device's website (Link: LTspice Information Center | Analog Devices ). Note: a video version of this tutorial is available here  Click on the applicable download button that suits your machine's operating system. Upon successfully downloading and launching LTspice, you will be greeted with a window that looks something like in the figure below. Alright, now we will need to create a new schematic. That can be done by either of the following approaches:  click on File then choose New Schematic . click on the New Schematic symbol   on the toolbar. on your keyboard, press Ctrl+N . Upon doing so, a new grey-ish screen will pop up... that will be your new empty schematic (just like the one in the figure below). In this example, we will try to design and simulate a very basic voltage divider.  To recap: a voltage divider is a circuit that takes a certain i...