Unleashing ESP32 Enterprise potential

powerbroker
Posts: 35
Joined: Sun May 19, 2024 12:58 pm

Unleashing ESP32 Enterprise potential

Postby powerbroker » Tue Apr 22, 2025 4:20 am

despite the fact ESP32 platform has quite significant shortcomings, one of which is definitely an extremely suxy ADC, it can be used in industrial devices and even in measuring instruments. let me show a prototype of an industrial voltmeter 0..10V with recalculation into absolute pressure:
IMG_20250422_043713.jpg
IMG_20250422_043713.jpg (149.36 KiB) Viewed 8268 times
of course, the MCU alone is not enough for this purpose. the capabilities of debug boards are also largely the same. so, here the DevKit V1 is equipped with:

  • op-amp ADC input buffer, capable of mixing input value with ESP32 DAC output
  • schottkey diodes protecting ESP32(ADC) inputs
  • 24V -> 8V step-down, allowing to use LCD's with 7-8V background LEDs - e.g. LPH9157-2(used in Siemens x75 mobiles) without extreme power loss on current limiting resistor.
  • ... and LPH9157-2-pinout 3.3V SPI connector
  • 8V -> 5V LM7805 linear regulator, providing low noise 5V at much lower than 24 -> 5 regulating power loss and overheating.
  • 3.3V and 5V I2C connectors to use e.g. HD44780 LCDs with I2C adapter.
  • 7 Touch capable GPIOs + GND connector - to use push button or capactive matrix keyboard
  • 5V supply output and UART connector to an LCD/Touch panel(e.g. Nextion).
IMG_20250422_043936.jpg
IMG_20250422_043936.jpg (146.3 KiB) Viewed 8268 times
ESP32 built-in ADC does not suck so much so it only can be thrown away without any doubts. even if using a precise external chip is a good option(and set of DMA-backed hardware interfaces makes it's interaction easier), MCU's on-board RAM size and CPU power gives a chance to even such a suxy ADC, thanks to oversampling and polynomial correction. the price is complex calibration of each ADC requiring calculation of it's own polinomial coefficients(that's why the prototype shows absolutely wrong voltage when not calibrated). in practice, applying square trinomial approximation gives an acceptable result without burdening one CPU core with too complex calculations, while another core takes care of user interaction.
oversampling is the place where capability to mix input value with DAC output takes part, since it requires ~2-3 LSBs noise.

such devices often provide power supply for connected sensors, so easy to replace single-voltage 24V source is used to supply everything. capability to detect sensor-identifying resistor value with MCU on-board ADC is also implemented.

fortunately, they say there is 1 more UART in ESP32, so let us hope adding (DMA-capable) RS-485 is not a problem.

having put everything together, we get the functional filling of 0..10V measuring device, which only needs a housing:
IMG_20250422_043433.jpg
IMG_20250422_043433.jpg (157.17 KiB) Viewed 8268 times

and it would be absolutely trerific if:
  • MCU pins were 5V-tolerant
  • ADC linearity and precision was competitive
  • developing firmware for such a device was as painless as developing its electronic part ;)

User avatar
jgustavoam
Posts: 173
Joined: Thu Feb 01, 2018 2:43 pm
Location: Belo Horizonte , Brazil
Contact:

Re: Unleashing ESP32 Enterprise potential

Postby jgustavoam » Tue Sep 30, 2025 1:05 am

I suggest you study about Dual-slope ADC converters, the same ones used in current Digital Voltmeters.
This Dual-Slope ADC technology is old, but still widely used because it is very accurate, simple and cheap.

The principle of the dual-ramp digital voltmeter was created in the late 1950s, and the first commercial instruments began to appear in the early 1960s.
https://patentimages.storage.googleapis ... 051939.pdf

Good reference for Dual Slope ADC at the end of the article.
https://wiki.analog.com/university/cour ... cs-lab-adc

What do you think about integrating an Dual-slope ADC circuit into the ESP32?
Retired IBM Brasil
Electronic hobbyist since 1976.

Who is online

Users browsing this forum: No registered users and 1 guest