An arrangement for controlling performance of a phototransistor in an electronic circuit, where the phototransistor is configured to be sensitive to light, the arrangement comprising: - a positive supply voltage (V cc) port and a ground port where the phototransistor is connected in the electronic circuit between these ports indirectly, - wherein the phototransistor is coupled via a main resistor (R L) to the positive supply voltage (V cc) port, - wherein an external bias resistor (R L2) is connectable in parallel to the main resistor (R L) so that the external bias resistor (R L2) and the main resistor (R L) are both connected to a collector of the phototransistor, - a microcontroller which is configured to switch on the external bias resistor (R L2) at a time by an output signal of the microcontroller, - a switch connected in series with the external bias resistor (R L2), where the switch is configured to be controlled by the microcontroller, or the external bias resistor (R L2) is connected directly to a microcontroller output port where the microcontroller directly controls this output branch by supplying a desired voltage via the output port to the external bias resistor (R L2), - so that when the electronic circuit is configured to be switched on, the microcontroller switches the external bias resistor (R L2) on by the switch or by the direct voltage supply, between the phototransistor and the positive supply voltage (V cc) port, for a time period enabling a bias to set for the phototransistor, and - when the bias has been set, the microcontroller is configured to switch off the external bias resistor (R L2) from the electronic circuit by the switch or by the direct voltage supply, while maintaining the connection through the main resistor (R L) active, during an actual measurement after the biasing. - a positive supply voltage (V cc) port and a ground port where the phototransistor is connected in the electronic circuit between these ports indirectly, - wherein the phototransistor is coupled via a main resistor (R L) to the positive supply voltage (V cc) port, - wherein an external bias resistor (R L2) is connectable in parallel to the main resistor (R L) so that the external bias resistor (R L2) and the main resistor (R L) are both connected to a collector of the phototransistor, - a microcontroller which is configured to switch on the external bias resistor (R L2) at a time by an output signal of the microcontroller, - a switch connected in series with the external bias resistor (R L2), where the switch is configured to be controlled by the microcontroller, or the external bias resistor (R L2) is connected directly to a microcontroller output port where the microcontroller directly controls this output branch by supplying a desired voltage via the output port to the external bias resistor (R L2), - so that when the electronic circuit is configured to be switched on, the microcontroller switches the external bias resistor (R L2) on by the switch or by the direct voltage supply, between the phototransistor and the positive supply voltage (V cc) port, for a time period enabling a bias to set for the phototransistor, and - when the bias has been set, the microcontroller is configured to switch off the external bias resistor (R L2) from the electronic circuit by the switch or by the direct voltage supply, while maintaining the connection through the main resistor (R L) active, during an actual measurement after the biasing.