A driving device configured to drive a light-emitting device configured to regularly or irregularly repeat a turning-on operation and a turning-off operation, the driving device comprising:
- a processor;
- an analog switch;
- a voltage source;
- and
- a digital switch,
- wherein the light-emitting device comprises:
- a light-emitting element driven by using a pulse;
- the processor;
- a switching power source of a current-output-controlled type configured to control current-output thereof on the basis of a current value designation signal output from the processor;
- a condenser configured to smooth an output voltage of the switching power source;
- a switch configured to turn on and off a current input into the light-emitting element on the basis of a turning-on designation signal output from the processor;
- and
- the voltage source configured to adjust a voltage of the condenser,
- wherein the processor comprises:
- a first digital-to-analog comparator configured to output an analog signal so as to set the current value designation signal corresponding to a value of a current that flows in the light-emitting element when the current is in an ON state;
- a first PWM circuit configured to output a first PWM signal corresponding to the turning-on designation signal to the switch and turn on and off the current that flows in the light-emitting element;
- an analog-to-digital comparator configured to measure the output voltage;
- a storage medium configured to store thereon the measured output voltage as a reference voltage;
- a second PWM circuit configured to output, as an amplifier-output signal to the digital switch, a second PWM signal that has the same cycle as that of the first PWM signal and is in synchronization with the first PWM signal;
- and
- a second digital-to-analog comparator configured to output the reference voltage stored on the storage medium to the voltage source,
- wherein the analog switch is configured to cause the current value designation signal to coordinate with the turning-on designation signal,
- wherein the voltage source is an operational amplifier configured to compare the reference voltage input into a positive input terminal thereof with the output voltage input into a negative input terminal thereof and output a current such that the reference voltage and the output voltage are the same,
- wherein the digital switch is configured to connect an output terminal of the operational amplifier to an output terminal of the switching power source when the amplifier-output signal input into the digital switch is at a high level,
- wherein the first PWM circuit is configured to turn on the turning-on designation signal,
- wherein the analog switch is configured to turn on the current value designation signal at the same time as the turning-on designation signal is turned on so as to turn on the light-emitting element, the current value designation signal corresponding to a value of the current that is controlled in accordance with the analog signal and flows in the light-emitting element when the current is in the ON state,
- wherein the analog-to-digital comparator is configured to measure the output voltage in a turning-on period of the light-emitting element and store the measured output voltage on the storage medium as a reference voltage,
- wherein the first PWM circuit is configured to turn off the turning-on designation signal,
- wherein the analog switch is configured to turn off the current value designation signal at the same time as the turning-on designation signal is turned off so as to turn off the light-emitting element, and
- wherein the voltage source is configured to compare the reference voltage input into the positive input terminal with the output voltage input into the negative input terminal and output a current to the condenser so as to adjust the voltage of the condenser such that the reference voltage and the output voltage are the same in a period during which the second PWM circuit turns on the digital switch by outputting the amplifier-output signal at the high level immediately before the light-emitting element is next turned on.