Ratchet Mechanism of Pin Gear

Input: green crank .
Output: yellow pin gear.
Both go and back motions of the green crank make the gear rotate in the same direction. The greey bars push the gear.
Gravity maintains contact between pawls and pin gear