Position and Speed Controller for DC Motor with Incremental Encoder

  • Rajkumar Sharma
  • 213 Views
  • medium
  • Tested
  • SKU: EL143757
  • Quote Now

This project consists of Arduino Arduino-compatible microcontroller ATmega328, an L298 Motor driver, a Joystick, a programming connector, an Infrared sensor, and various analog and digital I/O pins. The project is Arduino compatible and can be programmed using Arduino IDE and many motor-related projects can be developed using this hardware. L298 has two H-bridges but here in this project the two H-bridges are configured/connected in parallel to provide more power to the motor, D9, and D10 are connected to the Input of L298 and these two pins can be used to control the direction of the motor or direction and speed. D5 is connected to the Enable pin of L298 and can be used for PWM input for speed control or to enable the L298. Connector CN1 is provided to connect the incremental encoder to Channel A and Channel B and Arduino and D2, D3 interrupt pins of the Arduino, these two pins have also pullups. The operating power supply for the motor is 7V to 46V DC, logic supply is 5VDC. If the motor voltage is below 18V, the project can work with a single supply, in this case, install the LM7805 regulator provided under the PCB.

Arduino code is available to test the project, and you can edit the appropriate PID values to tune the motor. Check the link below for more information about boot-loader and Arduino programming, also refer to the connection diagram for the same.

Arduino Compatible Motor Driver Key Features

  • Atmega328 Arduino Compatible Microcontroller
  • L298 H Bridge Bidirectional DC Motor Driver
  • Joystick + Switch Joystick Connected to A1, Switch Connected to D12 + GND
  • CN3 Arduino Programming/Bootloader Connector
  • CN5 Analog I/O, A1, A2, A3 (For External Sensor or I/))
  • CN4 Digital I/O D6, D7, D8 (For I/O)
  • CN1 Digital Pin D2, D3 (For Incremental Encode A and B Channel) With Pull-ups (Interrupt Pins)
  • Jumper J1 Enable Control for L298, Optional Jumper Do Note Populate
  • U1 External Potentiometer (VCC, Analo A0, GND)
  • LM78M05 5V Regulator Optional Only Use when Motor Power Supply 18V Maximum
  • D1 Logic Power LED
  • D4 Motor Power LED

Applications

  • PID Closed-Loop DC Motor with Incremental Encoder Feedback for Position Control
  • PID Closed-Loop DC Motor with Potentiometer Feedback Potion Control
  • DC Motor Speed Controller Open Loop
  • DC Motor Speed Controller Closed Loop (Velocity Control)
  • DC Motor Speed Control Using IR Remote
  • DC Motor Speed and Direction Control Using Joystick Open Loop or Closed Loop
  • DC Motor Speed and Direction Control Using External Potentiometer Open Loop or Closed Loop

Features

  • Power Supply Motor 7V to 46V DC
  • Maximum Motor Load 2Amps Continues (4Amp Peak)
  • Logic Power Supply 5V DC
  • Optional 5V Regulator for Single Supply Operation Only Valid for Maximum Motor Supply 18V DC
  • LED for Motor Power
  • Power LED for Logic Supply
  • On Board Joystick Including Tactile Switch
  • Connector for Arduino Programming
  • Connector for Analog Inputs
  • Connector for Digital I/O
  • On Board IR Sensor for Infrared Remote Motor Control
  • On Board Jumper for Direct Motor Enable/Disable (Jumper J1)
  • 4X 3MM Mounting Holes
  • PCB Dimensions 72.39 X 39.05 MM

