An idea in an earlier blog is to make a pwm interface that can accept 5, 12 and 24V pulse streams. That one uses a bunch of resistors and has three separate inputs. Below that, wise commenter DB ...