More: temperature sensors and digital readout/data logger

  • Active since 1995, Hearth.com is THE place on the internet for free information and advice about wood stoves, pellet stoves and other energy saving equipment.

    We strive to provide opinions, articles, discussions and history related to Hearth Products and in a more general sense, energy issues.

    We promote the EFFICIENT, RESPONSIBLE, CLEAN and SAFE use of all fuels, whether renewable or fossil.
  • Super Cedar firestarters 30% discount Use code Hearth2024 Click here

jebatty

Minister of Fire
Hearth Supporter
Jan 1, 2008
5,796
Northern MN
I am re-awakening some prior discussions, one of which is Sensors.

After making a resolution to learn Python programming which I made a year ago, I finally started a couple of weeks ago to dig into Python as used with the Raspberry Pi. I copied a script available on websites dealing with the RPi and the DS18B20 temperature sensor. The script didn't work, but the meat of the script seemed to be solid. After quite a bit of effort and modification of the script, I now have a working script which reads multiple DS18B20 sensors, prints to the screen the sensor temperatures, and logs the sensor temperatures in an output *.txt file . The *.txt file can be read into a spreadsheet or other program for analysis and graphing. Once the script is started, the monitor, keyboard and mouse can be disconnected, and the RPi will continue to log the measured temperatures.

The attached pictures show 1) the Raspberry Pi with a breakout board holding three DS18B20 sensors (more can be added); 2) the Pi set-up with an HDMI monitor and wireless keyboard and mouse; 3) a screen display of the output from the sensors; and, 4) a screen print of the output *.txt file.

The script I modified and wrote works with the RPi (Jessie) version of Python 3.4.2. It already is usable with a wired connection to multiple DS18B20 sensors for temperature measurement and logging. The logging interval can be specified, and the script allows naming of the output file. The next steps will be to write scripts for the Pi a) to turn on/off and/or control the speed/position of various devices, such as circulators, fans, dampers, etc.; b) to send output to digital panel meters; c) to send logging output via wifi to a remote computer; d) to think of more things to do with the RPi.

The last programming I did was in the early 1980's with dBase III and Clipper. Python seems to be a good and flexible language to learn. The RPi so far is proving to be an amazing little computer. Having the ability to understand available scripts and modify them, as well as writing new scripts, lends great flexibility in developing a customized control system and a host of other applications.

[Hearth.com] More: temperature sensors and digital readout/data logger [Hearth.com] More: temperature sensors and digital readout/data logger [Hearth.com] More: temperature sensors and digital readout/data logger [Hearth.com] More: temperature sensors and digital readout/data logger
 
Hey Jim,

I'm new on the forum, I currently heat with a vintage woodstove and a pellet stove. My background is in Electrical Engineering, and I write code for a living, including some Python, so if you ever want a little help, let me know. I find the discussions on control and monitoring these systems fascinating.

Chris
 
I've actually been planning out a system similar to this for the PSG Caddy I just got. I'm a software engineer during the day, so this seems like a good side project. The RPi is a great device.

Sent from my Pixel using Tapatalk
 
nhtreehouse, thanks! For me a big part of using the RPi and Python is learning the programming, kind of like a jigsaw puzzle that does something once the pieces are all fit together correctly. Also likely, that as I progress slowly on this, I will have many questions. The web has good resources, and I got the Great Courses series on How to Program/Python as an overall learning guide. "Hello World."
 
The RPi breakout board is now wired to and logging to a *.txt file 9 temperature sensors in my shop/boiler building, which has in-floor heat: floor, outside air, inside air, boiler supply to storage, storage return to boiler, top of storage, 1/3 down from top, 2/3 down from top, and bottom of storage. Although I'm quite sure the Python code could be simplified, it is working well. A cold spell now is in progress in northern MN, and the data logging of these temperatures is on a 20 minute interval.

I am using Cat5e cable for the one-wire sensers. I use one twisted pair for each of the three leads on the DS18B20's. The longest cable run is about 40 feet. I have not seen any missed or error readings.
 
Excellent! A year ago, I also said I'd look into the system cited by cpeltier in this thread , but unlike you, never did, yet hah!

Why did you choose a 20 minute interval?
 
I used 20 minute only because I thought that would give usable information without an undue number of data points. I could log every minute, every hour, etc. The time interval is fully adjustable.

For me a big part of doing this is the fun of learning the programming and customizing to just what I want or need. Obviously, many disadvantages too.
 
There's the fun of learning that, which appeals to me for the something to factor, plus the price is low, which is always appealing.
 
Data logged Mar 9-2:00pm to Mar 13-4:20pm on the RPi running the DS18B20 program. Sigma-Graph is the graphing program I use on my Win10 desktop. Graph key: TB=bottom of storage; T1/3=1/3 up from TB; T2/3=2/3 up from TB; TT=top of storage; OU-outside temerature; IN=inside air temperature; FL=floor temperature. The rising storage temperatures result from a boiler burn in progress. After completion of the burn, my shop building continued to draw heat from storage (4 days) to the end time of the graph. The heat draw periods are shown by the sharp drops in storage temperature. Stratification in storage is quite extreme. Some mixing occurs during the draw periods. The very bottom of storage remains quite cool.

[Hearth.com] More: temperature sensors and digital readout/data logger
 
  • Like
Reactions: Marshy
Nice! The scales are a little hard to follow, but no big deal.

I don't have experience with big storage, but is there almost too much stirring up going on during heat draw? But, it's a horizontal 1000 gal tank-I'm sure it's been discussed before.

Anyway, looks good!
 
The scales are difficult with 72 temperature data points per day, 3 every hour. The stirring is no issue for my system, as hot water from storage is mixed down to 100F to supply the in-floor pex, and that is the only draw on the system.