+
+Lights:
+1 - front light
+2 - rear spotlight
+3 - rear LED strip
+
+PWM1
+PWM2
+PWM3
+SENSE1 - light 1
+SENSE2 - light 2
+SENSE3 - light 3
+SENSE4 - ambient light sensor
+SENSE5 - battery voltage sense
+SW1 - mode switch
+SW2 - temporary light boost or whatever
+LED1 - speedometer illumination LED
+LED2 - status LED
+
+
+ADC
+single-ended resolution:
+0.00107 V .. 1.1 V
+differential resolution 8x gain:
+0.00013 V .. 0.1375 V
+differential resolution 20 gain:
+0.000054 .. 0.055 V
+differential resolution 32x gain:
+0.000036 .. 0.03438 V
+analog input resistance 100 MOhm
+
+LED current sense, 0.033R sensing resistor:
+ min gain max gain
+ 20 mA => 0.00066 V 8x
+ 100 mA => 0.0033 V
+ 150 mA => 0.0050 V
+ 300 mA => 0.0099 V
+ 350 mA => 0.0116 V
+ 700 mA => 0.0231 V
+ 1000 mA => 0.0330 V 32x
+ 1500 mA => 0.0495 V 20x 0.0495 W
+ 2000 mA => 0.0660 V 8x 0.066 W
+ 3000 mA => 0.0990 V 8x 0.1 W
+
+Battery sense
+range 5-15 V
+1.5M..15k
+cca 10 uA @15V
+ 3.3 uA @5V
+
+Ambient light sense
+20 lx -- cca 333 kOhm
+200 lx -- cca 35 kOhm
+
+lx:
+1lx == full moon
+400 lx == sunset/sunrise
+10 klx == full daylight
+
+need probably 1-1k lux scale
+
+Photodiode:
+5 V, 1M5 resistor + photodiode: voltage at the photodiode
+darkness: 3.71 V => 4.31 MOhm
+bathroom without lights, only outside lights: 3.68 V => 4.18 MOhm
+kitchen light: 3.29 V => 2.89 MOhm
+bathroom halogen lights 0.02 V => 6 KOhm
+battery light: 0.01 V => 3 KOhm