Don't try to measure the received power of the photodiode, smack that IR LED with 30-100KHz and detect the frequency at the receiving end with an IR receiver IC. It's *much* easier. If you see 38KHz, then there's no obstruction. If you don't, it's blocked.
I got stuck trying it your way (long ago) 'cos the design was already in production, and it never did work right in varying light conditions. I could change the software to drive the LED with a pulsed signal, but had no way to detect it at the receive end. It was a trivial change to the circuit but they didn't want to do a recall on all of the machines since they were scattered all across the USA.
If you're still in the design phase, try one of the IR receiver chips that has the ~40KHz bandpass filtering built-in, and your job is nearly done. I'm looking at one right now that runs a 38KHz bandpass filter. EDIT: a quick look at Digikey shows that today's frequency range is 20-60KHz with the majority of the parts running 30-40KHz bandpass, so that's your sweet spot for price. Here's one for example:
https://www.digikey.com/product-detail/en/vishay-semiconductor-opto-division/TSSP4038/TSSP4038-ND/3789836(datasheet is on that page, too)
As a side benefit, you can drive the LED much harder if it's 10-30% duty cycle, giving you extended range and/or better immunity to varying light.
Google: ir receiver bandpass filter agc gets 14,000 hits.
Edit 2: In case I wasn't clear, the OUTPUT of these IR receiver chips is either high / open collector or low, showing that it's received the transmitted frequency or not. You don't have to decode anything, just use the high or low output.