An electric soap dispenser comprising: a housing ; a power supply supported by the housing ; a reservoir configured to store liquid soap (L), the reservoir being supported by the housing ; a pump disposed in the housing , the pump having an inlet connected to the outlet of the reservoir ; an electric motor supported by the housing and driving the pump , the electric motor being powered by the power supply ; a soap discharge nozzle connected to the pump with a soap conduit and disposed in the housing ; a sensor device comprising a light emitting portion and a light receiving portion, the sensor device configured to detect the presence of an object based on light from the light emitting portion that the object reflects back to the light receiving portion, the sensor device further configured to detect, with the light receiving portion, an amount of ambient light; and an electronic control unit connected to the sensor device and to the electric motor , the electronic control unit comprising an ambient light read module configured to read ambient light values when the object is not near the sensor device and to store the values corresponding to the ambient light detected by the sensor device as calibration values, the light read module comprising a routine that compares the calibration values to detected light reflection values received from the sensor device for light reflected back from the object to decrease the occurrence of false triggers; wherein the electronic control unit is configured to actuate the electric motor upon receiving a signal from the sensor device and determining that the detected light reflection values are more intense than the calibration values, the actuation of the electric motor driving the pump to dispense a predetermined amount of liquid soap (L) from the nozzle . a housing ; a power supply supported by the housing ; a reservoir configured to store liquid soap (L), the reservoir being supported by the housing ; a pump disposed in the housing , the pump having an inlet connected to the outlet of the reservoir ; an electric motor supported by the housing and driving the pump , the electric motor being powered by the power supply ; a soap discharge nozzle connected to the pump with a soap conduit and disposed in the housing ; a sensor device comprising a light emitting portion and a light receiving portion, the sensor device configured to detect the presence of an object based on light from the light emitting portion that the object reflects back to the light receiving portion, the sensor device further configured to detect, with the light receiving portion, an amount of ambient light; and an electronic control unit connected to the sensor device and to the electric motor , the electronic control unit comprising an ambient light read module configured to read ambient light values when the object is not near the sensor device and to store the values corresponding to the ambient light detected by the sensor device as calibration values, the light read module comprising a routine that compares the calibration values to detected light reflection values received from the sensor device for light reflected back from the object to decrease the occurrence of false triggers; wherein the electronic control unit is configured to actuate the electric motor upon receiving a signal from the sensor device and determining that the detected light reflection values are more intense than the calibration values, the actuation of the electric motor driving the pump to dispense a predetermined amount of liquid soap (L) from the nozzle . <EOS>