Connections

  • CN1: Pin 1 = VCC, Pin 2 = D2-Pullup, Pin 3 = D3-Pullup, Pin 4 = GND
  • CN2: Pin 1 VDD Motor Supply. Pin 2 = GND
  • CN3: Pin 1 TX, Pin 2 = RX, Pin 3 = Reset, Pin 4 = GND, Pin 5 = VCC, Pin 6 D11, Pin 7 = D12, Pin 8 = D13
  • CN4: Pin 1 = VCC, Pin 2 = D6, Pin 3 = D7, Pin 4 = D8, Pin 5 = GND
  • CN5: Pin 1 = VCC, Pin 2 = A3, Pin 3 = A2, Pin 4 = A1, Pin 5 = GND
  • U1: Pin 1 = VCC, Pin 2 = A0, Pin 3 = GND
  • U5: Infra-Red Sensor for IR Remote Motor Control Application
  • Joy: Joystick Connected to A1 Analog Pin and Joystick Switch Connected to D12 and GND
  • D1: Power LED Logic Power
  • D4: Power LED Motor Power
  • L298 2X Direction Pins = Arduino D9 and D10, L298 PWM/Enable = Arduino D5

Schematic

Parts List

NOQNTYREFDESCMANUFACTURERSUPPLIERSUPPLIER PART NO
11CN14 PIN MALE HEADER PITCH 2.54MMWURTHDIGIKEY732-5317-ND
21CN22 PIN SCREW TERMINAL PITCH 5.08MMPHOENIXDIGIKEY277-1247-ND
31CN38 PIN MALE HEADER PITCH 2.54MMWURTHDIGIKEY732-5321-ND
42CN4,CN55 PIN MALE HEADER PITCH 2.54MMWURTHDIGIKEY732-5318-ND
51C110uF/10V CERAMIC SMD SIZE 0805YAGEO/MURATADIGIKEY
63C2,C4,C6 100nF/50V CERAMIC SMD SIZE 0805YAGEO/MURATADIGIKEY
71C3DNP
81C5220uF/50V ELECTROLYTICPANASONICDIGIKEYPCE3921CT-ND
91SHUNTSHUNT FOR JUMPER J1SULLINS CONNECTDIGIKEYS9001-ND
102C7,C822PF/50V CERMIC SMD SIZE 0805YAGEO/MURATADIGIKEY
111D1GREEN LED SMD SIZE 0805DIALIGHTDIGIKEY350-2044-1-ND
124D2,D3,D5,D6SS34 SMD FAST DIODETAIWAN SEMIDIGIKEY1801-SS24CT-ND
131D4RED LED SMD SIZE 0805OSRAMDIGIKEY
141J13 PIN MALE HEADER PITCH 2.54MMWURTHDIGIKEY732-5316-ND
151MG12 PIN SCREW TERMINAL PITCH 5.08MMPHOENIXDIGIKEY277-1247-ND
162P1,P2,SW1THUMB JOYSTICK INCLUDING SWITCHC&KDIGIKEY108-THB001P-ND
174R1,R3,R4,R710K 5% SMD SIZE 0805YAGEO/MURATADIGIKEY
182R2,R90E SMD SIZE 0805YAGEO/MURATADIGIKEY
191R5470E 5% SMD SIZE 0805YAGEO/MURATADIGIKEY
201R64.7K 5% SMD SIZE 0805YAGEO/MURATADIGIKEY
211R81M 5% SMD SIZE 0805YAGEO/MURATADIGIKEY
221U12 PIN SCREW TERMINAL PITCH 5.08MMPHOENIXDIGIKEY277-1247-ND
231U2ATMEGA328TQPF-32MICROCHIPDIGIKEYATMEGA328PB-AURCT-ND
241U3L298 TO220 11 PINSTDIGIKEY497-1395-5-ND
251U4LM78M05 DPAKTIDIGIKEYMC78M05CDTGOS-ND
261U5TSOP4838VISHAYDIGIKEYTSOP4838-ND
271X116MhzECS INCDIGIKEYX1103-ND

Connections

Arduino Connections

Gerber View

Photos

Video


L298 Datasheet

Please follow and like us:
Pin Share

PCB

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

RELATED PROJECTS

TOP PCB Companies