Monitoring Temperature with IoTaWatt - 4 DS18B20 probes

I would like to share my custom-modified Iotawatt with temperature monitoring (4 probes). I really like the IotaWatt - thanks for making it so easy to modify.

I want to be able to monitor my air conditioners.

@TomH added temperature monitoring to an unmodified IotaWatt using platinum RTDs. I wanted to try using DS18B20 temperature sensors as you can add many of them as you like to one port. I made some small hardware modifications that still look good in the original IotaWatt case.

I modified two 3.5mm ports (13 and 14) on my IotaWatt V5.0 to connect to the NodeMCU D3 and D4 instead of the ADC (cutting a few traces and adding a few wires). The three phase AC ref ports 13,14 should still work, but I have not tested them.

Here is where I added wires and cut the existing traces to a V5.0 IotaWatt board.

I modified the source code to add a temperatureService, degC unit, and communicate with 2 temperatures sensors per port on ports 13 and 14.

I purchased some 10ft DB18b20 temperatures sensors with 3.5mm jacks and connected two together using an audio y-splitter and connected them to the IotaWatt. The temperature code looks for 0, 1 or 2 temperature sensors on each of the two modified ports 13 and 14. Apparently you can go up to 60m of wire with these temperature sensors.

Here is an example Graph+ screen with two of the four temperature sensors in use.

It is a lot of fun to work with the IotaWatt, thank you!

3 Likes

Very clever. What are the implications of using the CS pins of the ADCs for one-wire? Does the one-wire protocol ever cause issues with ADC sampling?

Where do you save the temp readings? Are you using the input 13 and 14 areas of the datalog?

Very clean interface in that you say you created a Service to handle reading and seem to have added the temp to query and graph+.

I expect you will get some interest on this from other users.

Hi @overeasy,

So far I’ve only been checking the first 7 CT inputs. They seem to be accurate, using the CS pin of the first ADC (D3) does not seem to cause any trouble with ADC sampling. All 7 CTs measure the same current when connected to the same wire, and match my hand-held meter. I figured that using the CS would work, as during those times temperatureService was using the CS, the SPI would otherwise be not doing anything. But I haven’t double checked that.

I do seem to have a problem with the 8-14 CT inputs, the data is varying unusually in Graph+, so I need to find out what is going on! These values are varying up and down by 10%. I’m thinking this is a problem in my code rather than the hardware modifications I made.

The temperatureService (which runs every 5 seconds) is stealing 27ms to send requests to the 4 temperature sensors, and then 47ms to read the responses one second later, so samplePower is missing 5 cycles every 5 seconds.

At the moment I’m storing the 4 T sensors values in the 11,12,13,14 InputChannels. I plan to extend the InputChannel[] and datalog to store the temperature data in new, higher numbers 15,16,17,18. This is what the label in the picture above optimistically shows - but I haven’t implemented that yet!

Thanks for your helpful comments, I’ll keep working on this.

-Tim

4 Temperature and all CT channels (1-14) are now working in this design. I was having trouble with CT channels 8-14, but that is now resolved.

I’ve modified the code, with my modifications in the temp_sensor branch.

The IotaWatt runs the SPI clock hot! I reduced the SPI clock speed (2 MHz to 1 MHz) on the 2nd ADC (CT channels 8-14). ~350 samples per 60 Hz cycle instead of ~640. I’m thinking the temperature sensors increase the signal slew in the CS line, but I’m still not sure why that only affects ADC2 and not ADC1.

Hi, I would like to refresh this topic because it is very interesting for me. The most final version described here, where the 4 temperature measurement channels do not occupy the current channels.
Unfortunately, Timb’s links have expired and the project cannot be viewed. Has anyone done it and what are the results? Greetings!

Hi Wasik,

Here is the updated repository link to a fork of Iotawatt code to support 4 DS18B20 temperature channels: GitHub - Hudson-Sonoma/extraAC: IoTaWatt Open WiFi Electric Energy Monitor

-Tim

1 Like

Thanks a lot! Do the files you upload provide for the support of sensors on port 13 and 14, or is it a version without loss of current inputs - as you planned:

? Regards

The hardware supports the VTs on sensors 13 and 14 (bottom ports), and DS18B20 probes via the 3.5mm jacks labeled 13 and 14.
However the software at the moment is using InputChannels 11,12,13,14 for temperature readings. Ideally that would change to 15,16,17,18, but I am not sure if adding InputChannels will change the on-disk format of the Iotawatt datalog files?

-Tim