Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • QuickBytes
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX

Propeller 2

  • Configuring Visual Studio Code for Programming the P2 on Mac, Windows, and Linux
  • Breakout Board Options for P2 Edge Modules
  • Solar Panel Monitoring Demo (Intro to Using Video 3 of 3)
  • Wireless Programming with the ESP8266 WX Module
  • Brushless DC Motor Control Demo
  • Colorful Terminal Output with ANSI Escape Sequences
  • XBee RF Transparent and API Mode Demo
  • DS3231 Real Time Clock I2C Demo
  • Multiple Servo Control (up to 64) Object
  • Multiple Serial Port (8 UART – 16 Tx/Rx) Object
  • Goertzel Operation with Ultrasonic Transducers
  • Web Page Control of WS2811 LEDs Using the IoT Gateway on Raspberry Pi
  • 320×240 LCD Driver for ILI9341 Controller and XPT2046 Touch Screen
  • Digital Sample ADC to DAC + Analog Frequency to DAC
  • Using Smart Pins to Measure Frequency Output of TSL235R Light-to-Frequency Sensor
  • Ping))) Ultrasonic Distance Sensor with Graphical Debug Demo
  • Simple Analog Input
  • P2 Edge 16 MB Flash Reader and Explorer Utility
  • LED Matrix used as an I/O Test Utility
  • Arlo Conversion to P2 with the Universal Motor Controller
  • Five Buttons On One Pin
  • P2 RTC Add-on Board Demo
  • Simple Video Driver – Using Images (Intro to Using Video 2 of 3)
  • Starting Your P2 Project with a Spin2 Template
  • E-Ink Display Demo
  • MAX7219 LED Display SPI Demo
  • DHT11, DHT22, CM2302 Humidity and Temperature Sensor Object
  • NMEA GPS String Parsing
  • Floating Point Math: DEBUG and Terminal Display Example
  • LEDs – Beyond the Basics
  • Quadrature Encoder Object
  • P2 RTC Add-on with GPS Module
  • DVI/VGA Text Driver Demo
  • PCF8574 I2C LCD Demo
  • Simple Sound Engine Demo
  • 1-Wire Driver with DS18B20 Temperature Sensor Demo
  • Send Email from the Propeller 2 Using the IoT Gateway on Raspberry Pi
  • I2C Device Bus Scanner Utility
  • 32-Channel ADC Object
  • Tetris
  • Video Hardware with Character Map Demo (Intro to Using Video 1 of 3)
  • WS2811, WS2812, WS2812b, WS2813, SK6812x NeoPixel Object
View Categories
  • Home
  • Docs
  • Quick Bytes
  • Propeller 2
  • Brushless DC Motor Control Demo

Brushless DC Motor Control Demo

Reading Time: 2 min read

This P2 Quick Byte demonstrates the use of the 24V 4000 RPM BLDC Motor (featured in the September 2022 “Propeller 2 Mystery Box”) but it is also compatible with the 6.5″ Hub Motors. 

Description #

The 4-channel Universal Motor Controller add-on (#64010) for the Propeller 2 Multicore Microcontroller can control DC, stepper, three-phase, or four-phase brushless (BLDC) motors. It also includes a feedback header, typically used for encoder or hall sensor signals from the motor.

This demonstration shows how to use a three-phase brushless motor with the 4-channel Universal Motor Controller, and how to simultaneously display live data, including current sense, channel voltages, speed and hall sensor feedback, to an HDMI monitor.

The video shows how to connect together the parts required to run the example source code, which was provided by Stephen Moraco at Ironsheep. The source code for this specific example is provided below, but the very latest version of the code can also be found at the IronSheep GitHub repository. 

All of the configuration options for the motor code mentioned in the video, and shown in the “isp_bldc_motor_userconfig.spin2” file, can be found here https://github.com/ironsheep/P2-BLDC-Motor-Control/blob/main/MOTOR_CHOICE.md

Also included with the sample code are interfaces to control single or dual motors over a standard serial connection (Raspberry Pi, Arduino, BASIC Stamp, etc) or using an RC radio transmitter.

With the largest development board, the 64020 P2 Edge Module Breadboard (not shown in the video), you could add up to 3 of the universal motor drivers and also the HDMI add-on board, allowing you to drive up to 6 DC motors or 4 three-phase brushless motors, and still view the live data on a monitor.

For help please feel free to ask your questions at the GitHub issues page or ideally for a wider audience of helpers at our https://forums.parallax.com

These motors are ideal for testing proof of concept, developing code, or attaching to a small robotic platform.

The Hall sensor cables coming from the motor are color coded to match the corresponding motor phase cables. For this motor (Parallax 750-90020): U is yellow, V is blue and W is green. The Hall sensor has two additional cables: 5V is red, GND (Ground) is black.

The photo shows the color order at my homemade hall connector, starting at the 5V pin: red-yellow-blue-green-black.

To make the homemade hall connector I used a scrap of 0.1” veroboard, a 5-way 0.1” female socket (PPPC051LFBN-RC), some 0.1” screw terminal blocks (enough to cover 5 positions, although I used 6 as that was available; OSTVN05A150). There are other ways to achieve this connection. 

The spring terminals accept stripped cables with cross-section 0.2 mm² – 4 mm² (AWG : 24–12). Connect GND and VDC to your power source. Connect U, V, W, X to your motor phases.

In this example, we used a 12V battery as the power source, installed a 3 Amp fuse at the battery positive terminal, then connected the other side of the fuse to the motor driver VDC terminal. The motor driver GND terminal is connected directly to the battery negative terminal. It is ALWAYS necessary to include a fuse when powering from a battery pack (or any other power source) that does not have built-in overcurrent protection.

For the motor connections, we used 3 of the 4 available motor driver channels, and connected them with these colors: U is yellow, V is blue and W is green. The X channel spring terminal was left unconnected.

Parts Used #
  • P2 Edge Module
  • P2 Edge Mini Breakout Board
  • Motor, BLDC, 24V, 4000 RPM
  • USB Mains Adapter, 18W, 5V, 3A
  • P2 Eval Digital Video Out Add-on Board
  • 7" HDMI Display, 800 x 480
  • Universal Motor Driver P2 Add-on Board
  • USB A to DC 2.1mm Jack Cable
  • USB A to Micro B Cable
  • HDMI A Male to A Male Cable
Source Code #
  • BLDC Motor Control Code
Programming Language #
  • Spin 2
  • PASM2
Tools and Operating System #
  • Propeller Tool for Windows
  • FlexProp for Windows, Mac and Linux
Additional Resources #
  • Propeller 2 Spin Documentation
  • Stephen Moraco's Github
Document Author #
  • Michael Mulholland
Source Code Author #
  • Stephen Moraco
Was this useful ?

Share This Article :

  • Facebook
  • X
  • LinkedIn
Still stuck? How can we help?

Still stuck? How can we help?

Updated on September 27, 2026
Wireless Programming with the ESP8266 WX ModuleColorful Terminal Output with ANSI Escape Sequences
Table of Contents
  • Description
  • Parts Used
  • Source Code
  • Programming Language
  • Tools and Operating System
  • Additional Resources
  • Document Author
  • Source Code Author

Copyright © 2026 - Parallax Inc.
599 Menlo Drive | Rocklin, CA 95765 | USA