This should work right? - Page 1
Forum section: electronics / beginners

author: paulca
author_rank: Super Contributor
timestamp: October 06, 2019, 02:09:55 pm
content: Si I'm attaching a Dallas One Wire DS18B20 to a Wemos Mini D1 and because I wanted to keep the effort to a minimum and make it easier to design the case for the pair I choose to use a GPIO pin as a ground.It allows me to connect the DS18B20 to 3.3V, D7 and D6 and poke out the side of the case. I then set D6 to OUTPUT and LOW to create a ground and D7 to INPUT_PULLUP to pull the dataline high.I connected it up and powered it and it is reading temperatures.However with a room temperature of around 21*C the temperature reads around 21*C when I power it on and slowly rises to 32*C after 5 minutes where it stabilises.This would suggest that either there is too much current flowing through the device, the device is damaged or it's just not going to work that close to the Wemos mini board and needs to be on leads.This probe has been through a few soldering and desoldering wars and I wouldn't exclude thermal damage.

author: Twoflower
author_rank: Frequent Contributor
timestamp: October 06, 2019, 02:30:49 pm
content: How warm does the controller board get and how long are the leads? It's possible that the increasing temperature comes from the controller board through the leads of the temp sensor. To test this you can place a fan blowing over the processor and Sensor. If the difference is now less than 11°C you know that there's some heat-source influencing the sensor.If the ESP is active especially with active WLAN it does consume some power and can heat up the PCB.

author: paulca
author_rank: Super Contributor
timestamp: October 06, 2019, 02:36:25 pm
content: Quote from: Twoflower on October 06, 2019, 02:30:49 pmUsing the "upper lip" test the ESP8266 chip is luke warm to the touch.Spinning the device around in the air on the end of it's USB cable and I can get the temp to come down to ambient within about 30 seconds, but it slowly climbs again once stationary.I had no leads, just soldered the DS18B20 directly to the wemos mini.Aww well it was a nice idea, but if I need to put the probes on leads I'll just solder them normally to 3.3, GND and use an actual 4k7 pull up on the data line. Was hoping just having the tip of the TO-92 package sticking out the side of the case would work, but it is probably too close to the heat source of the ESP chip

author: paulca
author_rank: Super Contributor
timestamp: October 06, 2019, 02:48:16 pm
content: Well, a great idea, but a fail:

author: Twoflower
author_rank: Frequent Contributor
timestamp: October 06, 2019, 03:02:37 pm
content: Yes for temp sensors you have to consider the heat-flow through the leads as well. Especially since most metals are not only good electrical conductors (surprise) but also temperature conductors. In your case you should use thin wires and also keep in mind that the housing will get warm over time as well. So for good readings you might need to get creative to reduce the influence from the nearby heat-source (shilding, insulation, distance, ...).So before re-do the soldering over and over again, use longer leads and try different things to find a solution that works for you. And then do the final wiring with the thing you just learned in mind.Not sure if that'll do, I would change the case a bit: Try to place a double-wall between the sensor and the controller. 2-5mm in between. the wall to the controller could be thin as it only needs to prevent the warm air to enter the chamber. This will work as a double walled thermos flask. And optionally fill the area between the walls with a foam (as foam is a good thermal insulator). But the wires should be much longer to prevent the heat flowing through them. For example 5cm of magnet wire. As it is thin to reduce the heat running through them. Loop the wire in the 'chamber'.

author: paulca
author_rank: Super Contributor
timestamp: October 06, 2019, 03:07:37 pm
content: Yea. I have about 5 of these things around my house. However they were V1.0 with no case and using much larger Lula NodeMCU boards. The temp probes are mounted on 15cm Dupont leads. They work fine. I was trying to compact it all down, but you are right, soldering the To-92 directly to the MCU board is just TOO close.I will just have to accept I need fly leads and hang the probe 10cm or so outside the box. It will look less pretty, but I usually hide them by sticking them to the back of a cupboard or in a corner out of the way.I can still use the case, just need to put leads through the hole instead of having the sensor poking out.(EDIT: Oh and even without the case the temperature was 10-11*C over, so either the heat soaking through the leads or too high a current through the sensor).

