In this Instructable i will show you how to open up a LEGO Power Functions Motor and change the wiring to fit a Arduino or any other micro controller.
1x LEGO Power Functions Motor
1x Soldering iron
A small screwdriver
2x Small wires
Step 1: Remove the Small Screw Under the Motor
Step 2: Use a Small Screwdriver to Remove the Lightgray Cover
Step 3: Remove the Yellow Capacitor (optional)
As mentioned in the comments, this step is not necessary.
Quote from the comment section:
"What is the impact of removing capacitor and not putting it back?"
"Simply because when you use it with a microcontroller or something similar you may not want the capacitor. If you do you can just use an external one. It wont probably make no difference, you can keep it if you want to. The reason for the capacitor being there in the first place is to even out the current going through the motor so that the battery pack feel a bit better. It will also reduce noise in the magnetic field in the motor so that it doesn't harm delicate components in the proximity of the magnetic field."
If you want to keep the capacitor you need to solder it directly in parallel with the motor pins.