Taking photos with a phone is challenging. Steady is key. I use a digital microscope stand to help. I place the camera on where the microscope fits which then makes the lens (for my phone anyway) hang over the side. It's a quick setup and works for simple "hey, look at this" shots. But it's doesn't give you good control over zooming or focus.
When I tried my Nikon D5100 DSLR on a tripod (always use a tripod!) I found it was 100x better overall. The problem was fine focus and lighting which are both more easily addressed with a DSLR in manual mode.
My tripod has a center column which can raise and lower the camera. This gives the ability to fine focus the camera when it is pointing down. For the initial focus I start by putting the lens into auto focus mode. Once the camera auto focuses I switch the lens into manual focus. Then I use Live view to zoom all the way in on some detail of the coin (lines, dates, words, edges, etc). I use the center column crank to raise the camera up until it is just out of focus. Then I very slowly lower the camera until the focus is acceptable. Another detail to keep in mind is the camera and coin should be level to each other. If they are not then one part of the coin will be focused and another will be out of focus.
Here is an example of one of the first shots I made doing this. Notice that the bottom is in good focus while the top of the coin is out of focus. This is the example of what happens when the camera and coin are not level. Clicking the photo will display the original size which is pretty big. The camera is a 16mp camera.
