Add reference voltage 5300 and fix bug in calculation for 5000
Improve code for handling op amp gain, change relevant constants.