The SparkFun Serial Controlled Motor Driver v20a (SCMD) is a robust and versatile board designed to control DC and stepper motors through a serial interface. It is an ideal choice for hobbyists and engineers working on robotics, automation projects, or any application requiring precise motor control. The SCMD simplifies the process of integrating motor control into your projects by offering a straightforward serial protocol.
Pin Number | Name | Description |
---|---|---|
1 | GND | Ground connection |
2 | VIN | Voltage input for motor power (6V-11V) |
3 | 5V | Regulated 5V output (100mA max) |
4 | TXO | Serial transmit output to microcontroller |
5 | RXI | Serial receive input from microcontroller |
6 | A1 | Motor A output 1 |
7 | A2 | Motor A output 2 |
8 | B1 | Motor B output 1 |
9 | B2 | Motor B output 2 |
Power Connections:
Motor Connections:
Serial Communication:
Logic Power:
#include <SoftwareSerial.h>
SoftwareSerial scmdSerial(10, 11); // RX, TX
void setup() {
scmdSerial.begin(9600); // Start serial communication at 9600 bps
}
void loop() {
// Example command to set motor A to full speed forward
scmdSerial.write(0x88); // Command byte for motor A
scmdSerial.write(0xFF); // Speed byte (0xFF for full speed)
delay(2000); // Run for 2 seconds
// Example command to stop motor A
scmdSerial.write(0x88); // Command byte for motor A
scmdSerial.write(0x00); // Speed byte (0x00 to stop)
delay(2000); // Stop for 2 seconds
}
Note: The example code assumes that you have connected the SCMD TXO pin to pin 10 on the Arduino and the RXI pin to pin 11. Adjust the pin numbers in the SoftwareSerial
constructor as needed for your setup.
Q: Can I control stepper motors with the SCMD? A: Yes, the SCMD can control stepper motors. You will need to send the appropriate serial commands to control the stepping sequence.
Q: What is the default baud rate for serial communication? A: The default baud rate is 9600 bps. If you need to change it, refer to the SCMD documentation for the correct command sequence.
Q: How do I change the direction of the motor? A: To change the direction, you need to send a different command byte or speed value that corresponds to the reverse direction.
Q: Can I use the SCMD with a 5V microcontroller? A: Yes, the logic pins on the SCMD are 5V tolerant, but ensure that your microcontroller's TX and RX pins are also 3.3V tolerant.
For further assistance, consult the SparkFun Serial Controlled Motor Driver v20a user manual or contact SparkFun's technical support.