Accurate onboard ADC reading + WiFi // is it even possible?
Posted: Mon Feb 20, 2023 11:50 pm
Hello,
I'm trying to use ESP32 to modulate throttle response and provide a dashboard for an ebike. I need to read throttle voltage, battery current, do some calculations and output the new voltage, and also read battery level and show speed/RPM from a hall sensor pulse. And I need to make some settings from the throttle adjustable via WIFI (power modes)
Space is very limited and I could not fit an ADC in the project.
Throttle values are 0.9-4.1v, I'm using a voltage divider with two 10k resistors.
Current sensors are 2.5v-4v, R1 and R2 are 10k.
Battery voltages range from 59-86v, R1 is 40k, R2 is 1k.
Hall sensor pulses 3.3v, I'm using a pulldown resistor.
My ADC readings are a complete hell, I get 0 and 4095 readings all the time, so I could not find any way to filter out the noise and get any readable value. (EMA, SMA, median...)
ESP32 is powered with a 5v buck conversor which also powers current sensors, and it is powered by the ebike battery (so a lot of voltage sag when using throttle).
Is there any hope to get ADC readings from internal ADC? If so, should I make any changes in the circuit? Use bigger resistor values? Use a 3.3 voltage regulator on ESP32 Vin?
I really have no clue on what to do and would really appreciate any help provided.
I'm trying to use ESP32 to modulate throttle response and provide a dashboard for an ebike. I need to read throttle voltage, battery current, do some calculations and output the new voltage, and also read battery level and show speed/RPM from a hall sensor pulse. And I need to make some settings from the throttle adjustable via WIFI (power modes)
Space is very limited and I could not fit an ADC in the project.
Throttle values are 0.9-4.1v, I'm using a voltage divider with two 10k resistors.
Current sensors are 2.5v-4v, R1 and R2 are 10k.
Battery voltages range from 59-86v, R1 is 40k, R2 is 1k.
Hall sensor pulses 3.3v, I'm using a pulldown resistor.
My ADC readings are a complete hell, I get 0 and 4095 readings all the time, so I could not find any way to filter out the noise and get any readable value. (EMA, SMA, median...)
ESP32 is powered with a 5v buck conversor which also powers current sensors, and it is powered by the ebike battery (so a lot of voltage sag when using throttle).
Is there any hope to get ADC readings from internal ADC? If so, should I make any changes in the circuit? Use bigger resistor values? Use a 3.3 voltage regulator on ESP32 Vin?
I really have no clue on what to do and would really appreciate any help provided.