I'm building a window blinds system. I have an arduino powering a motor via a DRV8833 Dual-H bridge controller. At the limits of each direction of motion, I have limit switches that kill the power to the motor in that direction. I also want the arduino to read when the limits are hit, but I can't feed the raw power from the limit switch into an input pin as it will exceed the 3.3V logic inputs.
I've got what I'm calling forward working with an NPN transistor to feed 3.3V logic when its corresponding limit switch is hit. However I'm really struggling figuring out the wiring to determine when the reverse limit switch is hit. In that case you end up with a negative voltage in a sense coming from the limit switch. I've had a couple of random configurations that seemed to work, but not consistently. I'm attaching diagram of what I have in place currently. In this diagram, I'm representing the reverse and forward directions separately with reversed voltage sources even though in practice, the two limit switches are next to each other between the DRV8833 and the motor (represented by lamp). I have diodes across the limits to allow motion in the opposite direction when a limit is hit. I have Q8 being activated when SW7 is hit and the arduino pin reads the switch activation. I need help getting SW5 to indicate to the arduino when it's been hit. Note resistors are just default ratings in diagram.