author: paulca
author_rank: Super Contributor
timestamp: October 06, 2019, 03:11:34 pm
content: Here is an example of the version 1 probe, lying on the floor behind a set of drawers in the bedroom:

author: Twoflower
author_rank: Frequent Contributor
timestamp: October 06, 2019, 03:19:40 pm
content: You should be careful about ESD. These carpets might pick up charge quite easily. At least some of them. So a housing might be a very good idea.Maybe not useful for your current setup. You know that you can connect more than one of these sensors in parallel and read them individually? Not all 1W libraries seem to have this functionality implemented. It needs some kind of identify each sensor which is a bit complicated. After you know the individual IDs you can address each sensor and read the temperature of each sensor.

author: paulca
author_rank: Super Contributor
timestamp: October 06, 2019, 03:22:26 pm
content: Quote from: Twoflower on October 06, 2019, 03:19:40 pmYes, I use that feature here to monitor the heating loop in and out temperature.... and as the Earth bonding in my house is 1970s standards (ie. poor) I'm fairly sure that board is toast if I ever have a large ground fault. EDIT: The probes are triple insulated from the pipes, TO-92 package + heatshrink + electrical tape.But... it produces output like this:

author: Twoflower
author_rank: Frequent Contributor
timestamp: October 06, 2019, 03:36:35 pm
content: Strange. I see your links to imgur only while in the "post reply" but not in the forum itself...Found the problem. It's on my sideESD != Earth bonding. Walking on a synthetic fibre can be enough to charge you up. Or if you move the PCB over the carped might be enough to cause some damage. I learned that the hard way on a big trade-show with a life demo (I was grounded, but the guest who touched the demo wasn't. I just wasn't fast enough to stop him)...Nice that you actually use that chaining function of the 1W system.I wonder a bit that the in and out-flow temps are so close together. It seems you don't take much heat from it even as the system heats up the water. But I'm no expert here.Edit: Changing -> chaining

author: paulca
author_rank: Super Contributor
timestamp: October 06, 2019, 04:05:08 pm
content: Quote from: Twoflower on October 06, 2019, 03:36:35 pmYes, sorry I meant the fact I have low voltage probes connected to copper pipes. In the UK (and most places?) the copper pipes form part of the Earth circuit of the house. I'm sure some grey beards will tell me this isn't worth considering, but I seen the potential that an Earth fault in the house, could see the copper piping could surge to 240V if my circuit presents a better route to Earth than the rest of the pipe it could take current.On the ESD. If the NodeMCU has inheritied charge from the carpet and the USB charger is floating, it is still fine is it has 10000V and 10005V input... unless I move itBut yes, I need cases, that's the purpose of the project.Quote from: Twoflower on October 06, 2019, 03:36:35 pmIt's interesting and only because I fitted those probes do we know this is the case. They are definitely reading right. It's a sign my heating system is old and tired. The pump rate is probably to high and the radiators too old and gunked up that it's not taking as much heat as it could from the system.If you do some sums, OUT temp - IN temp is about 2*C. An estimate of the total water volume in the system and an assumption is circulates uniformly results in a sizable amount of kW. I don't have the numbers on hand, but I did them. It was well below the boiler output though, maybe 25% of it. If I was keeping this system I'd swap out the pump for a slower flow rate.EDIT: It also has to be considered I have an inline heat exchanger in the hot water tank, so that will act as a ballast or temperature buffer in the system.I am having my whole heating changed from oil to gas next month, with a few radiators being replaced and the system flushed and will draw a new baseline there.

author: Twoflower
author_rank: Frequent Contributor
timestamp: October 06, 2019, 04:35:45 pm
content: I'm not sure if you understood the ESD problem. It is not directly the potential itself but the charge. You build up a charge up by walking on the carpet. Now you touch a device. Now you have en energy flow from you to/through the device. This could damage the device.By the way. Your Espressif is probably floating about 55V above ground level if powered by a wall wart. Your wall outlet has 110V, due to capacitors in the wall-wart you will have half of it on the device. You can measure it with a multimeter.The datasheet of the ESP says: Tested and passed up to 1.5kV on all pins (not 10kV as you write). And if you feel a zap you already reached about 2...3kV -> potential damage of the device. That page contain a table about some voltages a human body could charge up to (spoiler: walking on a carped in dry air: 35kV):https://www.esda.org/esd-overview/esd-fundamentals/part-1-an-introduction-to-esd/I just get a bit nervous seeing electronics laying on synthetic fibers ;-) Just be careful, because debugging a ESD damaged device is a pain until you figured out you have a defective device. Often they still work partly, but one IO pin isn't working as expected, reading wrong values, reduced performance...

