So I have a hall effect sensor that is used to calculate the RPM of a spinning object along with an Arduino. Right now it is wired to be powered by the 5v regulated power from the Arduino (not really -- it's a separate v-reg, but lets pretend) and sends it's result to a digital pin.
This all works great but what I would really like to do is have the sensor run off of the 12v power supply of the motor that spins the object. Bottom line I want to: * reduce the number of exposed wires since it's a bit of distance to the Arduino * save sleep mode power because power to the motor (and sensor) would be cut-off via a mosfet/transistor. i.e. when the motor is off, so is the sensor.
So I'm wondering if anyone could recommend a way to limit the power supply going back to the Arduino so I don't fry the pin (which is expecting max 5v not 12v). My initial thought is to set up some kind of voltage divider but in all honesty I'm not sure exactly how I would rig the resistors to do this. One before and after the sensor? One before the pin and one after the 12v ve+?
Thanks for any advice!