Home / Experiments / Motor Control with the Mindsensors PCF8574A

Motor Control with the Mindsensors PCF8574A

//www.philohome.com/motors/motorcomp.htmThe Mindsensors PCF8574A board is not just suitable for making das Blinkenlights but also for controlling other ICs.  I recently thought of how I could use my old 9V motors with my NXT using a dual H-Bridge IC such as the SN754410.  This IC is pin compatible with the very popular L293D and has the same clamping diodes built-in.  It is, however, much beefier than the L293D and can handle much higher loads.

Click to enlargeIn this setup I am using two buttons to control the program on the NXT.  I have a direction button (SW2) and a disable/enable button (SW1).  The former controls the direction of the motor and the latter the braking of the motor.  When the direction button is pressed, the motor will toggle between left and right rotation.  When the disable/enable button is pressed, the motor is toggled off and on.  The current program is configured to stop the motor by allowing it to coast.  A simple programmatic change would enable dynamic braking.  If you are not looking to allow your motor to coast to a stop, you can forego the extra pin needed to toggle the EN pin on the H Bridge and add a 10K pull-up resistor to that port.  That would allow you to potentially connect two dual H-Bridge ICs and control 4 motors at once!  I’ve also tested this circuit with the new style 9V motors.  You have to be very careful with those, though.  According to some tests, they can pull up to 3.2A when stalled.  More information on the various Lego motors and their properties can be found here: LINK.

You can find the source for this program here: LINK.

I’ve made a short video demonstrating the setup.  This time I’ve even included a voice over!!

About Xander

Xander Soldaat is a Software Engineer and former Infrastructure Architect. He loves building and programming robots. He recently had the opportunity to turn his robotics hobby into his profession and has started working for Robomatter, the makers of ROBOTC and Robot Virtual Words.