Fail Of The Week: ESP8266 Heats Temperature Sensor

[Richard Hawthorn] sent us in this interesting fail, complete with an attempted (and yet failed) clever solution. We love learning through other people’s mistakes, so we’re passing it on to you.

First the obvious-in-retrospect fail. [Richard] built a board with a temperature sensor and an ESP8266 module to report the temperature to the Interwebs. If you’ve ever put your finger on an ESP8266 module when it’s really working, you’ll know what went wrong here: the ESP8266 heated up the board and gave a high reading on the temperature sensor.

temp2Next came the clever bit. [Richard] put cutouts into the board to hopefully stop the flow of heat from the ESP8266 module to the temperature sensor. Again, he found that the board heats up by around four degrees Celcius or nine degrees Farenheit. That’s a horrible result in any units.

What to do? [Richard’s] first ideas are to keep hammering on the thermal isolation, by maybe redoing the board again or adding a heatsink. Maybe a daughterboard for the thermal sensor? We can’t see the board design in enough detail, but we suspect that a flood ground plane may be partly to blame. Try running thin traces only to the temperature section?

[Richard]’s third suggestion is to put the ESP into sleep mode between updates to reduce waste heat and power consumption. He should be doing this anyway, in our opinion, and if it prevents scrapping the boards, so much the better. “Fix it in software!” is the hardware guy’s motto.

But we’ll put the question to you electronics-design backseat drivers loyal Hackaday readers. Have you ever noticed this effect with board-mounted temperature sensors? How did you / would you get around it?


2013-09-05-Hackaday-Fail-tips-tileFail of the Week is a Hackaday column which celebrates failure as a learning tool. Help keep the fun rolling by writing about your own failures and sending us a link to the story — or sending in links to fail write ups you find in your Internet travels.

