Need to make an object detection system, and while using a classic IR obstacle avoid sensor, I get what I want. But, I wanted to make it more compact, so I designed a PCB with smaller LEDs while using the Waveshare schematic:
The idea is to set the threshold with a pot so there is an LED just like in the original schematic. What I get is, it does not work, as when I turn the pot, it lights the LED in a lower position without any object in front. But I can not make it detect any object no matter the pot position. I printed the 3D housing to separate two LEDs, but no luck. LEDs are positioned some 1mm next to each other, but I separated them with a 4mm height of a 3D printed housing.
The '393 output is
That output transistor can sink current or not sink current. For a change of state to be detected there needs to be some load. Typically a pull up resistor, but could be something else of course; LED or another transistor.
How is the output of the comparator monitored in the Waveshare schematic? Sticking a 'oscope probe, for example, on that output will not see any significant change. You may see a few mV only due to leakage,
No, LED4 is a photodiode. The one from the above link. U2 is IR LED.
There is no code as there is no MCU. I just want to get LED attached on ch0 ON or OFF. That OUTA should go HIGH if INA- and INA+ are in correlation with the pot and IR Receiver (photodiode).
My bad, I missed the LED from the schematic when I crop it. Sorry.
There is an LED on ch0. That one should be ON when there is the detection of IR. On a PCB there are only those components, and two wires to a bench power supply. Nothing else. It should turn the LED ON when there is detection. The distance should be set with the pot.
I double-checked if I soldered them wrong. Not sure what else to check.
How to see if the IR transmits? To eliminate one thing.
Back to the "IR receiver", that is the component labeled Q1 on the Waveshare circuit and LED4 on your circuit. Q1 appears, from the symbol used, to be a photo transistor. LED4 appears, again from the symbol, to be a photo diode.
A photo transistor and a photo diode behave differently from each other and require different circuits. The photo transistor conducts in the presence of light and, in that circuit, will tend to pull INA+ of the comparator down. The photo diode (or indeed an IR LED) generates a small voltage (photovoltaic effect) in the presence of light and, in that circuit, will allow INA+ of the comparator to be pulled up.
What is the part number of your LED4 ?
You asked for the LED4 part number. I was 100% sure I posted this link, too:
I just tried on LCSC, but couldn't find a phototransistor. Not sure what else to type in the search box. I must try to use this Waveshare sensor to check my design, by covering the photo receiver. To try to receive the IR from one to another board. Just to eliminate one thing.
This phototransistor appears to be available on LCSC: TEMT1020
Your circuit may work with using a photo diode (or even an IR LED which also responds to IR light) but then the resistor is probably too low. Maybe it would be more responsive with 100k. You'd also have to accept the inversion (or swap the positions of the resistor and the diode).
Edit
This, which you have quoted, is called a photo transistor in parts of the data sheet:
Be aware that a photo transistor and a photo diode have different schematic symbols and it will cause confusion if the wrong one is used.
The next experiment...
I just put tape on the IR LED of the module and try to see if it can "catch" the IR light from this small IR LED of my design. Nothing.
Then I tried vice versa. Nothing.
As I mentioned earlier, there is no MCU here, only an LED to see if it works. But it doesn't.
Any suggestion on what should I do? Any suggestion to try another design? If so, please point me to which one. I need this in a smaller form factor, but for a range of a few centimeters.