octocoupler starts kit project 15

Hello

I tried to do project 15 from the arduino project book (starters kit), but I have a problem I don't understand.

Since I don't have the recording device of project 15, I 've hacked a tool of my kids, consisting basically in a motor driven by three 1.2V batteries. I 've opend the button and made an circuit just as in the project book. I tried to make the motor work for 2 seconds, then pause for 2 seconds, and so on.

This didn't work. But if I tried the same circuit and same code but with an LED instead of the motor, feeded by a seperate 9V battery (+ 10k rersistor), it worked well. When I connect one wire of the motor with the other, apart from the octocoupler, the motor runs well too.

Why did it work with the LED and doesn't it work with the motor? Can anyone help me?

Thanks!

Fagus