Hi all!,
I have a photodiode, and I want it to work in 2 ways:
-Connected to an ADC to obtain a value from light level.
-Connected to a transistor to obtain a digital signal 1/0.
The easy way will be to have 2 photodiodes, but itsn't possible.
I think in having to different scales with 2 voltage divider. Selecting R1 I'll have an analog reading the ADC, and selecting R2 I'll have a switching value, by the transistor, to obtain digital input for a GPIO.
In my circuit, I have a PCF8574 (I/O I2C expander) that work open drain.
How can I achieve it?
(circuit attached)
I have a photodiode, and I want it to work in 2 ways:
-Connected to an ADC to obtain a value from light level.
-Connected to a transistor to obtain a digital signal 1/0.
The easy way will be to have 2 photodiodes, but itsn't possible.
I think in having to different scales with 2 voltage divider. Selecting R1 I'll have an analog reading the ADC, and selecting R2 I'll have a switching value, by the transistor, to obtain digital input for a GPIO.
In my circuit, I have a PCF8574 (I/O I2C expander) that work open drain.
How can I achieve it?
(circuit attached)
Attachments
-
84.7 KB Views: 11
Last edited: