[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.
Next 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?
Fail 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.
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.
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.
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.
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..
Which CO2 sensor did you use? Can you please share the part no.?
Turns out electronics dissipate energy.
Wow.
Maybe we don’t all have your brain size and can’t think of anything on a hobby design.
s/anything/everything
SNOBOL???!!! Or is my memory deceiving me?
That’s vi / vim
Yep, that’s vim, sed, ex, ed, and all o’ dem.
look at the 1117 regulator. that is also a source of heat, and it sits right next to the sensor.
Good call! I didn’t even see a (linear) regulator. Those things are essentially resistors — they reduce voltage by producing heat.
It’s kind of unbelievable. The funny thing is that he’s bragging on the hackerspace mailing list about how he got on HaD again.
measure the temp of the esp and reg and compensate in software
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.
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.
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.
Correction – The ~RST pin. And yes, it is hard to solder to a QFN when no trace is exposed.
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.
Thats a sweet looking solution :)
Glue another temp sensor to the ESP and compensate? :-/
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.
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.
don’t take any readings for 10 mins then subtract 4.3 from the reading. Sorted ;)
thats what id do! :)
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.
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. ????
My solution for a logger board I’ve build is to put my temp sensor outside the board: http://davidegironi.blogspot.it/2015/08/amqumo-xively-ambient-quality-monitor.html
Although my heat source is the EC28J60 and the 7805 regulator. Ok, I know, i should use a stepdown regulator, maybe for the next version ;)
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.
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 :)
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 :)
I went straight to his blog after reading this post to look for exactly that. And lo and behold: https://github.com/richardhawthorn/SensorBit/blob/master/images/pcb_back.png
Who would have thought that copper is good at spreading heat around?
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.
Sounds awesome. Do you have a write up? I have no idea how to do the sleep stuff yet.
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).
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.
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.
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.
Can you provide a code snippet used for this on an ESP8266-01?
four degrees Celcius or nine degrees Farenheit. Say what?
4.3C = 7.74F
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. :)
AHHH, can’t resist…. you write C, it never makes sense.
Ha ha. Well, since we all remember 9/5 to translate F/C it kinda jumps out when you say 9/4.
Just remove temp sensor and replace with through hole one. done. All you need to do is get the sensor away/off the board. Something like this maybe DS18B20
Tried through hole, didn’t work. The ‘B20 still got heated by the GND plane. Adding a bit of wire helped.
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.
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.
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).
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.
TI’s TMP006 costs $1.50 in quantity and is basically an infrared thermometer on a chip. It should be relatively immune to temperature changes of the device itself.
Interesting the climate control in my saab does just that – has a small fan to draw cabin air in and over the sensor mounted in the dash.
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.
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.
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.
External DHT22 on short length of 3-conductor. Done! I have a DHT22 on 20 foot length of shielded twisted 3-conductor 22G cable … works fine. I tested on 30 feet to confirm.
> Have you ever noticed this effect
LM35 next to the NTE977 (TO-92 5v linear voltreg) …
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.
It appears that the ESP8266 is creating either RF heating or RF interference. There is a detailed discussion here: http://www.esp8266.com/viewtopic.php?f=13&t=14961
Use a thermal silica gel pad in between ESP and sensor.
Ive read somewhere to put some delays for tcp protocol to run in background
so i did it and its heating almost nothing… so perrhaps is related to intensive switching radio parameters in loop()