Digital distance sensor output option

I have lots (~20?) of #4050 digital distance sensor on my train track that tell me when a train goes by. The issue is that they all go into a raspberry pi (either 4, 5, or pico), so I need 3.3V compatibility. But if I power the sensors at 3.3V, startup is unreliable because of the long wires powering them (an extra capacitor at each fixes that; there’s a forum topic about it).

So, what I’d like to do is power them at 5V and translate to 3.3V on the way to controller. There are many ways to do that, but a super cool way would be if I could remove a shunt (or do something) on the sensor so it’s output changes from driven to open collector. Then I could wire directly and set the pi’s input to pull up.

I don’t know how the output is driven - whether it’d take more components or could be something really simple. But if easy to do it would make my use case much simpler (5V power to the sensor, 3.3V input back at the micro).

I notice the sensors were recently re-spun, and I’m looking at a new layout where sensor startup seems to have gone intermittent, which made me think of this again. (I had hoped the wires on this one were not too long, but I guess they are.)

Hello.

Thanks for the suggestion. Unfortunately, it is not possible to modify our current digital distance sensors like that, but I passed this around to other engineers here so we can keep it in mind for future products. If anyone else reading this thread wants sensors like these with different outputs, we’d be interested in hearing from you too.

For now, my suggestion would be to continue using the caps, or alternatively, you could power the sensors with 5V, then use an appropriate voltage divider or level shifter at the Raspberry Pi to reduce the 5V signal to 3.3V or less.

- Patrick