Electronic – Heat problems for STM32F103C8T6 in enclosure

enclosurepowerstm32

For my hobby project, I'm intending to add a STM32F103C8T6 (and later STM32F407VET6 or ZET6) into an enclosure.

For worst case case, let's take the 407, the datasheet can be found here.

On page 80, there are stated some power dissipations (between 435 and 543 mW).
Also some temperatures are shown on the page.

What I want to use in them (maybe spread over two devices, but let's assume I put everything in one STM32):

  • Reset button
  • Maximum 10 small LEDS (3mm, some bicolor). if these will cause too much power/heat I want to use smaller ones or less. Also the LEDs will be very sparsely on probably (at least most of them). They are for notification only. I would assume a total power consumption of 100 mA (assuming some are one more than others, so assuming 20 mA per LED, on average 5 are on).
  • A few dozen ferrite beads
  • 4 or 5 6N137 or similar optocouplers
  • CAN bus driver (MCP2551 breakout board)
  • One or two (2.4 GHz transceivers)

Used peripherals:

  • 6-8 UARTs
  • CAN
  • Some timers
  • One or two SPI ports (for the nRF24L01s)
  • CAN

Environment/Boundaries

  • No low power mode
  • Maximum CPU frequency (168 MHz for STM32F407)
  • Enclosure !

Would I get in trouble putting these STM32 in an enclosure … I assume I need to add some holes possibly? What other measurements should I take to prevent them frying in their enclosure?

(note: I know I can probably calculate the exact power consumption, but I want to have a general idea about what I can expect, since I never have built a real project, and the only time I put an Arduino in an enclosure it got fried, but it was connected with a 12V adapter).

Best Answer

Well your main goal is to keep the MCU (generally all parts) within its operating region.

For that you have to have to guesstimate the current needed for operation, the thermal resistance (which is hard) and the ambient temperature the device will operate in.

The power dissipation figures you find in the datasheet are numbers which will prevent the junction temperature to go out of spec at the given ambient temperature.


So worst case, everything on, 3.6 V running full speed, they give 109 mA. This is 392 mW.

You are limited to 240 mA max through Vdd or Vss. 109 mA end up in the core, leaves 131 mA for the rest.

With modern LEDs I would not drive them with more than 5 mA as indicators, except they are used outside in sunlight.

Driving 10 LEDs with 5 mA and 0.4 V internal drop (table 49) adds another 20 mW to the internal dissipation.

Not sure about the other I/O ports. But lets assume a 450 mW power dissipation.

Table 98 has the thermal resistance for the packages listed. With the worst one you have 46 K/W.

With 450 mW you get a rise of 20 K of the junction temperature over the ambient (ambient of the MCU not the enclosure). That means you basically can have 85 °C inside your enclosure and the MCU would be fine. (84,3 °C to be precise)


Modeling what temperature will result in your enclosure is much harder. You need to know how the heat will transfer from the air to the enclosure and then from enclosure to ambient again - maybe your enclosure gives a number but most don't.

What I usually do is estimate the total power dissipation (add some extra), place a PCB inside the enclosure and solder a part on it which is able to handle the dissipation.

Then measure the ambient temperature, the temperature of the enclosure and the temperature inside the enclosure while powering the device. After some hours the temperatures will have stabilized and you can see what rise above ambient you get. If it's something like 40 K rise of the inside temperature, you can't use your device in temperatures above 45 °C. Because then, the ambient temperature of the MCU would be above 85 °C.


If you want to have some safeguards, you can use the internal temperature sensor of the MCU to shutdown in case of overtemperature.

There are some ICs around which will do the same and probably more accurate if you don't trust the internal sensor.