[Solved] IR Sensor Not Working -- Extremely Low Signal Voltage  

  RSS
mr-doofus
(@mr-doofus)
New Member

While I'm saving up for an Original Prusa, I have been heavily modding what used to be an Ender 3 (mainly just because I like tinkering rather than any real need). My latest mod involved completely replacing the X, Z, and E axes with the MK3s design and cheap cloned parts. Everything works as expected except for the IR sensor. I am a mechanical engineer, not electrical, so I know just enough to drive myself insane trying to figure out why the IR sensor isn't working as intended. 

Expected Results:

- No filament present causes ~+5V from out/signal to ground

- Filament present causes ~0V from out/signal to ground

Actual Results:

- No filament present causes +0.01V from out/signal to ground

- Filament present causes 0V from out/signal to ground

 

I am using Marlin 2.0 firmware with an SKR Mini E3 V1.2, so the first things I check were that I set up the supply voltage and signal pins correctly. Using a multimeter, I confirmed that the IR sensor was correctly connected to +5V and ground. Then I used Pronterface and the M119 command to confirm that the signal pin was triggered correctly by shorting out the signal pin to +5V on the IR sensor. Next, I delved into looking at the on board circuit of the IR sensor. As I understand it,  the IR sensor works by a switching MOSFET. Drain is connected to signal, source is connected to ground, and gate is connected to the photosensor. When the photosensor is not blocked, the gate should be around 0V and when blocked, the gate should be around +5V. This should open and close the MOSFET which in turn supplies the signal output with ~0V or ~+5V which can then be interpreted by the mainboard. 

I measured the gate voltage while my photosensor was not blocked vs blocked and I recorded 0.2V and 5V respectively. This leads me to conclude that my photosensor is working correctly, but the MOSFET is stuck closed. Based on data sheets that I found for the MOSFET, the minimum threshold (gate-source) voltage is rated for 1V, so I am very confused why it would be closed at a gate-source voltage of 0.2V.  

After getting these results, I purchased a second IR sensor because I suspected I might have gotten a defective one, but I experienced the same results with the second IR sensor. 

The reviews from other customers who purchased the IR sensor stated that it worked fine as a direct replacement in their MK3s upgrades or clones. Is there something special in the MK3s firmware regarding this, or anything else I am missing? This one really has me stumped, so I would really appreciate it if anyone has any advice on if I am missing something or did/understand something wrong. 

Link: IR sensor that I purchased

Thanks,

Max

Posted : 06/11/2020 6:17 pm
--
 --
(@-2)
Illustrious Member

I'm just throwing out a SWAG here, but most sensors (well, many) are open collector and need a pull-up resistor to provide signaling. Left by themselves, the have no output voltage: instead, they need an external current source to act on.

It is always wise to get more than one opinion... as for trusting Prusa? No way man....
Posted : 06/11/2020 8:58 pm
--
 --
(@-2)
Illustrious Member

Looking at the schematics, the board does have a pull-up. So with the output wire pulled from the housing, the "out" should signal when you block the IR path. Unless of course it is plugged in backwards. Which version are you using? 0.1 or 0.4 ?

It is always wise to get more than one opinion... as for trusting Prusa? No way man....
Posted : 06/11/2020 9:08 pm
mr-doofus
(@mr-doofus)
New Member

@tim-m30

Thank you! While looking at the schematic (attached below) to determine if the IR sensor has a built in pull-up resistor (which I believe R3 is), I ran through my understanding of the circuit for what felt like the millionth time. While looking at it, I had the thought, "It's acting like the out pin is grounded" and the light bulb finally flicked on. Sure enough when I unplugged the sensor and took my multimeter to the mainboard pins, the signal pin on my board was shorting to ground. I suspect that if I took out the mainboard and checked the backside, I would find some solder connecting the signal pin to the adjacent ground pin, but I didn't want to go through all that so I just used a jumper to connect the signal from the IR sensor to a spare pin on the mainboard, updated the firmware to reflect this, and voila, works perfectly.

Glad to finally figure this one out, thank you for taking the time to respond and help out!

Best,

Max

Posted : 06/11/2020 11:11 pm
-- liked
Share:

Please Login or Register