Use Vin and normal output pins at the same time

"a sensor"
Which? What? Details.

"connected to Vin"
Why?

Time to break out the pen and paper, sketch out what you've done, take a decent picture of that and upload it as an attachment.