Brushless motor control with PIC16F887 and L6234 driver

This project shows how to control a PC CD-ROM (or DVD-ROM) drive brushless motor (sensorless BLDC motor) using PIC16F887 microcontroller and L6234 3-phase motor driver.
This BLDC motor is the spindle motor of the CD-ROM drive and I chose it because it’s a low power BLDC motor which can be easily driven by the L6234 driver.

Related Projects:
The following topic contains more details about this project and BEMF technique.
Brushless DC motor control with PIC16F887 microcontroller

About L6234 3-phase motor driver:
The L6234 is a DMOSs triple half-bridge driver with input supply voltage up 52V and output current of
5A. It can be used in a very wide range of applications.
It has been realized in Multipower BCD60II technology which allows the combination of isolated DMOS
transistors with CMOS and Bipolar circuits on the same chip. It is available in Power DIP 20 (16+2+2)
and in Power SO 20 packages.
All the inputs are TTL/CMOS compatible and each half bridge can be driven by its own dedicated input
and enable.
The DMOS structure has an intrinsic free wheeling body diode so the use of external diodes, which are
necessary in the bipolar configuration, can be avoided. The DMOS structure allows a very low quiescent
current of 6.5 mA typ. at Vs=42V , irrespective of the load.

Block diagram:

L6234 Block diagram

L6234 Pin configuration:
The L6234 chip is available in 20 pin PowerDIP package (16+2+2) and in PowerSO20, each package has its pin configuration as shown below:

l6234 bldc motor driver pinout

The L6234 driver has 3 outputs: OUT1, OUT2 and OUT3. Each output is controlled with 2 pins: input (IN) and enable (EN), for example OUT1 is controlled with IN1 and EN1. The figure below shows the control logic for each half-bridge:

Hardware required:

  • PIC16F887 microcontroller  —  datasheet
  • CD-ROM brushless motor
  • L6234 three phase motor driver  —  datasheet
  • 20 MHz crystal oscillator
  • 2 x 1N4148 diode
  • 6 x 33k ohm resistor
  • 3 x 10k ohm resistor
  • 4 x 1 ohm resistor (with 2 W or higher)
  • 100 uF electrolytic capacitor (with 16V or higher)
  • 1 uF electrolytic capacitor (with 16V or higher)
  • 2 x 22pF ceramic capacitor
  • 220 nF (0.22 uF) ceramic capacitor
  • 100 nF (0.1 uF) ceramic capacitor
  • 10  nF (0.01 uF) ceramic capacitor
  • 10k ohm potentiometer
  • 5V source
  • 12V source
  • Breadboard
  • Jumper wires

Brushless motor control with PIC16F887 and L6234 driver circuit:
The following image shows project circuit diagram.

PIC16F887 L6234 brushless motor controller DIY ESC

Note that all grounded terminals are connected together.

In this project we need two power sources, the first one with 5V and used to power the microcontroller. The other one with 12V which is used to power the L6234 driver and therefore the brushless motor.

The PIC16F887 runs with 20MHz crystal oscillator (5 MIPS), MCLR pin function is disabled.

Brushless motor control with PIC16F887 and L6234 driver code:
The C code below is for CCS C compiler, it was tested with version 5.051.

Brushless motor control with PIC16F887 and L6234 video:
The small video below shows my prototype hardware circuit.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.