There is a mechanism called: SLIDER CRANK MECHANISM
One can copy one of these mechanism for just converting linear to rotational motion. In most of the cases, this will do the trick.
But for general, if you want to design a mechanism that will do your desired motion, get ready to do some work!
First, here some links you will probably need for getting the dimensions for your particular shape:
Then you must start your motion (PVA) analysis, you can use some schema like that:
I don't think you will need it, if you only want to perform your motion. But if you want to have an analysis over your mechanism (for every position of crank), you can start with inspecting these slides.
Here it comes, there are some example of mine because the process is much or less same.
Four Bar Mechanism for Straight Line
This is the desired shape:
These are the calculations for PVA analysis:
and some more of course...
After all, to sum up:
- Finding the dimensions of linkes for the desired shape
- Writing and solving Vector Loop
- PVA Analysis
- Test final mechanism in MATLAB or Solidworks.
Here is MATLAB generated mechanism: (Also here @youtube with Solidworks)
Hope this helps, I wanted to help as much as I can because I've been experienced your suffer and it will be good to be informed when you are at the start.