General Usage and Operation
The Versalino MotorMaster is intended for use with Versalino Controllers, if you want to run the MotorMaster on a standard Arduino you will probably be interested in the guide for running Versalino boards on a regular Arduino.
When selecting the way to power your MotorMaster you should use a Type E Power connector (just like the connector used for the Versalino). That means that all of the battery adapters for the Versalino will work perfectly for the MotorMaster. If you choose to use an external adapter for power make sure to change the power jumper (next to the power jack) to “EXT”. Using External power greatly reduces the chance of regulator overheating, and board brown-outs on your Versalino.
If you would like to share the input power to your Versalino with the MotorMaster then you can put the jumper in the “VIN” position (shared power is recommended for 9V and under only).
The Arduino/Versalino Code
Using the MotorMaster library which can be downloaded from the following link: Download the MotorMaster library from the resources tab here. Below is just one of many examples of what you can do with the Versalino MotorMaster in your next project.
myMotorMaster.begin(A0, A1, A2, 2, 3, 4, 5, 13, 6);
//assigns the MotorMaster to a custom pin-out (feel free to be more creative)
myMotorMaster.drive(COILA, FULLFORWARD);//Drive COILA forward
myMotorMaster.drive(COILB, FULLREVERSE);//Drive COILB in reverse
delay(5000); //for five seconds
myMotorMaster.drive(COILA, FULLSTOP);//stop both coils
delay(2500); //for 2.5 seconds
Pins and Purposes
Pin Purpose Details Gnd Common ground Make sure it can handle 2A A0 Trig1 General Purpose Switch A1 Trig2 General Purpose Switch A2 Trig3 General Purpose Switch D1 IN1 Controls Coil Pin 1 P1 ENABLEA Turns Coil pins 1 and 2 on (high) or off (low) D2 IN2 Controls Coil Pin 2 P2 ENABLEB Turns Coil pins 3 and 4 on (high) or off (low) D3 IN3 Controls Coil Pin 3 P3 IN4 Controls Coil Pin 4 Vdd Regulated Power Controls the logic inside the H-Bridge (L298N VSS 4.5 V to 7 V) NO PIN’ Orientation Indicator Pin Look at the solder points on the board for the one without a pin. Vin Supply Voltage Routed to all Coil Pins (L298N VS 2.5V to 46V @ 2A)
- COILA control pins.
Pin Link Details D1 IN1 Controls CoilA Pin 1 P1 ENABLEA Turns CoilA pins 1 and 2 on (high) or off (low) D2 IN2 Controls CoilA Pin 2
- COILB control pins.
Pin Link Details P2 ENABLEB Turns CoilB pins 3 and 4 on (high) or off (low) D3 IN3 Controls CoilB Pin 3 P3 IN4 Controls CoilB Pin 4
- COILA control pins.
Pin Link Details D1 IN1 Controls CoilA Pin 1 P1 ENABLEA Ensure CoilA & CoilB are always set to the same level for stepper operation D2 IN2 Controls CoilA Pin 2 P2 ENABLEB Ensure CoilA & CoilB are always set to the same level for stepper operation D3 IN3 Controls CoilB Pin 3 P3 IN4 Controls CoilB Pin 4
In order to keep the MotorMaster as open and accessable as possible all the Endstop ports (Trig1 to Trig3) are wired specifically to work with the following open source Endstops The Makerbot Mechanical Endstop V1.2
- Endstop 1 / Trig1
Pin Purpose Details Vdd Regulated Power Powers the Endstop board Gnd Common ground Gnd Common ground A0 Trig1/Endstop1 Logic pin for Endstop 1.2 Compatible port
- Endstop 2 / Trig2
Pin Purpose Details Vdd Regulated Power Powers the Endstop board Gnd Common ground Gnd Common ground A1 Trig2/Endstop2 Logic pin for Endstop 1.2 Compatible port
- Endstop 3 / Trig3
Pin Purpose Details Vdd Regulated Power Powers the Endstop board Gnd Common ground Gnd Common ground A2 Trig3/Endstop3 Logic pin for Endstop 1.2 Compatible port
The fabled Versalino Bus to Uno Bus Conversion
- If you picked up the MotorMaster for a standard Arduino or any other other Microcontroller you are probably interested in getting it wired up. When it comes to Arduino compatible devices you are in luck, because the library was carefully written to allow custom pin assignments
- Here is an example of Basic DC Control using the MotorMaster library with custom wiring based on the Pin-out listed earlier (Just be sure to put the Enable pins on Pulse width Modulation pin if you want anything other than off or full throttle).
Circuit Diagrams & Explanations
- Below is a circuit diagram from the L298N Datasheet that does an excelent job illustrating the DC circuit C & D Correspond to IN(1 & 2 or 3 & 4) while Ven corresponds to ENABLEA or ENABLEB.