Using a zener diode and a bjt to regulate voltage received by a controller
I mentioned my problem to a teacher, who told me about an op amp that I wasn't aware existed, the LM339. Apparently, arranged like this will produce the desired result (a simple voltage divider can be used to calculate the values of R1 and R2):

Output Inacticve:


Output Active:


Anyway, thanks for the comments and suggestions! I guess I just had the wrong idea to begin with, which is what I was afraid of. I think it was @evildemonic who mentioned a comparator, which hit the nail on the head.