I am doing a project where I am using a FPGA board which connects to a circuit I designed. It has a quad Comparator (LM339N), a few resistors and an LDR; two distance sensors (GP2Y0A51SK0F) are connected to it by wires, and the circuit gets it's voltage from the FPGA board (DE0-Nano, 4.80V). The comparators are also powered by the 4.80V from the board.
As you can see, the output of each distance sensor (this sensor only has 3 pins, I couldn't make the fourth hidden) goes to a comparator. The point was to turn the distance sensor into a proximity sensor and output '0' when it sees something at a certain distance. The FPGA then receives that '0' and acts. Somewhat the same with the LDR.
I can confirm everything worked when I used two different voltages supply when I tested this - one being 5V that goes into the distance sensor and one 3.3V that goes to the comparators. Both 3.3V and 5V came from a DC power supply.
Now, I'm using the DE0-Nano to supply power, the only source being one pin of 4.8V and one pin of GND. As you can see from the schematic, everything has one single power supply.
My problem - things are not working with the distance sensors; Trying to measure voltage at the output of each of the sensors I just get 0V, so obviously the comparators output nothing as well. I'm using a multimeter to try and check what the problem is, and when I tried to check for shorts (with a mode called continuity, I think), one of the following may happen (or together):
- A short between VCC and GND - but there is no physical connection between them, I check that with resistance mode.
- A short between the VCC and GND pins of the LM339N
1 and 2 will never happen at the same time.
- A short between one of the outputs of the comparators (U1 or U2) and VCC. When this happens, The 3K pull-up resistors are also a short.
Like I said, there is no physical connection between VCC and GND so I assume that the short the multimeter is seeing is due to pins having the same potential? Is it possible that the pull-up resistors are too small and that is why this problem happens? Is it possible that I fried the distance sensors?
Thank you for your help, I have been testing this for days and trying to figure out what the problem is.
Edit - here are a few screen shots from scope:
The output stays like this no matter what, so it doesn't really seem like it is working. maybe the amplitude is increasing but I don't think it matters (it could also be the other sensor and I don't remember).
Those screen shots are from one sensor only - the other shows different results, but when checking their output, none seems to actually respond.