Back in 2012, I published the message below to a thread about using manual extension tubes with lenses that have a aperture ring and still be able to use the camera's metering. Then I did a follow-on post with pictures. I still use this technique - the comment about it working for only a specific lens is in regard to the extension tube / lens combination. It will work for any lens mounted directly to the camera body.
I've been watching this thread. There is an inexpensive solution that doesn't take a lot of mechanical ability or time to implement. The catch is that it works only for a specific lens. As many macro shooters always use the same lens, this shouldn't be a big deal.
There are two steps to use any PK-mount lens with aperture controls (sorry, no DA lens) on manual PK-mount extension tubes as though it was a directly mounted 'A' lens with full in-camera metering. #1- make your camera think that all lens are 'A' lens, and #2- tell your camera what your lens minimum and maximum aperture values are.
It takes five minutes to fool your Pentax dSLR into thinking all mounted lens are 'A' capable. It is totally reversible, but I have yet to have a reason to do so. It doesn't interfere with any of my lens.
https://www.pentaxforums.com/forums/pentax-k-r/178928-kr-short-contacts-chang...ml#post1867401
Next, you have to do some minor alteration to the extension tube that is directly mounted to the camera body. Again, it is reversible if need be. If you are using multiple tubes, you probably only need to do this to your shortest tube, and always mount that one to the camera body first. But it is no big deal one way or the other if you modify all your tubes.
#1- remove any insulating paint from the tube's mounting flange. This will cause all the contacts on the camera body to be shorted (other than the 'A' contact, but you fixed that with the above instructions).
#2- note the minimum and maximum apertures for your lens.
Go to this site and use the matrix to determine which contacts should be insulated so they are not shorted.
#3- DON'T use the site's advice to drill shallow divots in your extension tube mount. Sure it works, but the change is permanent.
#4- use very narrow pieces of magic tape to mark which contacts need to be insulated. Place them on the camera body so they are seen outside the mounting flange.
#5- mount the extension tube you prepared in step 1 without insulation on the mounting flange. Now take additional narrow pieces of magic tape and stick them on the side of the tube carefully aligned with the pieces of tape on the camera body.
#6- unmount the extension tube. Place a small piece of magic tape on the mounting flange carefully aligned with the tape on the side of the extension tube. This tape should be no wider than the lens contact point on the body.
#7- remove the tape from the camera body. Carefully remove the tape from the sides of the extension tube. Make sure the tape on the extension tube mounting flange is tightly pressed into place. Trim away any excess tape.
When you mount the extension tube on the body, I suggest pressing in the lens release button before seating and turning the tube. Once the tube is fully seated, release the button and turn the tube backward to make sure it is locked in place. This seems to minimize the chance that you will rip the insulating pieces of tape off the extension tube. Mount the other tubes and/or lens.
You are going to use manual exposure. Set your lens to its maximum aperture. Meter your subject. Lock the exposure on your camera or use manual exposure. Note the aperture shown on your camera body, and set a matching aperture on the camera lens. You don't need to adjust for the light loss caused by the tubes. Your camera will assume it is simply a darker subject. If you do need to adjust exposure it will be for the standard artistic reasons.
make your own auto tube, follow-up
https://www.pentaxforums.com/forums/22-pentax-camera-field-accessories/113756...ml#post1965895