LEGO Power Function (PF) Motor Speed Controller
by rvdalen in Circuits > Electronics
553 Views, 1 Favorites, 0 Comments
LEGO Power Function (PF) Motor Speed Controller
Inspired by this product, I made my own versions of a speed controller for LEGO Power Functions (PF) motors.
Two versions are described in this Instructable:
- Basic version: speed control using the HW-70 PWM controller.
- Reversible version: adds a DPDT switch for forward/stop/reverse operation.
I also made a more advanced version based on an Arduino Pro Mini, a rotary encoder and a 16-LED NeoPixel ring as a forward/reverse speed indicator.
Supplies
This product contains a commercial HW-70 PWM Motor Speed Controller Module.
The HW-70 is based on the well-known NE555 timer IC and generates a PWM output signal.
I bought a couple of these inexpensive modules on AliExpress
Basic Version
Then I made a small snap-fit enclosure for it in FreeCAD and 3D printed it.
The cable entry on the lid is marked with "wire".
The enclosure lid also fits directly onto LEGO studs.
The FreeCAD source files and STL files for the enclosure are available in my GitHub repository.
Make Lego PF Connection Cable
On AliExpress I bought a couple of PF connectors and 4 core wire and made my own DIY Lego PF connection cable.
Before assembling the PF cable, I removed the C1 and C2 contacts from the bottom part of the connector. This allows a single connector to connect both the battery box (0V and 9V) and the motor (C1 and C2).
See here how the LEGO Power Functions cable works.
The Result - Basic Version
Because the output polarity cannot be reversed with this version, the motor direction cannot be changed. The controller can, however, also be used as a simple LED dimmer.
Reversible Version
The basic version cannot reverse the motor direction. By adding a DPDT switch, the motor direction can be reversed while retaining the speed control.
The switch I used has three positions: FORWARD – STOP – REVERSE.
For this version I designed a larger snap-fit enclosure in FreeCAD.
The same GitHub repository also contains the FreeCAD source and STL files for this larger enclosure.
Replace Screw Connector
I replaced the screw connector on the HW-70 module with a header connector (removing three pins first). I then soldered and tested all connections. The assembly of the PF cable is described in Step 2.
3D Print the Enclosure (Large Module)
Finally, I 3D printed the enclosure and mounted the circuit inside it.
The cable entry on the lid is marked with "wire".
To make the stripes on the potentiometer scale, color in the lines with a black marker and then wipe it clean with alcohol, leaving the stripes.
The Result - Reversible Version
The result is a compact speed controller for LEGO PF motors, with forward, stop and reverse control.
The enclosure lid also fits directly onto LEGO studs.