I got a used Pentax one from KEH in EX+ condition for $10-12.
While they are fairly simple to make a lot depends on the quality of the components which affects the quality of the output. If it drifts too far out of the specs it could cause problems.
Here are some DIY instruction with parts list if you want to make your own. The adapter for the K10D/K20D is works with all the other bodies - the power connector being the a possible incompatibility.
https://roamingdrone.wordpress.com/2008/09/26/diy-ac-adaptor-for-the-pentax-k10d/