author: paulca
author_rank: Super Contributor
timestamp: October 08, 2019, 07:59:15 am
content: So... not giving up just yet. If it's reading off because of heat from the MCU, what if I put the MCU into deep sleep for most of the time. While active the device is pulling around 60mA, but in deep sleep it is only pulling 300uA. A WeMos Mini without the temp probe pulls just the same, so the sensor quiescent current is fine.First tests with a 5 second deep sleep seemed to have a significant effect, but it stabilised about 5*C too high still.I am testing with a 30 second sleep it's currently sitting at around 2*C high, but it's still falling slowly, so I'll reserve judgement until it stabilises. I don't mind it being consistently out by, say, 1*C, I'm not intending on measuring absolutely temperature, just indicative and relative temperatures for heating automation. So whether I feel I like 20*C or 21*C for a room, it doesn't really matter.I think I will also put it side by side with a leaded probe and log both temps for a while and see how close it gets.

author: Twoflower
author_rank: Frequent Contributor
timestamp: October 08, 2019, 08:21:23 am
content: Yes, that's also an option. The less power the system consumes the less heat will be emitted from the system. The WLAN should be on as little as possible as this consumes reasonable power. So as soon as you transmitted the data switch the WLAN off. I haven't looked into the power options of the ESP, but probably you can disable much more as reading the 1W sensor does not need much of the functionality included in the ESP.If you do one temperature measurement every 30 seconds and leave the deep-sleep for 5 seconds during data-transfer you'll have some positive impact. And you can alternatively do multiple measurements (no WLAN enabled) and store the data in the ESP and send the data every 10 Minutes (less frequent is better). With this the impact will be much less.An alternative might be using a much simpler controller and use zigbee (or some other low power wireless system) hat. Doing such measurements don't need much CPU power. Thus much less self heating. The down-side is that this would require a zigbee bridge in your house.

author: paulca
author_rank: Super Contributor
timestamp: October 08, 2019, 10:04:30 am
content: I have the ESP8266 in deep sleep for 30 seconds.It does this:Wake upEnable 1W bus and set pin modes for it.delay 750ms to allow 1W sensor to begin conversionsread sensorStart Wifi connectWait on Wifi connectSend UDP packetWait 500msDeep sleep for 30 secondsThe sensor is still reading consistently 3*C high. It's much better than 10-11*C high, but still... too high.I even tried WAKE_RF_DISABLED and kept the Wifi off until I'd read the sensors, but it added more trouble than it solved as I can wake and read the sensors in under a second.I have also tested with a 5 minute sleep and the temperature looks to be at most 1*C too high maybe less. It's probably fine for my purposes, but the 5 minute sleep isn't unfortunately. I need higher resolution than that. My current sensors are set for 5 second interval which might not make a lot of sense for the heating control, but does calm my OCD about watching data displays intently. The 5 second interval does upset Home Assistant a bit, but I find that somewhat amusing and it's not my primary "hub".I'm going to try adding 10cm of aluminium wire for the probe lead, covered in heatshrink to look a bit better. I expect that will fix the heat issue. Aluminium apparently has less heat conductivity but will serve my electrical purposes fine. (Assuming my cheap thin gauge wire is aluminium and not tinned copper).My existing sensors do not even deep sleep and read what appears to be fine.

author: Twoflower
author_rank: Frequent Contributor
timestamp: October 08, 2019, 10:18:24 am
content: If that's aluminium wire you'll have fun solder that. Not impossible, but with the normal approach you won't get far. Just use longer leads to allow to radiate the heat from the wire into the environment. Placing the wire inside of a warm box causing the wire to have the same temperature as the box. So not very useful. Using thinner wire helps as it doesn't allow to transport much heat (less mass). That's the reason why I wrote earlier to use magnet wire.