I can't find any way online to use transistor to have 24v on base and 5v from collector.
but all earth's are tied except arduino one.
are you saying put resistor before the transistor base
to drop voltage to 5v?
but add a resistor at the end ...
that would be a noise stable configuration?