Well I guess the diode is the way to do it. Nice to come up with a bettter solution though, maybe something a bit more accurate.

BTW what is the voltage drop on that diode?... most are around 1 volt, how do you conpensate for it?

.