Arduino needs to know, how many degrees or radians to the left or to the right the handlebar is compared to the body of the bicycle.
What would be an easy to use and install sensor? A range of +-30 degrees would be enough and the resolution could be e.g. 256 values for that range, or analog value. (Calibration could be done programmatically.)
Would a gyroscope be a good solution? (drift of the 0-point, "straight ahead"?)
One could use a potentiometer and read its value with AD-converter. But I suspect that any potentiometer would wear out soon in the constat motion of the handlebar.
My first try would be a potmeter just to get feeling how good it works.
normally a pot == 270° so 30° is 1/9 implying an analog range of 1/9 of 1023 ~~ 110 values. Given you have 1 bit noise brings this down to 55 values.
That is too little, but by setting the AnalogReference() of the ADC to 1.1V (INTERNAL) you will get 55 * 5 /1.1 is approx 250 (500) distinct values .
See - analogReference() - Arduino Reference -