I took the lens off my SLR and made a cardboard barrel so the focal length was about 65 mm. A hole in the lens cap would have been easier.
The problem with the 35 mm format is image size. You will be hard put to make a pinhole less that .35 mm so the f value will be about f 200.
Buy the time you enlarge to a usable image the fuzziness that some like to call soft focus is too fuzzy for my taste.
You can of course order a laser cut pinhole about as small as you want but I would suggest using a 120 format if you are building a camera. I have a 4x5 view camera that I am tinkering with but the shutter mechanism is my main concern.
This is about as good a shot as I could get with 35 mm format and a .356 mm pinhole.
View attachment 166583