Closed pengiundev closed 5 years ago
The second resistor completes a voltage divider. The brake/throttle inputs can deliver up to 5V (really 4.9V) when fully pressed; the Electron only reads up to 3.3V (even though the pins are 5V tolerant).
You don't have to implement the voltage divider, but once the input delivers 3.3V or more it won't matter how much further you pull the throttle (or brake) because it will be read at full speed anyways. From what I remember when testing this, 3.3V delivers an analog read of 4095 on the Electron as does 4.9V. Thinking about it, the Electron might actually read up 4V, but either way your losing some of the range when pressing the brake/throttle sensors.
So if you don't implement the voltage divider, your brake and throttle inputs will only work up to the 3.3V (or 4V) which equates to pulling the lever roughly 2/3 (or 4/5) of it's possible range.
Thank you for the very detailed explanation! It's perfectly clear now :)
Hello, can someone explain why we need the second resistor?