I could never quite figure out the widest angle of view the D3400 body could allow deep inside past the flange. I know the math can be done, but I can't get in there and measure properly. The body caps I have allow for a maximum hole size of 41mm, under optimal conditions. The D3400 flange mount allows for 47mm I.D., but the AOV depth won't go that far due body design. I made the body cap hole 38mm.
I switched to using scrap cardstock instead of aluminum sheet metal & hot glue instead of JB Weld. Because these parts will not be taking stresses of any kind. I was able to make a funnel that fits the 38mm hole and can be as long as needed. I made it longer than I thought I'd need then cut it down by 0.5mm after each test. I started at 15mm focal length and ended up at 20mm focal length. Once the pinhole was properly aligned, I had to go to 20mm to prevent the body cap hole causing occlusion and prevent extreme vignetting.
This is the semi-finished product. I think the purple tinge, to the sides, is being caused by a light leak; unless there's some weird vignetting thing with pinholes and color I don't know about.. The hot glue is clear, unlike the dark JB Weld. Even though I used black spray paint over it, I think it is passing a fair amount of light through. I'll fix that tomorrow. One problem I did notice with these, the funnel really needs stepped-baffling or flocking inside. Even with the rough cardstock and flat black paint, it acts as a light funnel, causing all manner of light anomalies with bright patches of sky instead of only with bright lights. I'll figure something out for that.
Invasive Pinhole Cap Mark II
Focal Length: 20mm (30mm equivalent on 1.5x crop)
Optimal Pinhole Diameter: 0.1888mm
Actual Pinhole diameter: 0.1708 (error of 0.018mm; best for 16.4mm FL)
Image Diameter: 38.4mm (D3400 APS-C requires 28.21mm+)
Invasive into Camera Body to: 23mm
Angle of View: 42.6 (on 1.5x crop)
Sunny Day Exposure: 1/2 second at ISO 100