Connecting motor & gear to teethed stick

I want to use this motor combined with a gear to move the teethed stick up and down. How would you suggest I attach the two together so the stick can still move but doesn’t fall off?

Spheal:
I want to use this motor combined with a gear to move the teethed stick up and down. How would you suggest I attach the two together so the stick can still move but doesn't fall off?

Welcome to the Arduino forum. What project are you thinking about?

Google "rack and pinion" and look at the images.

Paul

Thanks for the help, I didn’t know what that machine was called.
I am making an automated window opener with an arduino board. I need the rack and pinion so the motor can push the shutter up and down.

Spheal:
I need the rack and pinion so the motor can push the shutter up and down.

Not necessarily.

Motor vehicle window winders for example, turn rotary motion into linear using a worm gearbox ( good speed reduction) and a crank principle.

In the arrangement you show, there will be near zero torque as the speed will have to be reduced to near zero.