I've been working lately connecting my Arduino to drive a LEGO car I've built. I know that LEGO makes motors specifically for this application, but I'd prefer not to buy one of those. I've got some higher quality motors I'd rather use instead.
I have a few simple DC motors that I'd love to connect to my car. The current setup I'm using is a universal mounting hub which then lets me fasten the lego gear to the hub. It works well, but it's a bit bulky and could be done more simply.
I want to connect a pinion gear directly to the shaft of the DC motor. Lots of hobby stores sell gears that will connect to the motor shaft using a set screw. That setup would work nicely for my application.
But how do I know which hobby gear will mesh into my LEGO gear? Are there standard gear sizes that will work?
After you measure the Lego gear, you can determine whether it is a "standard" size, or if Lego made up something for themselves.
I would be willing to bet that Lego gears are pretty custom; I sincerely doubt that they are "standard" at all.
BKnight760:
Something to keep in mind with Lego is that it is anything but "strong"; you may have better motors, but they may have way more torque (and output speed) than what Lego can withstand, so keep that in mind when you are customizing things. I've actually found Lego motors to be fairly good quality for a simple gear motor; I've never tried the NXT motors, though, but I suspect they are similar (and they have position feedback, too).
I would avoid mating a metal gear to the plastic Lego gears; they would likely get chewed up pretty quick, as Lego gears aren't made with higher-strength/wear plastic (nylon/delrin/etc) like you see in mixed material gear-trains.
What would probably work better would be to injection-mold (or cast from resin) your own gear using a custom mold and the same kind of plastic that Lego is made from (ABS). It won't be easy (and it may not be cheap), but the results will likely be better.
Another option would be to take a piece of Lego shafting (if the motor shaft is smaller), and drill out the center (slightly smaller), add a drop of super-glue and press-fit the Lego shafting onto the end of the motor. This would be fairly easy if you have a small drill press.