I put this together originally for my modded Rx8, but I figure other people will find this helpful.
Here is the thread on Rx8club which has the code:
DIY: Adding new Parameters (sensors) to OBD2 for logging. - RX8Club.com
And here is a video I put together explaining how it's done and showing it in action: