Hello,
I am working on a project that uses a microcontroller to make a decision based on the input voltage. The input comes from a 12V battery bank. The microcontroller will be used to turn lights on or off depending on what the battery voltage is. For example. If the voltage is this much, turn this light on, if the voltage is now this much, turn the first light off and turn this light on, etc... The microcontroller only accepts an input from 0-5V. So how do I build a circuit that will have an output from 0-5V and an input from 0-say 13.6V. I know I could use a voltage divider circuit and then have the controller do the math to calculate the voltage but is there any other way that some of you electronics experts may be able to come up with to do this.
Thanks for all your help.
I am working on a project that uses a microcontroller to make a decision based on the input voltage. The input comes from a 12V battery bank. The microcontroller will be used to turn lights on or off depending on what the battery voltage is. For example. If the voltage is this much, turn this light on, if the voltage is now this much, turn the first light off and turn this light on, etc... The microcontroller only accepts an input from 0-5V. So how do I build a circuit that will have an output from 0-5V and an input from 0-say 13.6V. I know I could use a voltage divider circuit and then have the controller do the math to calculate the voltage but is there any other way that some of you electronics experts may be able to come up with to do this.
Thanks for all your help.