I would like to trigger different functions in Arduino related to the following voltage values: -12V, 0V, 6V, 9V, 12V (the range is from -12V to +12V).
According to the value of the voltage read (-12V, 0V, 6V, 9V, 12V) I have to show instantly different light animations on a LED strip.
Considering that the Arduino is not able to read a such voltages directly, I suppose that probably I have to use a voltage divider, but I don't know how to calculate the resistors to use. Can anyone help me?
I was suggested also to use 1 dual op amp do the following:
Create inverting amplifier with a gain of 1, but insert a offset of 12V to the + (non inverting pin), this will max your -12 to 12V range change to a -24-0V range.
To the output of stage 1, connect another inverting amplifier with gain of 0.2 you would get a a positive voltage range of 0-4.8V which is fine to work with the arduino's 0-5V ADC tolerance.
What do you think about this idea?