Codementor Events

ESP32 resets

Published Oct 12, 2021

(English below the images)

En el foro de Mongoose-OS y algunos chats se leen pedidos de ayuda por problemas al conectarse a una computadora diferente, al cambiar el cable USB, al usar una fuente de alimentación/cargador “genérico”… Evidentemente se trata de módulos y en la mayoría de estos casos tienen un conector USB con el cual se somete a ambos a tortura mutua. Veamos a qué pueden deberse estos problemas.

El ESP32 no es particularmente un micro de bajo consumo, y menos sabiendo que tenemos un radio Bluetooth (no sólo BLE) y otro WiFi. Recuerdo haber leído hace algunos años acerca de corrientes del orden de los 100mA, una rápida consulta a la hoja de datos se detiene en un parámetro extraño que estaría mejor en una guía de diseño que una hoja de datos, algo así como “mínima corriente que debe entregar la fuente de alimentación” (como si esto fuera una característica o parámetro del micro…). Su valor es de 0,5A; es decir, el fabricante sugiere que nuestra fuente de alimentación debe proveer como mínimo 500mA. Esto está en los límites del USB tradicional, pero si miramos las imágenes que siguen a continuación veremos que tanto en el arranque como al iniciar el soft-AP o conectarse a una red WiFi existente, el ESP32 toma corrientes elevadas por períodos muy breves. Esto, sumado a cables finos, y largos, es una excelente receta para el desastre. Si bien la medición es bastante “sucia”, dado que se trata de un resistor de .47 ohms en serie con un módulo ESP32-WROOM-32, podemos allí observar como pasamos de la centena de mA al medio ampere en cuestión de microsegundos; -L di/dt.

(pseudo-amarillo: fuente de alimentación, cian: alimentación del micro, magenta: resta de ambos)

At the Mongoose-OS forum and some chats there are several cries for help, people is having trouble when changing computers, swapping USB cables, or switching to a walwart adapter… These are modules, of course, and mostly have a USB connector. Let’s see what can be causing these issues.

The ESP32 is not particularly a low-power microcontroller, not if we know it has a Bluetooth radio (not just BLE) and a WiFi radio. I remember reading years ago figures about currents around 100mA; a quick browse to the datasheet pauses on a strange parameter that could belong better to a design guide, something like “minimum current delivered by the power supply” (as if this were a characteristic or parameter belonging to the microcontroller…). Its value is 0.5A; that is, the manufacturer suggest our power supply must be capable of delivering at least 500mA. This is at the limit of traditional USB, but if we take a look at the images above (right below the spanish text… yes, those), we’ll see that at startup, soft-AP start, and WiFi network connection, the ESP32 has high current spikes, drawing high currents for brief amounts of time. This, added to thin (and long) wires, is an excellent recipe for disaster. Even though this is a quick and dirty measurement, as it was done with a .47 ohm resistor in series with an ESP32-WROOM-32 module, we can easily see how we go from around hundred milliamps to half an amp in just microsegundos; -L di/dt.

(sort-of-yellow: power supply rail, cyan: device supply rail, magenta: difference between them)

Discover and read more posts from Sergio R. Caprile
get started
post commentsBe the first to share your opinion
Show more replies