schematic for smd version extended with variable gain and offset polarity