60 thoughts on “Fail Of The Week: ESP8266 Heats Temperature Sensor

  1. yes I did! And I luckily had a thermal camera to hand.
    https://goo.gl/photos/eY6U7rgiZT8qutMR8
    I was using the ds18b20 1 wire sensor, and it’s at the top right of the photo. I can see the gradient of temperature along the traces. I think if they were 3 times the length then the effect would be mitigated.

    I fixed the problem by using longer wires and mounting the sensor away from the board. If I was doing a new pcb I’d have it on the other side of the pcb and use wiggly traces to make the tracks longer.

  2. Fit two sensors. One to measure temperature and one to measure the ESP units temperature. Measure on power up when both should be ambient and then further measurements should take into account projected difference to ambient from both sensors to predict true temperature.

    1. I was thinking the same solution, but then came in my mind another problem: the flow of air and the position of the board can change the ratio the heat is transmitted to the sensor.

  3. I had similar challenge in a CO2 sensor board. Both sensor and voltage regulators would get hot and this would affect precision amplifier that was connected to the sensor on the same board. So I followed a guideline I found in app note. I left 3mm wide clearance between amplifier section and rest of board, then added copper ring on component side and another copper pour on the other to act as both RFI shield and heatsink. There are only three, quite narrow traces: one from sensor, one for amplified signal and one to join ground planes that goes on the other side of the board directly under signal input path to add a bit more of RFI protection. power supply for amplifier is connected via small 100uH axial inductor. The only mistake in design was not adding solder mask keepout on top of ring so one could make a metal cover over amplifier, but that can be fixed with some careful scraping..

  4. Adding a heat sink won’t make any difference, except maybe by changing the vector by which generated heat is spoiling the data. Any other ideas about reducing the flow of heat to the part really only do that – there is still contamination of the readings, and sadly it isn’t linear (as you will discover at colder temperatures). There are only two effective solutions – remove the generated heat or remove the sensor from the part that is generating heat.
    The first is easier. Turning off the module should solve pretty much everything, it only needs to be on for a tiny amount of time to send a few bytes of data.

  5. Not a problem
    You must put ESP8266 to sleep for 1 minute (for example) and measure temperature just after wakeup (before even wifi auth).
    But that does not solve the problem for nodemcu for example which has USB UART converter which draws 20mA and cannot be suspended.
    You must separate sensor from esp8266.
    http://salwach.pl/IMG/nodemcu.jpg

    You should also consider powering the sensor from gpio pin (only when it’s in use) but it depends on a particular sensor how it behaves.

    1. I worked around the usb problem by soldering a wire to ~Enable line on the usb controller and grounding it. I only use the USB when programming so I disconnect it for that.

        1. Thanks.
          And there is third option – use that cheap module without USB bridge, program it only once in “diy programmer”, solder after, and do OTA updates if needed.

  6. I did this with a DHT22 and ESP01 module. What I found was mounting the board vertical with the sensor well below the esp and regulator, no copper groundplane fill and no serial to USB chip seemed to be working good, for the last year at least.
    The TX rate is every 30 seconds and I do not put the device to sleep.
    I figured that the regulator and ESP module would generate some heat so any convection air currents that would be set up by this would cause fresh air to be drawn up into the sensor, partly offsetting any conducted heat and keep the air circulating for a more accurate measurement.

  7. Put the temp sensor on the other side of the board.
    Put heat sink on the esp,
    Enlarge the case , and vent both sides . Put the temp sensor in the case, on the bottom and the esp on top right under vents.

  8. I have had a similar problem with a board, except even much worse as there were multiple things on the board that could heat up and they were controlled by the MCU based on the current mode of operation and the readings of other sensors… Ended up fixing it in software by basically running a simplified thermal simulation.
    If actually worked pretty well considering that the offset could go from 0.5 to 7°C (depending on what had been ON), and some of the heating components being so far away on the board that their time constant was around 3h.

  9. Measure the temperature on the esp for a longer period of time, create a model of the temperature and then subtract the model output from the real time reading. ????

  10. The only time I designed something with a board-mounted temperature, it was because I wanted to measure the temperature of the board itself and make sure components weren’t being pushed out of their rated temperature.

    1. Same here, I design my image sensor boards with a temperature sensor as close to the sensor chip as possible. So one mans fail is another ones pass :)

  11. I hade the same problems with one of my designs. When explaining it to a colleague he smiled and told me he made the same mistake in his youth. He then showed me a real product, with cutouts around the sensor _and no ground pour_. Obviously, the sensor cannot be too close to what ever is generating heat as heat radiates :)

  12. My build uses the esp8266 and the bmp180 sensor. I put the esp into deep sleep between readings, which is essential since I intend to run off of battery. And the bmp180 is going onto a separate board several inches away from the esp8266 and in a separate subenclosure. I don’t see any other way to get accurate temperatures. I am prototyping with a nodemcu board, but (again for battery reasons) will do the final build with and ESP-12E module without a USB chip and regulator.

  13. Instead of cutting those holes like high voltage / low voltage separator, you should leave the copper and solder over it a 1 cm tall piece of 1 mm thick copper band to act as thermal insulator (heat radiated in the air and through the board) and radiator and good also as rf shield. If you have space, you can put it also on the other side (either using boards with copper on both sides or drill small holes, solder some copper pins to the upper side band, pins extended to the back side and solder the band onto them – like making a fence with posts, but on both sides of the board).

  14. The usual sort of solution is to isolate and shield the sensor from the rest of the devices since they all dissipate heat of some sort or another – one reason you see temperature sensors on stalks/wires/mounts away from their circuitry. Trying to compensate with calibration is a second best choice as the heat input to the sensor will vary with airflow and external conditions.

    Here’s a mesoscale example: I once lived in a rented older house and installed a timed thermostat to manage the cost of heating. After I did this, the temperature in the house would mysteriously drop about 10°F from time to time…the furnace wasn’t cycling as often as it should.

    After checking the thermostat (which was functioning as it should), I noticed that the wall that I’d mounted the thermostat on was a thin, particleboard partition and on the other side….was the refrigerator in the kitchen. Every time the fridge would fire up, the condensor coils would warm the wall with rejected heat, causing the thermostat to “think” it was already warm and not turn on the furnace. (The old thermostat was a huge chunk of metal and apparently unaffected much by this).

    The solution was to re-mount the thermostat using a block of styrofoam with cooling channels cut into it to be sure it was at the ambient air temperature rather than the wall temperature.

  15. Don’t fret too much; my state-of-the-art and expensive alarm clock made by Philips has a very similar issue. It displays the room temperature without accounting for the fact that the sensor is located inside a box full of electronics and a large display. So the temperature is always almost 3 degrees too high. A small correction in the firmware could fix that

    FYI: the alarm clock was a present; i would never spend so much $$$ on something i could build for less than a tenner.

  16. How about helping the ESP to not get hot?

    I had ESP01s (and 12’es too) heat up, until I added code that sets each unused port pin to output a fixed level. Seems the built in pull-ups aren’t.

    For me, this was a game changer.

    1. Ah well. Order of magnitude.

      OK, it’s my fail of the week. I wrote 5C, translated to 9F, and then changed the 5C to be more accurate, without updating the Farenheits.

      That’s why I don’t write comments in my code either. Code changes, comments don’t, and then nothing makes sense anymore. :)

  17. Remember that heat sensors only measure the temperature at one spot so, even when isolated from the ESP you have to take care about positioning. The previous fridge example shows the sort of issue that can arise. For air temperature reading, I use DS18B20s remotely on at least 3 inches of wire, usually more, so that I can position the ESP where the signal is best or where power is available and the sensor where it gets the “best” reading, away from radiant heat sources and at the right height. With enough wire, you can move the sensor around to see where works best. Very thin wires can be used and easily hidden.

  18. What on earth is he doing putting the sensors so close to the antenna? There could even be RF heating going on. I’d design it so that the antenna was at the top then put the sensors as far below the module as possible and have the enclosure act like a chimney so that convection made ambient air flow over the sensors first then up over the module (with a heat sink) and out the top.

  19. I’d start with a long, thin board (like a stick of gum) and either put a hexagonal grid of vias or route it out like a flexture in the middle, and put the temperature sensor itself out of the end of a thin stick (or use a through-hole model and leave the leads in tact so that the sensor is elevated from the board. This is also a reason for keeping GND and AGND separate.

    Then, if I really wanted good environmental sensing (and didn’t mind the extra power consumption), I’d put a fan on it. We think of fans as cooling things, but what they really do is increase heat exchange with the air so that the thing they’re blowing on gets closer to the ambient temperature faster, which is exactly what you want if you’re trying to measure the temperature of the air. As a bonus, this will make the whole thing more responsive to changes in ambient temperature (though those changes are usually too slow for it to matter).

  20. Absolutely seen this before. It was in a wearable consumer product that has sold 100,000’s of units. We were told that there were two temperature sensors that they wanted to expose – one for ambient temperature and the other for skin temperature. Our mechanical engineers tried everything to accomplish this, but were really never able to overcome it. In our case there were two influences, one was the heat generated by the board, the other was the heat generated by the person wearing it. After much pain and effort, we determined that there was no realistic way (taking cost considerations into account) to get accurate ambient temperatures on a wearable device. In addition, skin temperature is not too useful when your real interest is core temp; the correlation is just not strong enough.

    So, we ended up keeping both sensors, but using them for safety/thermal shutdown. We also expose them in our SDK so that people can play with it, but haven’t found a good use for the data so far.

  21. Does the board have the ability to measure voltage or current? If so, use a thermocouple to measure the temp at a good location, and have the on-board temp chip measure the reference temperature. This means the thermocouple’s two wires will need a junction right next to the temperature chip.

  22. Trannyman the transmission hacking expert of the race track circuit in Ontario Canada saw a similar problem. Trannyman had the hybrid vehicle fleet of the City of Ottawa in his garage. Problem: the hybrids ceased working when the fuel heated up too much. Why? The electric motor would seize and the vehicle was dead.
    Sound familiar?
    Solution? Trannyman said he was perplexed because he changed the sensors, moved the hardware, re ran the wiring, nothing worked.
    So, he went to the wreckers and scavenged a 1976 Chrysler gas tank, swapped the gas tanks and presto! Problem solved!
    Why?
    The thickness of the gas tank withheld the heat of the transfer to the system preventing the electronics from seizing.
    Once the problem was tested, Trannyman found that he had to install about 200 new gas tanks that were made to spec and shipped to his garage.

    For something that is smaller, heat shield the heat source and redirect air flow out of the circuit. Or just make the circuit run at a colder temperature or separate the sensor and the heat source completely so as to keep the sensor functional.
    Or put the heat source in coolant contained vessel, built into the circuit board, and keep the coolant moving. But that requires another layer of plumbing that doesn’t really exist. Seal the heat source, encase in hollow exoshell, run a exoshell over circuit board, run coolant through it, get new sensor data on new set standard of temp, set it, then run diagnostics.
    Another solution would include using a dry ice filled cooler, pack the circuit in the dry ice, test it, but this will affect the whole circuit.
    Or build two separate circuits. Keep them separate, problem solves itself.

    More creatively, create carbonite, freeze circuit in carbonite then run the circuit through an R2 unit. But if you don’t have carbonite, then run the circuit through a dylithium crystal, hooked up to Data. If Data hasn’t been invented yet, find a Vulcan and get them to solve it for you. But if you can build the Data unit, that might be easier. Just don’t hook it up to Skynet. That could be ugly.
    Alternatively, you could replace the circuit with a neuronet processor!
    Or just drink beer, smoke pot, and maybe someone will invent it for you!
    (Obviously joking).
    Best solution: separate circuits. Create more space between heat source and sensor.

  23. While it wasn’t for a temp sensor, we had a TCXO that would have terrible jitter when it got hot. This would mean if we were transmitting for long periods we would lose the link. Being that we had tight dimensions we couldn’t isolate in the traditional ways. What we did was create an extra pcb that was just islands for the TCXO, that only had 4 vias that were cut away. It was a pain to install, but it mad the TXCO run normally.

  24. I am planning on mounting the DHT22 on the outside of a small project box. But when I measured the outer surface temperature of the box, it is becomes 1-2 degress C higher with the ESP-12 turned on after a while. Boy does this chip run hot.

Leave a Reply to Rud Merriam Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.