Skip to the content
PCBKitNew board
2 layersMotorSpeedController, the printed circuit board in 3D

setup() { ... // Init SPI SPI.begin (); SPI.setClockDivider(SPICLOCKDIV4);

Copper layers
2
Thickness
0.8 mm
Parts
24
Nets
19
Pads
133
Tracks, vias
122, 23
Pours
6
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
17 Jan 2021
Updated
4 Mar 2022

Overview

MotorSpeedController is an open-source printed circuit board by sdsmt-robotics, from the sdsmt-robotics/MotorSpeedController repository on GitHub. It is a 2-layer board with 24 parts on 19 nets, routed with 122 tracks and 23 vias.

It is built around the ATMEGA328P-AU and MC7805CT. Its parts include 9 capacitors, 3 resistors, 3 ICs, 3 diodes and 2 connectors. It belongs with the AVR (ATmega, ATtiny) boards of this library.

Main components

2

README

README.md

MotorSpeedController

yaya.

Hardware

Software

Contains code for the controller itself and code for a master device to interface with the controller.

  • controller - Code for the speed controller itself.
  • controllerInterfaceLib - Library files for use on a master device to interface with the controller.

Wiring Connections and Interface

This controller uses standard SPI communications.

ArduinoSpeed Controller
5V5V
GNDGND
MOSIMOSI
MISOMISO
SCKSCK
SS*SS

*The SS pin must be used for at least one of the connections. Additional speed controllers may use other digital IO pins.

Status LED

The green LED on the board will indicate state of the controller. The key is as follows.

StatePattern
Off---------
Brake-__-__-__
Speed Control--__--__--
Power Control--_--_--_
Timeout-_-_-_-_-

Interface Lib Usage

Create:
Create an instance of the class.

text
Nidec24hController motor(SPI, ssPin);  

SPI - the SPI singleton object from the SPI.h library.
ssPin - pin to use as chip select. Should simply be SS for first controller.

Initialize:
Create an instance of the class.

text
setup() {
    ...
    // Init SPI
    SPI.begin ();
    SPI.setClockDivider(SPI_CLOCK_DIV4);
    
    //Init motor controller
    motor.init();  
    ...
}

Set Speed:
Set the speed for the motor in RPM. Negative values are allowed. This will switch the motor to speed control mode if in power control mode or braking.

text
motor.setSpeed(speed);  

speed - the speed for the motor in RPM.

Set Power:
Set the power for the motor (-1000 to 1000). This will switch the motor to power control mode if in speed control mode or braking.

text
motor.setPower(power);  

power - the power for the motor (-1000 to 1000).

Brake:
Engage the electronic braking and stop the motor..

text
motor.brake();  

Set Direction Inverted:
Set whether the motor control should be inverted.

text
motor.invertDirection(invertDir);  

invertDir - boolean to set if direction should be inverted.

Get Current Speed:
Get the current speed of the motor in RPM.

text
motor.getSpeed();  

Get Current Power:
Get the current power the motor is running at. If in speed control mode, this will be varied automatically by the PID algorithm.

text
motor.getPower();  

Get the Target Speed:
Get the target speed the controller is attempting to regulate the motor at.

text
motor.getTargetSpeed();  

Parts

24
QtyValueFootprintReferences
50.1uFCapacitor_SMD:C_0603_1608MetricC3, C5, C6, C7, C8
3MountingHole_PadMountingHole:MountingHole_3mm_Pad_ViaH1, H2, H3
210kResistor_SMD:R_0603_1608MetricR2, R3
21uFCapacitor_SMD:C_0603_1608MetricC1, C9
222pFCapacitor_SMD:C_0603_1608MetricC2, C4
2LED_Small_ALTDiode_SMD:D_0603_1608Metric_CastellatedD1, D2
116MHzCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
11kResistor_SMD:R_0603_1608MetricR1
1AS5134MotorSpeedController:SOIC-20U2
1ATmega328P-AUPackage_QFP:TQFP-32_7x7mm_P0.8mmU1
1Conn_01x05_FemaleConnector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_VerticalJ2
1Conn_01x08_FemaleConnector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalJ1
1D_SmallDiode_SMD:D_2010_5025Metric_CastellatedD3
1MC7805Package_TO_SOT_SMD:TO-252-2U3

Questions

What parts does the MotorSpeedController use?

24 parts, built around the ATMEGA328P-AU and MC7805CT. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the MotorSpeedController KiCad files?

From the sdsmt-robotics/MotorSpeedController repository on GitHub, at the commit this page was made from: the board is Hardware/MotorSpeedController.kicad_pcb and its schematic Hardware/MotorSpeedController.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the MotorSpeedController design in my own project?

Its repository states no licence, so its author keeps all rights: ask sdsmt-robotics before reusing the design.

Similar boards

  • 2 layers113 × 49 mmTH8200Control, the printed circuit board in 3D

    TH8200Control

    CatoLynx/TH8200Control

    Control board for Siemens TH8200 hand dryer

    43 parts
  • 2 layers60 × 98 mmENNOID Dual Gate Driver, the printed circuit board in 3D

    ENNOID Dual Gate Driver

    jagdeepsingh02/ENNOID-Dual-Gate-Driver

    Dual Gate Driver for IGBT or Mosfet modules

    146 parts5
  • 4 layers100 × 100 mmLcr, the printed circuit board in 3D

    Lcr

    Owen-Ball/LCR_Meter

    A DIY LCR meter

    182 parts
  • 4 layers266.7 × 123.2 mmAuxiliary Board, the printed circuit board in 3D

    Auxiliary Board

    FYNCH-BIO/hardware

    eVOLVER Hardware (PCB, 3D printed parts)

    36 parts12
  • 2 layers43.5 × 29 mmBeetlepower, the printed circuit board in 3D

    Beetlepower

    goktugh/robotbits

    Some bits for robots or other control applications

    14 parts
  • 2 layers50.5 × 128.5 mmOpenThereminV45, the printed circuit board in 3D

    OpenThereminV45

    GaudiLabs/OpenThereminV4

    Open Source Theremin Instrument

    107 parts249GPL-3.0