Non-Inverting (+) Input: Wire it to the phototransistor node (the collector of Q1 after [R1]).
Inverting (–) Input: Create a reference voltage from a resistor divider:
Use [R2] (10 kΩ) from 5V to the divider node.
Use [R3] (10 kΩ) from the divider node to Ground.
Connect the divider node to the inverting input.
Output:
The comparator’s output (typically the DO pin on U1) provides a digital signal. (If necessary, add an output pull-up resistor to 5V if not already included in the module.)
Connect this output to your STM32 input.
Additional Recommendation:
Place a decoupling capacitor [C1] (0.1 µF) between the U1 VCC and Ground to help stabilize the supply voltage.
You can now use the "Apply changes" option to update your schematic with these wiring suggestions.
Wirelessly connects nets on schematic. Used to organize schematics and separate functional blocks. To wirelessly connect net portals, give them same designator. #portal
General Purpose Thick Film Standard Power
and High-Power Chip Resistor
47 kOhms ±5% 0.125W, 1/8W Chip Resistor 0805 (2012 Metric) Automotive AEC-Q200 Thick Film
Features:
- RMCF – standard power ratings
- RMCP – high power ratings
- Nickel barrier terminations standard
- Power derating from 100% at 70ºC to zero at +155ºC
- RoHS compliant, REACH compliant, and halogen free
- AEC-Q200 compliant