Open Motor Control – assembled

Built around the ATmega32U4 microcontroller, this module can drive 2 DC motors or 1 stepper motor

SKU 7100-FT1173MEAN 8219671071253Item type: Assembled

Description

Based on the ATmega32U4 microcontroller, this module can drive 2 DC motors or 1 stepper motor. Power for the DC motors can range from 3 to 15 Vdc with an output current of 1.4 A (2.5 A peak) per motor. It features overcurrent and overtemperature protection. The driver can be controlled via USB, serial, or I2C. The management firmware was developed with the Arduino development environment (based on Arduino Leonardo), giving the user the ability to make desired customizations.

Technical specifications

  • Can control two DC motors or one stepper motor
  • Inputs compatible with 3.3V and 5V

Serial Management

If we want to manage the controller via an Arduino board, it is convenient to use a software serial, using a single digital line to connect to the RX line, in this way the hardware serial port will remain free to communicate with the PC. The example sketch is shown in Listing 4. This example shows how it is possible to build the control byte (byte2) starting from the settings of the individual direction and braking bits. The line of code int mode = (modeM2

I²C Management

If you want to manage the OMC21 (Open Motor Control) board via the Arduino TWI port, you just need to connect the SDA and SCL lines of both ports together and connect the GNDs of both boards. Pull-up resistors are not necessary for the simple reason that they are already internal on both Arduino UNO and 32U4 and are enabled automatically as soon as the Wire.begin() function is called.
For the sketch to use on Arduino UNO to command the controller, refer to Listing 5, which is very similar to the previous listings. However, there is an important difference with the way of communicating via serial that concerns the peripheral addressing system. While in serial communication data exchange occurs point-to-point, i.e., only two peripherals talk to each other, on the I2C BUS up to 127 slave peripherals can coexist, all in communication with the single master. The master in this case is Arduino UNO (or the control logic) while the slaves are the Open Motor Control boards; the obvious advantage is being able to use multiple controllers and therefore more motors all managed by a single Arduino board using only one TWI port. Remember that in Arduino the TWI port effectively uses the I2C protocol, which is proprietary to Philips, who invented it.
In Listing 5 there is in fact the line of code const int OMC21address=4 which has the purpose of specifying to which slave the communication occurs; obviously on the TWI BUS other slaves can also coexist, not necessarily OMC21 motor controllers. In the OMC21.ino sketch, the default peripheral address has been specified as 4, but this can be changed at will if you intend to use a peripheral on the BUS that already has this address. If you use multiple OMC21 controllers, it will be necessary for each to have a unique address, so you will need to upload a sketch to each controller in which you have specified a different address. When writing the control program, you will then need to take into account the various assigned addresses to ensure correct data transit.

Technical details

Motor power supply from 3 to 15 Volts
Control logic power supply from 3 to 5 Volts (selectable internal or external)
Output current 1.4 A continuous (2.5 A peak) per motor
Three possible interface modes USB, Serial, and I2C

You may also like…

About us

Open-Electronics.org is the brainchild of a world leader in hobby electronics Futura Group srl. Open-Electronics.org is devoted to support development, hacking and playing with electronics: we share exciting open projects and create amazing products!

Open-Electronics.org is not just a container of ideas: it is also a web site lead by a team of engineers and geeks who will take part in the discussions and give support.

Our mission is to become a reference Open Source hacking site with ideas and feedback aimed to enrich the community.