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.
Accurate onboard ADC reading + WiFi // is it even possible?
-
- Posts: 9772
- Joined: Thu Nov 26, 2015 4:08 am
Re: Accurate onboard ADC reading + WiFi // is it even possible?
That sounds like a very noisy environment indeed. Perhaps some capacitors on the ADC pins can help a bit in cleaning up the signal? (Something like 100nF should be sufficient.) Another trick, especially for slower-moving signals, is to take lots of measures and average them to get rid of the noise.
Re: Accurate onboard ADC reading + WiFi // is it even possible?
I tried with a electrolytic between ADC pin and GND and also added another one between VIN and GND, zero results. I've ordered ceramic and they should arrive in two days. (Tomorrow is a national holiday here)ESP_Sprite wrote: ↑Tue Feb 21, 2023 12:23 amThat sounds like a very noisy environment indeed. Perhaps some capacitors on the ADC pins can help a bit in cleaning up the signal? (Something like 100nF should be sufficient.)
Re: Accurate onboard ADC reading + WiFi // is it even possible?
What does the signal look like on an oscilloscope?
-
- Posts: 1750
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Accurate onboard ADC reading + WiFi // is it even possible?
Is there any correlation with the actual input signals in the readings at all?I get 0 and 4095 readings all the time
Re: Accurate onboard ADC reading + WiFi // is it even possible?
Can you correctly read a fixed voltage (say from a 1.5V battery) on one of the ADC pins to verify that the ADC is correctly configured?
Are you using ADC2? Note these limitations: https://docs.espressif.com/projects/esp ... imitations
Are you using ADC2? Note these limitations: https://docs.espressif.com/projects/esp ... imitations
Who is online
Users browsing this forum: Baidu [Spider] and 65 guests