The Forestry Forum

General Forestry => Drying and Processing => Topic started by: btulloh on December 31, 2017, 02:05:44 PM

Title: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on December 31, 2017, 02:05:44 PM
Well, I've gotten started on this thing.  Got the stuff in yesterday.   I can blame ChugiakTinkerer for stirring up trouble.  I hope he gets started on his so we can compare notes.  The weather here is cold and nasty and expected to be like that for at least a week, so this is a good time to work on it.

It looks like the RPi is a good platform to build this around, since the new version already has WiFi and Bluetooth built in.  It does not do A/D conversion, but there are plenty of sensors around with digital I/O.  This thing is more capable than I knew before I got into it a little bit.  It's a lot more than a microcontroller such as the Arduino.  The processor is similar to (or the same as) what's used in some tablets.  Hook a display and a keyboard up to it and it's pretty functional right out of the box once you create a bootable SD card for it.

To start with, I'm using four RTH22 temp and humidity sensors.  They are cheap, but they are not going to be robust enough for long-term duty in a kiln environment.  There are more appropriate sensors available, but these will work for now.

So far the RPi is connected to my wifi and running the GUI that is designed for it.  I also have an app called Cayenne running on my cell phone that is designed as a remote desktop for the Pi and this is working.  (It took some fiddling since my primary wifi network is running a second router set for bridge mode.)

So far I've been able to get one of the sensors wired up and some simple code done to read the temp and humidity on command, so that's a step in the right direction.

My objective is to use three t & h sensors - two inside the kiln and one outside - to log data on a regular interval.  These can also be checked at any time to see what's going on at that moment.  Just for fun I think I'll add a sensor to monitor the intensity of the sunlight and log that as well.  All this could lead to adding fan control somewhere down the road. 

This could all get even more complicated as it proceeds, but that would be normal I guess.

Not a lot of specifics to report at this point, but if someone is interested I'll be glad to share anything I've used or learned as I go.  I'm looking forward to ChugialTinkerer getting started and see what he comes up with.

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on December 31, 2017, 02:54:56 PM
It's on, like Donkey Kong!

Okay, I'm running a little behind you.  I was hoping to find an RPi in my stocking but I got coal instead.  I'm probably going to use a Raspberry Pi Zero W for the controller.  It only costs $10 and has the wifi onboard like the Pi 3.

My interest is in a remote monitoring situation, where I'll need a GSM module to connect to the wireless network.  I suspect ultimately I'll be looking at an Arduino (or similar, such as Photon, etc) as a controller because I can dial back power consumption in a big way.  But the Pi will be a handy platform for prototyping, and depending on my final design it could serve as the interface for uploading data to an Internet of Things data service.

Alrighty then, time to shut up and start ordering components!
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Don P on December 31, 2017, 04:57:00 PM
Good deal, if y'all can document this here and teach at a kindergarten level I'd sure appreciate learning more about how these things work.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: WLC on December 31, 2017, 07:40:43 PM
Yea, I saw Raspberry pie and got hungry.  Yall talking waaaay over my head.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 01, 2018, 08:08:36 AM
GSM is interesting.  I looked around and found that GSM service for low-bandwidth data is pretty cheap.  I always wondered about  the cost for those game cams that had GSM capability.  For me, my kiln is close enough to the house (for now) that it's in wifi range, so that makes thing a little simpler.

One of the big challenges for this will be the humidity sensors.  The ones I've looked at will not like living in the kiln environment.  That's going to be especially true when drying white oak, etc.  Not only a sensor problem, but connectors and everything else.  Conformal coating may help with corrosion issues, but the sensor itself may be a consumable item.  It may even require some way of sampling kiln air using a pipe or tube and limiting the long-term exposure of the sensing element.  I don't mind eating a few sensors to find out how it's going to work, but degradation may (or will) affect accuracy.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 01, 2018, 08:16:41 AM
Except for the  wifi and/or gsm side of this, the Arduino would be the perfect tool to run the show.  There's really not much overhead in collecting measurements or even storing a few days worth of readings on board.  It would be interesting to see what the power consumption is for both ways.  Probably using the Pi-0 headless is still pretty low on power consumption.  GSM or wifi is going to require more power, but that can be short-term and intermittent.  A very small solar panel/battery should be adequate, but that starts to make the total cost go up pretty fast.  But hey, all in the name of science.  This project could probably qualify for a grant from somebody.  :D

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 01, 2018, 08:32:17 AM
I hope you get your parts and get started quickly so we can commiserate on the learning curve.  I got out of the gate pretty fast, but now I'm bogged down on development process issues.  Using open-source tools has it's challenges when it comes to documentation, etc.

Right now I'm hung up on making the ide/compiler/linker/assembler happy now that I've gotten past the rudimentary phase.   I do not have any experience in a Linux environment, so that doesn't help.  The RPi has a GUI that makes things a little easier since I can look around and find files and directories.  It also comes with Chromium (a small version of Chrome) and it's nice to be able to do research right on the development platform.  A lot of the examples and documentation I find are references to older versions of hardware/op system/etc.  Things evolve quickly on this RPi platform and there's no real form of document or version control of anything. 

So there we are for the moment.  I better get to work on this before the football games call me away.

Get that stuff ordered!!
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: pineywoods on January 01, 2018, 12:59:03 PM
You guys be sure and keep this thread going. I'll be checking daily. Already have a Rpie and most of the tools. My mill already has a hand-held remote, but it's IR. Suggestion on the humidity sensor. They will be rather delicate and short lived. Why not use 2 temp sensors, one dry, the other with a wet wick. Temp sensors are plenty robust. Send the 2 temp readings to the Rpi and do a table lookup to get a very accurate humidity calculation..
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 01, 2018, 01:01:15 PM
Stuff is ordered!  The big river will be sending me a Raspberry Pi Zero W starter kit with official case.  It's official, man.  Next thing you know this will go down on my permanent record.

I've been on a Linux desktop for about a decade, been running servers for more like two.  Hopefully some of that experience will carry over to the Pi.  The Raspbian version of Linux is derived from a Debian distribution.  That's become the most widely used distro for desktop systems, and it's what all of my recent Linux use has been based on.  So I'm optimistic I can get up and running quickly.

I ordered some potted Dallas thermistors to play with temperature monitoring.  They look to be well suited for putting in the wood stack and I'm hoping will have some durability.  It's essentially this one (https://www.adafruit.com/product/381), but I ordered from a different vendor that has 3 meter leads.

I got a DHT22 on order as well to do the temp and humidity measurements.  Just one mounted on a PCB, for prototyping.  But it is pretty small so maybe it will fit in protective housing.  AdaFruit sells an encased version, the AM2315.  That runs $30 but looks like it could withstand the mechanical rigors of a kiln environment.  It's durability to corrosion would remain to be seen.  I'm traditionally a cheap SOB and if I can find a DIY way to do it that would be my preferred.  So I'm keeping my eyes out for an old stage microphone that I can get for almost free then drop a sensor into.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 01, 2018, 01:18:51 PM
pineywoods:  Good suggestion on wb thermo.  Should be more accurate and solve deterioration issues.
What language are you coding in?  I'm using the Geany IDE with GCC compiler that came with the Raspbian distro.  That's all fine, but I'm not getting my environment set up correctly or something when I start using some functions and headers that came from outside sources. ??  Fighting with that for the last 24 hours now, with a little time off for bad behavior.

CT:  Good going!  Can't wait till you get started.  I think your familiarity with Linux will be a big help.  My lack of experience with Linux is one more obstacle.  Not too bad though.  I find myself blindly following instructions without understanding the whole picture.  Uncomfortable.

I would stay away from the DTH22 if I was doing it again.  It's not a very good device, except for being cheap.  It doesn't hurt to use one for testing, but it's a bit more of a pia than something that's I2C based communication.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 01, 2018, 01:23:29 PM
@ pineywoods,

That might be a more robust means to measure relative humidity.  It's definitely something to look into.  Just some quick internet searching shows folks are looking at ways to simplify that calculation for an embedded device application.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 01, 2018, 01:24:29 PM
By the way, the fancy housing and screen on that Adafruit sensor will not keep the corrosive stuff away from the sensor.  From what I've read so far, most (or maybe all) of those humidity sensors seem to be alergic to long-term exposure to extreme heat and humidity.  I think pinewoods wet-bulb suggestion could be the ticket.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 01, 2018, 01:35:00 PM
Regarding Linux, I have to say that I'm warming up to it.  Even at this early stage I'm starting to appreciate its benefits.  I'm just not sure how many more things I have time to learn from the ground up.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: pineywoods on January 01, 2018, 02:03:57 PM
Quote from: ChugiakTinkerer on January 01, 2018, 01:23:29 PM
@ pineywoods,

That might be a more robust means to measure relative humidity.  It's definitely something to look into.  Just some quick internet searching shows folks are looking at ways to simplify that calculation for an embedded device application.
No need to do calculations. Table lookups are easy to code, and I'd bet WoodDoc could quote you a table right off the top of his head.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 02, 2018, 08:04:53 AM
Here's a library for the DHT11/22 sensors: https://github.com/adafruit/DHT-sensor-library


Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 02, 2018, 12:50:26 PM
Got my issues sorted out.  15 years of rust plus assumptions plus open-source tools make for a bad combo.

Makefile issue resolved and I'm back on track now. 

Quote from: pineywoods on January 01, 2018, 02:03:57 PM
No need to do calculations. Table lookups are easy to code, and I'd bet WoodDoc could quote you a table right off the top of his head.

Excellent point. 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 02, 2018, 01:04:33 PM
So what pushed you guys towards the rasberry pie vs the arduino? I was thinking about arduino for my sawmill setworks. The solar kiln will come later but still looking at everything trying to learn and figure out how I can integrate everything.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 02, 2018, 01:43:51 PM
The RPi has a lot more horsepower than the Arduino.  The arduino is a microcontroller and well suited for embedded systems.  The RPi has enough juice to host it's own development process.  With a display and keyboard, it's basically a computer. 

The Arduino would certainly be able to do all the temp and humidity logging and display it.  The RPi has ethernet, wifi, bluetooth, and hdmi ports built in, so it will connect up to your network right out of the box and can be used to report data, etc over your local network or to the cloud or to North Korean hackers.

Your project may fit either one, it may be more well suited to one or the other.  The setworks project will have more i/o to deal with than the kiln logger, but it will also benefit from a real-time oriented platform (which I think describes the Arduino.)

I'm not familiar enough with the Arduino to fully answer the question beyond that.  I think C-Tink has more experience with them and can elaborate.  (In fact, I jumped on the RPi because of his post.)


Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 02, 2018, 10:45:50 PM
I have no experience with either Arduino or Rpi, but I've been eyeing both for a while now and this project gave me an excuse to try it out.  I like the onboard wifi in the latest RPi boards and the fact that I can put an entire OS on one.  It will give me much flexibility as I explore how to upload data to an IoT service and at the same time host a local web server for showing temp data, etc, on my home wifi.

To be honest it's probably because the Raspberry Pi is essentially a computer so it will likely be an easier transition from the programming I've done on a desktop system.  The Arduino seems more like working without a net.  I'll likely end up there with the weather monitoring system I want to put together, but I gotta learn to crawl first.

Plus everything btulloh said.  8)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 03, 2018, 07:31:26 AM
Thanks for taking the time to do this. I am really excited for the continued updates. Speaking of that I need to do the updates on my build.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 03, 2018, 08:54:21 AM
This RPi3 is indeed a little computer and quite a thing for it's price and size.  It starts up with a windows-like desktop and enough applications to do some real work.  It comes with a light version of Chrome and some MS Office style applications for docs and databases and what not.  Plus it has a lot of the development tools on the distro and is ready to rock right out of the little box.

I am also running an application call VNC Server on it that allows me to use a remote desktop on another PC to do the work remotely, or in my case from a more comfortable chair.  VNC works pretty well and is pretty fast so it feels like you're on the native machine.

It is kind of nice to do the development work right in the environment that's going to be used for the finished product.  Here's a screen shot of the RPi desktop with a browser, and IDE, a file manager, and a terminal window open:



 (https://forestryforum.com/gallery/albums/userpics/39962/Screen_shot1.jpg?easyrotate_cache=1514987253)


If you know Linux it's a breeze.  If you don't know Linux, it's still a zephyr.  Linux is quite nice and I wish I had gotten familiar with it earlier.  All in all, the little 35$ Raspberry Pi is a nice little platform.  If you use the Pi 0, it's only ten bucks and has almost as much capability.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 03, 2018, 10:01:42 AM
Friend of mine just said the 8622 I think the model was is only $2
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 03, 2018, 10:42:38 AM
That may be.  I'm not in a position to provide much help on that.  I probably have a total of about seventeen minutes studying Arduino capabilities, and not much more than that on the RPi.  You may end up with both.  The cost of that part of a setworks-type project will be trivial compared to sensors and actuators and switches and displays and stuff.

From what I've seen, the Arduino seems better suited to real-time, embedded systems type work.  Hopefully it has better ways to handle things like PWM and the PID libraries needed for controlling something like a sawmill head.

I think pineywoods has been there, done that.  He was replacing the replacing the brain I think,  with all the control and feedback in place already.  You'll be  starting from scratch, so it will be challenging.  It will be interesting to follow your progress and see how it all shakes out.  Hey - winter is a good time for this kind of thing.  You don't really need to have your mill finished to get started!!  Go for it!!!
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 03, 2018, 10:51:30 AM
I already have random stuff here at work to play with. I should start doing that.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 04, 2018, 11:46:20 AM
Chipping away at it.  Got all three t/h sensors hooked up and reading.  Working on setting up SQL database and time management.  Then it's just a matter of uploading data on periodic basis to one of the free db servers.  I also want to be able to check current data with cell phone.  All of these things are pretty straightforward but take a little time to get done.

I also have to get some real sensors to use inside the kiln and work on the wet-bulb thing.

At some point I'll need to figure out enclosures and wiring plan.  Right now it's just a science project.



 (https://forestryforum.com/gallery/albums/userpics/39962/RasPi_01.jpg?easyrotate_cache=1515084314)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 04, 2018, 12:11:42 PM
Readings



 (https://forestryforum.com/gallery/albums/userpics/39962/2018-01-04-115830_1920x1080_scrot.jpg?easyrotate_cache=1515085841)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 04, 2018, 12:13:26 PM
Hard to read.  Oh well.  Just a bunch of numbers and timestamps.  Trying to adhere to the FF "post more pictures" rule.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 04, 2018, 12:21:00 PM
Does that export to excel or csv?
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 04, 2018, 12:37:00 PM
It can be put into a csv file instead of going to the screen.  Probably better to put in a database and let SQL handle the overhead. 

Basically the data can be anything you need it to be.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 04, 2018, 01:05:08 PM
thats great if you know SQL. I dislike it and it hates me :)

However, I am a master with excel.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 04, 2018, 01:11:08 PM
 smiley_clapping

Looking good!

Meanwhile, back at the CT ranch, I'm still waiting for my goodies to ship.

For those reading unfamiliar with the CSV format, it's simply a text file with values separated by commas, hence the file extension abbreviation: Comma Separated Values.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 04, 2018, 01:22:26 PM
It can be done any way that suits you.  That's the good thing about doing this.  I'm not adept in SQL either but I can pick my way through a simple thing like this.  I think it's the easiest way (for me) to get data stored, then put up into the cloud, and then retrieve it.  Then I'll put it into Excel too to use it.  It's just personal preference.  I think it will be the easiest and quickest way for me to get to the ultimate goal.  I may also be wrong about that.  :D
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 04, 2018, 01:44:43 PM
google drive and google sheets may be something worth looking into for that? Or maybe java? I forgot you want to view it on a website.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 04, 2018, 01:52:49 PM
Those too. 

These days there are many ways to skin this particular cat.  I guess that's the  good news.  At some point it comes down to grabbing a weapon and joining the battle.  But when it's time for the battle, you need have picked out your weapon.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: GeneWengert-WoodDoc on January 04, 2018, 05:18:38 PM
If you want a formula for calculation of RH from DB and WB, see
http://maxwellsci.com/print/rjaset/v6-2984-2987.pdf

If you want formula EMC values, see the Wood Handbook (2010 edition), equation 4.5.

For a complete table, see DRYING HARDWOOD LUMBER, about page 15.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 04, 2018, 05:56:06 PM
Thanks Doctor Gene, that's very helpful.  The document you reference is directly relevant to this task.  Now we have the info needed.  That makes this a productive day!!
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 05, 2018, 08:01:05 AM
Starting to work on the data file and cloud storage today.  The more I look at alternatives and work on the implementation I'm starting to think that a simple CSV format will be the better solution.  It will become more clear as the work progresses.

Interesting Arduino boards with built-in wifi:

https://smile.amazon.com/gp/product/B01IK9GEQG/ref=pe_2518910_267133250_em_1p_6_ti

https://smile.amazon.com/HiLetgo-Internet-Development-Wireless-Micropython/dp/B010O1G1ES/ref=pd_bxgy_328_2?_encoding=UTF8&pd_rd_i=B010O1G1ES&pd_rd_r=6A4555HBFEQNFHBFZAEK&pd_rd_w=ykKCK&pd_rd_wg=evdaz&psc=1&refRID=6A4555HBFEQNFHBFZAEK

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 05, 2018, 08:11:16 AM
I talked to an electronics guy here at work and he felt that for kiln monitoring the raspberri pi was the best option but for the simpleset I want to do definitely need to do arduino.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 05, 2018, 09:27:36 AM
You're fortunate to have easy access to someone like that.  I don't think there is a wrong choice.  I wish I had time to get an Arduino and do it BOTH ways.  I've only got another week that I can focus on this before I have to move on to another commitment.  It's gonna take me that long long just to get these particular worms back in the can.  Maybe longer.  Yesterday I should have had 8 hours of undivided attention to this and it turned out to be about 30 minutes.  Today I'm hoping to put more time on it. We'll see.  I have it reading the sensors on a schedule now and I'm working on the data collection and cloud storage.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 05, 2018, 09:33:25 AM
Sweet. at least you are making progress.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 05, 2018, 02:05:05 PM
While I sit on my thumbs waiting for my electronics, I've been thinking about how to house the device.  But for the wifi aspect any old enclosure would work.  One made of steel will kill the radio signal instantly, as will anything that is too conductive.  I suspect any plastic, abs, polypropylene, or fiberglass enclosure will permit enough signal to allow decent data transmission.

I would want it to be big enough to allow mounting a 120v outlet in addition to the RPi and associated circuitry.  I'm visualizing something like the box containing my telephone service entrance, but my google-fu has been weak in finding something that fits my criteria perfectly and doesn't cost $100 plus shipping.  I suspect a visit to the local Re-Store will be fruitful.  Anything weather resistant and roughly 12x12x4 should do the trick.

Assuming the enclosure is mounted on the wall of the kiln, I would run cabling for the sensors though the kiln wall into a waterproof junction box inside the kiln.  If at all possible I would have the junction box inset so that it is nearly flush with the interior kiln wall to minimize opportunities for it to be damaged during loading and unloading.

Once the kiln is loaded, the sensors would be placed either in the stack or on the wall and connected to the junction box with either a mil-spec connector or a trailer/RV connector.  Price and suitability for kiln temperatures would drive that selection.  I can see having three temperature probes set up on a pigtail about 6' long.  One probe would be inserted into a board in the stack.  The other two would be clipped to the wall, with one of the probes having a wick and reservoir for wet bulb temperature.  Just before closing the door the pigtail would be inserted into the socket on the junction box.

One could skip all the junction box and connector mess and just wire the sensors direct to the RPi.  During unloading and loading the sensors could be coiled up hung out of the way on a conveniently placed Velcro strap.  This way would be less costly and less complicated.  But I have no clue which would be better in a given kiln.  I think at the very least there should still be a junction box inside the kiln, for when a sensor needs to be replaced.  If one had to thread a cable through the kiln wall every time a thermistor failed it would probably motivate the owner to put in a junction box anyhow.

Those are my thoughts.  Any of it sound helpful for your existing or future operations?

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 05, 2018, 02:14:37 PM
I like a common junction box as a pass through. makes running wires and anything else in and out easy. The real trick is keeping it clean dry and the insulation loss in that area.

Would it make more sense to come through the roof? hanging wires be less likely to get ripped out or damaged if walking around in there.

there are also some mil spec wire connectors that have a ton of leads. that would be the ultimate setup. 1 plug to plug in all the stuff inside the kiln. When not in use unplug and put in storage place. then the only thing you would have to worry about inside the kiln is the plug and the wires.

Search mil spec ip69k connector. gives you lots of options. Make sure if you go this route you specifically find IP69K rated connectors. That is waterproof dustproof all the good stuff.

here is a good reference for IP ratings
https://www.averyweigh-tronix.com/News/news-and-case-studies-by-product/indicators-news-and-case-studies/what-is-the-ip-rating-system/
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 05, 2018, 03:52:32 PM
My first thought was to look for a suitable plastic NEMA box.  They even have a few to choose from at HD or Lowes, or any electrical distributor for more choices.  Two plastic conduits through the wall of the kiln from the back of the box which would be mounted on the north wall somewhere.  I plan to mount two temp sensors inside - one in the collector area and one at the outflow of the lumber stack.  Maybe two wb thermo's at the same locations or maybe one wet bulb - TBD.   Put one DHT22 outside for reading ambient t&rH.  The main detail to be worked out is proper isolation/insulation for the relay board on the HV side of things.

Progress:
- Now storing CSV data in a file. 
- Looking around at various free IoT server options for moving data to the cloud.  There are options out there, just trying evaluate and make a choice.  Already signed up for thingspeak.com, but so far not excited about how they work.  Or I haven't found what I'm looking for on their service.

CT - I hope you get your goodies soon.  I have to order some temp sensors and a relay board.  I haven't decided on the best temp sensor to use.  I'm interesting to see you yours does.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 05, 2018, 08:44:32 PM
Still no joy with Amazon.  I'm headed out to the property for the weekend.  If it hasn't shipped by Monday I may cancel and go with someone else.

Thanks for the link on the NEMA connectors.  My first thought was that IP69k would be overkill, but the 9k aspect protects against high temperature spray so should hold up to the heat of the kiln.  Right?  say_what
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 05, 2018, 08:50:04 PM
That was my thought and the reason for the recommendation. The other reason for that is you can drill a 1/2" hole in the kiln for the wire to pass through and then mount a plate with the connector inside. if you seal the wire it will be very little if any leak helping to keep the kiln better. Then all you need to do is take your full harness and plug in in after all the sensors are located where you want them.

I am all about doing things the easy / lazy way. This will also make wire runs quite a bit cleaner if done right.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 05, 2018, 09:44:13 PM
I'm just going to run some plenum rated cable from the terminal block outside (inside the box with the brain) to the sensors. The sensors will be soldered on.  No connectors.  It's not quite that bad in there - it's not the surface of Venus.  The a/c wiring inside my kiln is EMT and regular duplex outlets and they're doing ok. 

Like the old saying goes: "it's not the heat, it's the humidity".  Plus some noxious gasses from the oak, etc.  I'm going to consider some of those things inside to be consumable.  Heck, the kiln itself only lasts about, 10 years I'm told.

The inside of the kiln is not a neat and tidy environment except for the day you finish building it.  In operation it's never completely closed up either - the vents are cracked open just a bit.  It's supposed to be pretty tight, but not like a submarine.  At one time I thought it should be air-tight to a depth of 20 fathoms, but I learned otherwise.  I guess we build 'em as tight as we can because there still be will be a few air leaks here and there anyway - and then we crack the vents a bit.

Anyway, that's just my approach to the wiring thing.  Low cost, a little bit rock and roll.  Not exactly Mil-spec.  But effective and dependable.  Rev B might be stepped up a little if there needs to be a Rev B.

That's just me.  Everybody builds to suit themselves.  (That's the benefit of my no longer being in the manufacturing biz.)

By the way CT, that seems odd for Amazon.   FYI mine came from Amazon (prime) and they didn't show as SHIPPED until very late the night before they were delivered, on time.   (There is a distribution center here though.)  It seems like the movement between Amazon facilities does not show up in the tracking detail.  Or maybe they just messed yours up.  I hope not.  I'm hoping you get your stuff so you can get started.

===

Not sending data to the cloud yet, but local file writing is doing fine. 

Nosed around on Thinkspeak a little and it may be OK.  TBD

I got sidetracked trying to setup SAMBA on the RPi so I can see it on the Windows network.

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 06, 2018, 09:26:41 PM
Using ThingSpeak.com for cloud storage for now.  Got my application connected and uploading static test data on regular intervals, so that's progress.  I need to hook that process up to the sensor reading process and then I'll have something that is pretty close to the finished deal. 

On another front. the RPi is now able to connect to my Windows network.  I can access network devices from the RPi but so far I can't see the RPi from a Windows machine on the network.  I'm still trying to configure Samba to make that happen, but it's not a major concern at the moment.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 07, 2018, 03:16:48 PM
Finally got the sensor data going to the cloud in real time.  It's a good milestone.  It's viewable at https://thingspeak.com/channels/398226.
This is just test data, taken from three different t/rH sensors in my home office.  One is room temp, one is the temp of the case opening of the RasPi, and the third is sitting directly over a radiator.  The charts are not very useful - they're just the default charts that come with a new channel page.  They will be replaced with something more useful later.  I have the updates going out pretty rapidly for now, just to speed up the testing process.  I will plan to update the readings every 15 minutes when this is installed in the kiln.

I need to do some housekeeping and cleanup work on the existing code, but it's functioning pretty well at this stage.  It's about time to order some different sensors and start working on the wet-bulb readings.

Thingspeak.com is owned or run by Mathworks, the company that makes Matlab.  I see where they have functions for dewpoint/rh/wetbulb conversions.  These may be of some help in the rH calcs.  To be investigated. 

I have very little experience with Matlab.  Maybe CT, or somebody is fluent in Matlab.  That could be a good thing.

I suppose ChugiakTinkerer is off-grid this weekend.  Maybe his Amazon package will be waiting for him when he returns and he'll get started.

When it warms back up tomorrow I plan to take this RPi outside and test its wifi range.  Hopefully it will be sufficient. 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 07, 2018, 06:52:08 PM
looking pretty sweet. I wish I knew more about matlab. all I know is it is installed on my pc at work.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 08, 2018, 02:14:23 PM
Amazon sat on my order for a week, so I just canceled it this morning.  Placed an order with SparkFun for an RPi 3, two DS18B20 waterproof sensors, and a BME280 breakout board for temp/pressure/humidity.

My limited exposure to Matlab was when I was in grad school.  It ran in DOS and needed a math co-processor, which I didn't have.  My advisor had it on his office system, and I have a vague recollection of making some nifty 3D graphs with it.  Something tells me my experience won't be very helpful in this day and age.

We spent the weekend at Lake Louise opening a trail to our property.  Our place is 10 miles from the lodge, and only the first half it had trails established.  So Saturday was spent breaking trail in about 3' of loose snow.  Starting out Saturday morning there was fog on Lake Louise.  I could just make out four caribou, and this is the best I could do with my phone:


 (https://forestryforum.com/gallery/albums/userpics/43616/20180107_Cabin02.jpg?easyrotate_cache=1515437964)

We broke trail for about 4 hours and got within 1/4 mile of our place and ran into overflow on our lake.  I was able to power through the worst of it and only got stuck in wet frozen snow with thankfully no standing water.  By the time we extricated ourselves the sun was going down so we headed back to the lodge.  I neglected to take any pictures, but this thread on Trapperman shows lake conditions about like mine. https://trapperman.com/forum/ubbthreads.php/topics/4368161/Re:_Advice_on_getting_snowmobi#Post4368161

On Sunday we were able to make it to the property.  I have a temporary structure up, a Hansen Weatherport as shown below.  Everything looked great, no visits from bears or squirrels.


 (https://forestryforum.com/gallery/albums/userpics/43616/20180107_Cabin01.jpg?easyrotate_cache=1515437610)

Back on topic: SparkFun sent an email confirming my order, so Yay! for modern commerce.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 09, 2018, 08:50:38 AM
Glad to hear your goodies are finally on the way.

Thanks for the pics from the lake property.  I guess I shouldn't complain about snow and cold weather we have here. 

By the way - DON'T install Cayenne on your Pi!  (I mentioned Cayenne app earlier - it can control the Pi from your cell phone.)  It is not well designed and wastes resources - even when you're not connected.  It is also hard to get rid of.  smiley_devil

I hope your package gets there soon.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 09, 2018, 09:05:54 AM
Thursday I should be receiving some DS18B20's and a relay board.  I need to come up with a proper wick and reservoir to make the wb thermo.  I wonder how you keep the reservoir from freezing during cold weather?  The wb doesn't need to function below freezing, but it needs to survive without baby sitting.

Today I should be able to test the wifi range.  My kiln is pretty close to the house and well within range for my cell phone, so I'm hoping the Pi will be fine.  I've seen where people have installed an external antenna, but that's just another project.

HD has 12x12x4 plastic NEMA box in stock which should be fine for an enclosure.  I'll need to work out some ventilation issues.  We'll see how that goes.

Uh oh - thinking again.  Danger!  It's certainly possible to rig up something on the Pi to take resistance measurements.  And do some calcs.  And look up things in charts.  And compute moisture content.  Is this crazy?  Is there enough data available to build in a viable wood moisture content monitor?  And . . . maybe some load cells to weigh kiln samples.  ??  Whoa Nelly!  Calm down!



Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 09, 2018, 09:22:24 AM
no, no, don't stop. Keep going :)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 09, 2018, 11:19:51 AM
 :D :D :D

I saw somewhere that cotton shoelaces make a good wick.  They are certainly affordable.

You could also hook up an ultrasonic transducer and measure the time it takes to bounce a signal off the end of your stack of lumber.  An increase over time means the stack is shrinking, yet another indicator of moisture content... 8)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 09, 2018, 11:22:13 AM
if your gonna use size could always use laser measure :)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 11, 2018, 04:27:09 PM
I've been trying to catch up on chores and running errands for a couple days.  Not much work getting done on the data logger.  A little, but nothing too exciting.

Today I got some more sensors and stuff.  Five of the DS18B20 waterproof thermos, a light level sensor, the relay board, and some terminal strips to help with the wiring.  I have add some things to the software to support the new sensors and relay board.  The biggest task is to get the Pi mounted in an enclosure and wire it to the terminal strips, then install it all in the kiln.

CT - I hope you get your package soon. 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 12, 2018, 02:20:29 AM
Nobody loves me.  My order with SparkFun doesn't appear to have shipped yet either.  I'll try a call on Friday to see what's up.

It's busy season at the property.  Even if my goodies arrive tomorrow I probably won't get much done this weekend.  Going to take advantage of the three day weekend and get some work done on my guest cabin.  Or clear some trees.  My wife wants to go to town on the trees at the site where we want to put the main cabin.  So we'll see what the boss wants and go from there.   8)

I may surprise her with a battery-powered chainsaw, if I can find one in stock in town.  So not much progress likely on the electronics front.

UPDATE: I called SparkFun and they apologized for the delay, apparently my order got put on hold by accident.  They upgraded me to priority shipping, so hopefully it arrives soon.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 14, 2018, 09:20:39 AM
That's got to be frustrating.  Getting your stuff shouldn't be the hard part of the project. 

In the meantime, maybe you could do some poking around in the IoT server world.  I'm using ThingSpeak.com currently, but I'm not convinced it's the best choice.  There are plenty of options out there, even for free.  Amazon (AWS), Google, and many others.  It's a bit of chore just to figure out who offers what and what the specifics are from one to the next.  ThingSpeak is limited to 8 data fields, plus I don't really like the lack of choices on setting up the screen.  Plus some other limitations.  Not bad, but there must be better options.

I'm working on wiring right now.  Not that interesting, but important.  I'm making a breakout for the GPIO to terminal strips that can accommodate  all the sensors.  There are some off-the-rack solutions out there, but I don't have them and I don't really like any of them any way.  Ultimately I will probably make a PCB specific to this project.

I have tested the DS18B20's and they work well.  I'm going to integrate the code for them into the project today. I haven't worked on a wet-bulb setup, but that's on the agenda.  I'm thinking the math won't be that big of an issue in the Pi environment, but I'm not quite clear on whether some of the inputs to the equation are constants or not.  If they are all constants, it's doable.  If they are not constants, then how can a chart be accurate unless the only variables are wb and db? 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: scsmith42 on January 14, 2018, 02:44:26 PM
Guys, I think that this is a very cool project, and have a suggestion for you to consider.

For years I have felt that there were some significant improvement opportunities in managing the lumber drying process for small operators.  The oven dry sample board method is unquestionably very accurate, but it requires time.  Traditional pin type moisture meters are not accurate above FSP, yet most of the damage that can occur during the drying process takes place above 35% MC.

What I think that significantly improve the accuracy of the KD process is to add a system to measure the weight of your kiln carts (or stacks) as they dry.  Compression load cells are readily available that can provide input measurements to your Aurdino or Raspberry Pi systems and by incorporating in weight measurements into you kiln management systems you can use your RaPi controller to change kiln settings as necessary in order to achieve a targeted daily drying %.

If you start with a known board footage of your kiln load, you can determine how many lbs of water you want to target for daily removal and manage the drying process accordingly.  You can then calculate the MC% of the lumber based upon it's weight, and automatically change the temp and RH% based upon the actual MC% of the lumber.

To me, this would be the next step in the evolution of kiln drying methods.

Scott
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 14, 2018, 04:25:03 PM
That is an interesting idea.  Thanks for bringing it up. 

It would not be hard to manage the data from the load cells.  Setting up a kiln with load cells could certainly be accomplished, especially if you baked it in at the construction phase.  It would take some design and engineering, but not too overwhelming. 

The hardest part would probably be establishing the weight of the lumber pack itself minus the pallet, stickers, etc.  All of that is possible.  I guess the thing to determine is whether the benefit is worth going through all that.  Hopefully this will start a good discussion.  I'd love to play with some load cells. 

Looking forward to hearing from others about this.

(If this was about grits, there'd be 50 replies before dark tonight.   :D)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 14, 2018, 04:35:31 PM
In the background I have been thinking about using some load cells to keep track of sample boards in the kiln.  This also presents some challenges.  I didn't want to spend too much time on that because it's outside the scope of the original project.  (Feature creep.)  If it starts a lively discussion though - GREAT!

Would monitoring the whole pack be better?  Easier to implement?  If monitoring samples only, how could you do that if they are in the pack?  Can you treat the whole lumber pack like a sample?  Can you get enough data about the pack before it goes in the kiln to make it meaningful? Beats me.  Jump in.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 15, 2018, 07:37:34 AM
I would make a rail system on the floor for the carts to sit on and roll in and out. Put 4 load cells under the rail system. Measure all your lumber carts or pallets and mark the weight on them. When everything is placed in the kiln it will roll in on the rails real nice and you will get your weight measurement. Then the rest is in the programming.

Here is the real question. What would be the most accurate way of measuring?
Weight
Size
Pin type gauge
all of the above

With the pi it won't be hard to add all of this just going to take a little more time and money. If it was me I think I would want all of it. But I work in an industry where more data is better. The crazy thing is if you add all those sensors you could add a little more and make the kiln 100% automatic.

even if you did not do a rail system you could do 4 pads with load cells and just set your skid on that.

This has been my random convoluted mess of ideas in no particular order. Thankyou. please drive through.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ronwood on January 15, 2018, 09:45:58 AM
Can you purchase load cells that have the range required to handle the weight of the stack of lumber? I looked online yesterday and I only found some units that handle about 200 lbs.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 15, 2018, 09:52:50 AM
you can buy truck scales that will more than handle a full load. they are the same load cells with more stuff around them. they come with 4 or 6 pads to.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 15, 2018, 09:53:35 AM
ouch truck scales are expensive.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 15, 2018, 06:02:56 PM
It's possible to get the load cells.  That's the easy part.



I was expecting a little chatter about this from some of the experts.  Perhaps that means it's a cure for which there is no known disease.  Maybe there is no reason to look beyond existing methods.  Or maybe it's just they haven't been on the forum for a while.  In any case, it's been pretty quiet on this thread.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 16, 2018, 02:11:17 PM
I started working on the wet-bulb setup.  My first wick was not effective.  Need to get better a wick.  I do think the waterproof'd DS18B20 will work well for wb.  To be continued.

-- Got the light sensor working correctly on the I2C bus.
 
-- Now there are four DS18B20's and one DTH22 hooked up and working on the test rig.  That is the configuration I'll use when I install this thing in the solar kiln.

The biggest job ahead is to get this installed and wired in the kiln.  Plus the wb/db calcs to get the kiln humidity reading.  Weather is not really cooperating with outdoor work and kiln installation.  I'm going to be accumulating the necessary items for installing this thing and continue to work on the wet bulb setup.

I know all this is not needed to operate the solar kiln, but I am interested in tracking the data - just for science.  Having the ability to easily check temp and humidity will be very handy as well.  Plus I get fan control as a nice side-effect.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ronwood on January 16, 2018, 03:41:04 PM
Could you use the same material that is used for kerosene lamps?
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Don P on January 16, 2018, 04:34:34 PM
How do you get the evaporative cooling on the wb when the fan is off?
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 17, 2018, 08:47:17 AM
Ron - The wick needs to be tubular.  Lamp wick material may be ok, but it needs to encase the sensor.  I may have to break down and buy some real wetbulb wick.  Not hard to find, it's just not laying around the house right now.  I see people using cotton shoelaces, but apparently the shoelace I used had the wrong fiber content.  I'm sure the nature of the wick affects the accuracy of the measurement.

Don P - That's an important question.  Evaporation still occurs with no air movement, but the rate will change.  My experience with wet-bulb thermos is pretty limited and consisted mainly of taking a reading and looking at a chart.  This is my first go at making one and using it in a kiln.  It may need to be put in a housing and aspirated to get consistent measurements.  I have to do some research, unless somebody jumps in here with the answer.  Ugly weather here today.  Good weather for research.

Initially I'm going to put one of these DHT22 devices in the kiln as well, which measures both rH and temp.  It will probably fail or deteriorate, but it gives me something for comparison. Deterioration will be more of an issue than complete failure of the device.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 19, 2018, 02:09:29 AM
Got my goods today.  Now to play catch up!
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 19, 2018, 08:28:01 AM
 8)   smiley_horserider   Good deal, CT.  I'm looking forward to seeing your progress now that you have your stuff.


Got some nice weather coming this weekend.  Time to start installing this thing in the kiln.  I haven't done anything more with the wet bulb thermo.  For now I'm going to put the allegedly fragile DHT22's in the kiln.  I can always work on the web-bulb setup as time permits.  The kiln is empty right now, so it's a good time to do the wiring.  I decided to use a plastic power tool case to house the RPi and whatnot.  I have a good selection of them, since everything you buy seems to come with a molded plastic case.  One of them will be just right.  And free.  Maybe by next week it will all be setup and gathering actual data on the kiln. 

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 22, 2018, 02:17:47 AM
I've got Raspbian installed and started some very basic circuit building and programming in Python.  I was able to at least turn an LED on and off as shown below.

(https://forestryforum.com/gallery/albums/userpics/43616/IMG_20180121_215231571.jpg?easyrotate_cache=1516604315)

I've got a DS18B20 waterproof temperature sensor wired in as well, but I'm not seeing it in the W1 bus.  The problem I seem to have is that I did not purchase any 4.7k resistors.  The one in center foreground trying to be a pull-up resistor is only 330 ohms.  As I type this I realize it almost sounds like I know what I'm talking about.  If that's the case it's only because there are some very thorough tutorials out there.

I'm going to swing by Frigid North Electronics tomorrow and pick up those resistors as well as a new soldering iron.  I've got to do a little prep work on the BME280 sensor before I can use it.  Need to solder in a header on the wee little breakout board.  With the state of my vision I'll pick up a magnifying third hand helper station too.

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 22, 2018, 08:50:19 AM
You're on your way.  Those BME280 sensors are interesting.  I wish I had gotten some of those.

When you get the proper pullup resistor you should be fine. 

I started wiring and installation in the kiln.  Nothing too exciting to report, just wiring and drilling holes.  I re-wired the fan outlets to switch them with the relays and got the a/c out to where the box with the Pi will be mounted.  Not interesting enough for photos.  Most of the weekend was spent catching on up chores outside since the weather was so nice. 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: GeneWengert-WoodDoc on January 22, 2018, 05:14:23 PM
Back in about 1975, I developed a load cell weighing system that weighed an entire pack of lumber using load cells.  The main issue was the long term drift of the cells, so we did rezero every few days. The system had an automatic kiln temperature system based on load cell info.  The control system used proportional, rate and reset.

Prior to that, Delmhorst had an automatic system using two sets of pins driven to different depths, called the Kiln-Mo-Trol.  They have an updated version now.  It works well indeed.

Prior to that, the Moore Dry Kiln Company had a system called a Kiln-boy.

Subsequent to 1978, Bob Little at the University of TN developed a system that weighed the individual kiln samples.  The weighing system again had long term drift and temperature issues.  Also Lignomat developed a computerized system using pins.

Since that, many others have approached this problem of getting MC of selected pieces in a load.  I saw one where the sample was hung on a wire and the wire ran up and outside the kiln so the load cell was outside the kiln.  Kiln schedules are based on the wetter lumber and not the average, so weighing a pile is not sufficient.

After many tries, including measuring the energy input and measuring temperature drops, the best system we have still involves individual sample selection and weighing.  Once on the scale, computers are used to calculate MC, determine drying rates, establishing correct kiln setting$3so the job of using kiln sample boards is pretty easy now, with just a few minutes of labor each day.

Note that very precise MC is not usually required in lumber drying.  Further, most of the time, precise temperatures and humidity is not required.  Further, almost all defects occur at high MCs, so fancy controls for air dried lumber are a waste of money as they do NOT improve drying quality or time.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 23, 2018, 10:05:45 AM
That's useful information Gene.  Thanks for weighing in.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: scsmith42 on January 23, 2018, 03:09:28 PM
Gene, thanks for the insight.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: GeneWengert-WoodDoc on January 23, 2018, 10:00:04 PM
I have been asked to explain this paragraph from above in more detail...
"Note that very precise MC is not usually required in lumber drying.  Further, most of the time, precise temperatures and humidity is not required.  Further, almost all defects occur at high MCs, so fancy controls for air dried lumber are a waste of money as they do NOT improve drying quality or time."

To run a kiln using moisture content, we use the average of the wettest half of the samples.  Even then, the schedule does not use decimal points when referring to MC, so 1/2% MC will work.  It is only in getting the final MC that we do try to be more accurate sometimes.

The schedule temperature for air dried can be plus or minus one or two degrees and the humidity within 5% RH during much of the schedule.  We are somewhat concerned about overdrying, so we do try to get the correct humidity at the final stages, within a few percent RH.

The schedules were developed in the early 1950s.  At that time they were usually used with equipment that measured within 1/2 degree F.  Billions and maybe trillions of board feet were dried successfully with that equipment.  Obviously a safety factor was built into the schedule, recognizing the limits of the equipment.  Today, with better controls, we know what temperature we have to 1/10 F.  So, the old schedules can be accelerated a small bit with better controls without jeopardizing quality.  However, most operations do not appreciate a gain if the lumber is ready a few hours earlier.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 24, 2018, 10:43:57 AM
I'm successful connecting all my sensors up and running basic tests.  Next up is some actual programming, not the monkey-see examples I've used so far.  The DS18B20 were giving me fits originally, even after replacing my resistor with a 4.7k one.  It turns out my little expansion board was causing the problem.  I ditched it and wired directly to the Pi and now all is well.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 25, 2018, 09:52:07 AM
Good going, CT.

What other sensors did you get besides the DS18B20's?

I'm thinking there must be a humidity sensor out there that will stand up pretty well, but I haven't taken the time to look around yet.  If the wb thermo can be avoided, that's not a bad thing.  For now I'm installing both the 18B20's and DHT22's in the kiln.  I'll use the DHT22's for humidity and see how long they last.  In the mean time I can work on the wick and wb setup OR find some more robust humidity sensors.

I've been working on the installation, but haven't been able to spend a lot of time on it.  Finding ways to mount and shade the sensors takes a little time and creativity.  I still haven't come up with the box I'm going to use to house the electronics.  It's all progressing, but there other things on the agenda right now.

The software is pretty much done.  Right now it's set up to send 8 data fields up to Thingspeak and also store data locally in a csv file.  It will start a new file every Sunday morning at 5:00 a.m., so there will one week's data in each file.  The recording interval is set for 15 minutes, although that can be changed easily.  15 minute intervals seems about right - we'll see.  There's no problem making the sample interval shorter or longer.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 25, 2018, 01:24:43 PM
I have a BME280 that I purchased from SparkFun.  It's on a little breakout board, not a package that seems like it would hold up well.  I got that because it provides barometric pressure as well as temp and humidity.

The 1-wire device is real easy to use and code for.  Configuring your system for it is a bit more of a hassle but the coding is nothing.  The BME280 on the other hand is easier to set up the system but the code is a mess.  I downloaded a python script to read it and am using that, but I haven't even attempted to understand it.  I'll delve into it later if the need arises.

Here's the code I started from to read the DS18B20:
[spoiler]def read_temp_raw():
   f = open(device_file, 'r')
   lines = f.readlines()                                   # read the device details
   f.close()
   return lines

def read_temp():
   lines = read_temp_raw()
   while lines[0].strip()[-3:] != 'YES':                   # ignore first line
      time.sleep(0.2)
      lines = read_temp_raw()
   equals_pos = lines[1].find('t=')                        # find temperature in the details
   if equals_pos != -1:
      temp_string = lines[1][equals_pos+2:]
      temp_c = float(temp_string) / 1000.0                 # convert to Celsius
      temp_f = temp_c * 9.0 / 5.0 + 32.0                   # convert to Fahrenheit
      return temp_c, temp_f

[/spoiler]

And here's the code I used for the reading the BME280.  Granted, I am reading three sensors here, so some additional complexity is expected.

[spoiler]def readBME280All(addr=DEVICE):
  # Register Addresses
  REG_DATA = 0xF7
  REG_CONTROL = 0xF4
  REG_CONFIG  = 0xF5

  REG_CONTROL_HUM = 0xF2
  REG_HUM_MSB = 0xFD
  REG_HUM_LSB = 0xFE

  # Oversample setting - page 27
  OVERSAMPLE_TEMP = 2
  OVERSAMPLE_PRES = 2
  MODE = 1

  # Oversample setting for humidity register - page 26
  OVERSAMPLE_HUM = 2
  bus.write_byte_data(addr, REG_CONTROL_HUM, OVERSAMPLE_HUM)

  control = OVERSAMPLE_TEMP<<5 | OVERSAMPLE_PRES<<2 | MODE
  bus.write_byte_data(addr, REG_CONTROL, control)

  # Read blocks of calibration data from EEPROM
  # See Page 22 data sheet
  cal1 = bus.read_i2c_block_data(addr, 0x88, 24)
  cal2 = bus.read_i2c_block_data(addr, 0xA1, 1)
  cal3 = bus.read_i2c_block_data(addr, 0xE1, 7)

  # Convert byte data to word values
  dig_T1 = getUShort(cal1, 0)
  dig_T2 = getShort(cal1, 2)
  dig_T3 = getShort(cal1, 4)

  dig_P1 = getUShort(cal1, 6)
  dig_P2 = getShort(cal1, 8)
  dig_P3 = getShort(cal1, 10)
  dig_P4 = getShort(cal1, 12)
  dig_P5 = getShort(cal1, 14)
  dig_P6 = getShort(cal1, 16)
  dig_P7 = getShort(cal1, 18)
  dig_P8 = getShort(cal1, 20)
  dig_P9 = getShort(cal1, 22)

  dig_H1 = getUChar(cal2, 0)
  dig_H2 = getShort(cal3, 0)
  dig_H3 = getUChar(cal3, 2)

  dig_H4 = getChar(cal3, 3)
  dig_H4 = (dig_H4 << 24) >> 20
  dig_H4 = dig_H4 | (getChar(cal3, 4) & 0x0F)

  dig_H5 = getChar(cal3, 5)
  dig_H5 = (dig_H5 << 24) >> 20
  dig_H5 = dig_H5 | (getUChar(cal3, 4) >> 4 & 0x0F)

  dig_H6 = getChar(cal3, 6)

  # Wait in ms (Datasheet Appendix B: Measurement time and current calculation)
  wait_time = 1.25 + (2.3 * OVERSAMPLE_TEMP) + ((2.3 * OVERSAMPLE_PRES) + 0.575) + ((2.3 * OVERSAMPLE_HUM)+0.575)
  time.sleep(wait_time/1000)  # Wait the required time 

  # Read temperature/pressure/humidity
  data = bus.read_i2c_block_data(addr, REG_DATA, 8)
  pres_raw = (data[0] << 12) | (data[1] << 4) | (data[2] >> 4)
  temp_raw = (data[3] << 12) | (data[4] << 4) | (data[5] >> 4)
  hum_raw = (data[6] << 8) | data[7]

  #Refine temperature
  var1 = ((((temp_raw>>3)-(dig_T1<<1)))*(dig_T2)) >> 11
  var2 = (((((temp_raw>>4) - (dig_T1)) * ((temp_raw>>4) - (dig_T1))) >> 12) * (dig_T3)) >> 14
  t_fine = var1+var2
  temperature = float(((t_fine * 5) + 128) >> 8);

  # Refine pressure and adjust for temperature
  var1 = t_fine / 2.0 - 64000.0
  var2 = var1 * var1 * dig_P6 / 32768.0
  var2 = var2 + var1 * dig_P5 * 2.0
  var2 = var2 / 4.0 + dig_P4 * 65536.0
  var1 = (dig_P3 * var1 * var1 / 524288.0 + dig_P2 * var1) / 524288.0
  var1 = (1.0 + var1 / 32768.0) * dig_P1
  if var1 == 0:
    pressure=0
  else:
    pressure = 1048576.0 - pres_raw
    pressure = ((pressure - var2 / 4096.0) * 6250.0) / var1
    var1 = dig_P9 * pressure * pressure / 2147483648.0
    var2 = pressure * dig_P8 / 32768.0
    pressure = pressure + (var1 + var2 + dig_P7) / 16.0

  # Refine humidity
  humidity = t_fine - 76800.0
  humidity = (hum_raw - (dig_H4 * 64.0 + dig_H5 / 16384.0 * humidity)) * (dig_H2 / 65536.0 * (1.0 + dig_H6 / 67108864.0 * humidity * (1.0 + dig_H3 / 67108864.0 * humidity)))
  humidity = humidity * (1.0 - dig_H1 * humidity / 524288.0)
  if humidity > 100:
    humidity = 100
  elif humidity < 0:
    humidity = 0

  return temperature/100.0,pressure/100.0,humidity

[/spoiler]

This is my one and only I2C device, but I think the complexity lies with the device and not the use of the I2C bus.  It's not a big deal, once the routine is written it's good to go.  But it has the feel of a kludge.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 25, 2018, 01:39:10 PM
Somewhere in my internet travels I saw a humidity sensor chip that was packaged on a small board that was protected with a shrink-wrap cover.  A small hole in the shrink-wrap exposed the surface of the sensor itself.  I'm not able to find that now.  >:(

There's a good article on the different types of humidity sensors at https://www.sensorsmag.com/components/choosing-a-humidity-sensor-a-review-three-technologies
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: GeneWengert-WoodDoc on January 25, 2018, 11:47:37 PM
Chugiak...the article you cited is 18 years old.  I am curious if any advances or changes in humidity measurement have been made since then, or is this still state-of-the-art-the-art information.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 26, 2018, 02:42:42 AM
Thanks for pointing that out, I hadn't noticed the date.  I don't claim a lick of expertise in this area, but I doubt there's been any fundamental breakthroughs, at least that have gotten to the production stage.  Advancements have probably been in the realm of power draw, smaller and more sensitive sensors, improved operating temps, etc.  Evolutionary rather than revolutionary changes, I suspect.  But I am married, so that's proof right there that I am wrong on just about anything on a regular basis.   :laugh:
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: PA_Walnut on January 26, 2018, 06:37:40 AM
We run by an adage an old woodworker taught me, which is now almost gospel:

(https://forestryforum.com/gallery/albums/userpics/46676/betteris.jpg?easyrotate_cache=1516966520)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 26, 2018, 08:18:58 AM
Good point, PA_Walnut.  Perfect is the enemy of done, also.  Since this is just an experimental thing, I've stopped worrying about some of the long-term issues and I'm just going with what I've got on hand.  If a few $3 sensors get consumed - oh well.  Some of those issues can be dealt with if and when they come up.  I'm using plain old cat5 cable and hard wiring the sensors that I have and we'll see how they fare.  It's not going to be difficult to deal with any failures that occur.  Besides, this thing might get retired after a year or so.  Collecting this data is just a matter of curiosity for me.  It's not necessary to do all this just to run the kiln and dry lumber.  We may even find some robust humidity sensors along the way.  There are many industrial processes being monitored and controlled with various sensors.  This has been figured out already somewhere.  I'm installing a couple temp sensors that can be turned into wet bulb sensors, but the mechanics of that can be figured out later, if at all.  The DHT22 sensors will work for now - maybe forever.  The BME280 that Chugiak is using is probably a better choice for measuring humidity.  We'll find out about all that.  It's easy enough to change some of this after the thing is up and running.  The only thing slowing me down right now is lack of time to sort out some of the installation issues, like finding the right size enclosure for the electronics at the right price.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 26, 2018, 08:46:44 AM
instead of thinking of it as temporary I would think of it as a stepping stone to a fully automatic kiln that automatically adjusts the fans and vents to keep it at optimal drying conditions.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 27, 2018, 11:39:20 AM
Sensors are all connected and reading accurately, as far as I can tell.  Here's a screen capture of my test program.  The Pi and sensors are still sitting on my desk and should report the same temperature, although there is a slight draft from the window in my office so some variation is expected.  Still, for any sort of accurate measurements each sensor should be individually calibrated.

(https://forestryforum.com/gallery/albums/userpics/43616/20180127_ScreenCap.jpg?easyrotate_cache=1517068391)

A couple things I've figured out regarding the BME280:
Regarding the DS18B20 temp sensors:

On wet bulb calculations of relative humidity:

https://www.youtube.com/watch?v=mB9VTmQ5V4o

Edit to add:  I've been thinking about the potential for corrosion on the BME280 breakout board.  When I get to the stage that I am ready to install a remote weather station I will try coating the board in silicone.  The chip itself would need to be exposed to the environment, so a little blutack tape over that will protect it while I apply the silicone.  That's my thinking at least.  The housing for the chip will be exposed, allowing measurement of the humidity.  I don't think the rest of the components on the board will generate any heat to worry about.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 28, 2018, 08:54:06 PM
I've set aside wet bulb measurement and the DS18B20 temperature sensors while I focus on local network reporting.  I started out doing my monitoring with a Python script and running that on a timer.  I installed sqlite3 and can easily dump records into a table.  My next challenge was to enable a local web service for monitoring from my desktop.

The Raspbian operating system comes with Node-Red installed, which is a visual programming tool well suited for remote data monitoring.  It makes use of Javascript and uses workflows to pass messages from one node to the next.  It's a different paradigm from what I'm used to so it's taking some time to learn new methods.

One of the problems I had was the difference in timestamps between Python, sqlite3, and Node-Red.  I bypassed that issue by having Node-Red do all the work.  I've dropped Python completely and am polling the BME280 with Node-Red, then passing the resulting data to a function that splits the temp, humidity, and pressure into three different messages.  The messages are then sent to dashboard nodes for display on the dashboard web page.

I've got the Pi sitting on my back deck sampling every 5 minutes.  Currently temps are around 10 F so the relative humidity reading is wacky.  I'm still working on understanding if it's just a wonky sensor or if the high relative humidity is because the air can hold so little water.  Here''s a snapshot from a few minutes ago...

(https://forestryforum.com/gallery/albums/userpics/43616/20180128_ScreenCap.jpg?easyrotate_cache=1517190730)

Edit to add: Temp is in Celsius, relative humidity is percent, and pressure is in millibars.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 29, 2018, 05:11:08 PM
Very cool, CT.  That's a nice looking dashboard.

I saw NodeRed on the programming tools menu, but I had no idea what it was.  I'm an embedded systems guy, so I tend to go in that direction.  I better investigate.  Besides, Jack Nicholson didn't fare well after ordering a Node Red in A Few Good Men.  I can't handle the truth!

Anyway, that looks good.  Can something like fan control be handled from NodeRed?  I don't have time to investigate right now.  I am neck deep in a bunch of things unrelated to any of this.   My logger is all done, except for the dashboard, and I'm working on installing and wiring it whenever I have a few minutes to put into it.  I must say that wiring and housing issues are not that interesting, but they are what's next for me.  By the way - I'm using hot-melt glue instead of silicon for weather-proofing little sensor pcbs.  I find it easier than silicon.  Just another means to the same end.

One of the data points I'm really interested in seeing when this thing gets installed is the difference between kiln rH and the rH figure that would be the result of raising outside air to the temp of the kiln.  That delta would show how much of the kiln rH is contributed by the evaporation of the moisture in the stack.  One of the challenges for the ambient air sensor is getting them far enough away from the kiln so the heat and escaping humidity doesn't spoil the reading.  It doesn't sound like a big problem, but in reality it complicates things a bit.  Like everything, the devil is in the detail.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on January 29, 2018, 08:37:40 PM
I think Node Red was created for IoT and home automation, so it sure ought to be able to handle a little solar kiln management.  There are nodes for the GPIO on the Pi, so reading and writing pin status ought to be a snap.  Plus there is the module for the BME280 and probably every other major sensor.

For your ambient relative humidity, one option would be another Pi/Arduino and an accurate humidity sensor.  Or, would a reading from a nearby weather station be close enough for your needs?  Just a question that occurred to me, I have no clue how lumpy moisture distribution might be.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 29, 2018, 09:40:30 PM
Seems like a perfect fit. I'm glad you brought it up. I wish I had known about it before I finished. I might still find a place to use it.

A second pi or arduino might be easier than running a wire. The sensor just needs to be away from the kiln so it's not getting heat and moisture readings affected by the kiln. Not far really. Doesn't need to be super accurate. Have you looked at some of the guidelines for placing outdoor sensors? Useful info. Noaa has guidelines. Siemens has a good white paper on all sorts of placement guidelines.

In the end, this only needs to be as accurate as the user wants it to be. I've found that temperature varies a lot around my place.  If I wanted to skew my temperature readings for a desired outcome it would be pretty easy.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 29, 2018, 09:48:54 PM
An aspirated housing seems to be the easiest way to deal with outdoor sensors. That's what the inexpensive weather stations use. Lots of examples out there mzde with pvc pipe and old cpu fans.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on February 03, 2018, 07:38:23 PM
Finally found what looks like a good enclosure without breaking the bank.

https://www.amazon.com/Orbit-57095-Weather-Resistant-Outdoor-Mounted-Controller/dp/B000VYGMF2

It has a panel inside as well as a GFCI outlet.  Will have to get one and see how it checks out.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on February 05, 2018, 09:12:19 AM
I'd call that a perfect solution CT.  Good find.  That never turned up in my searches.  FWIW, Home Depot carries that same box for 32$ and it's in stock at the closest HD.  https://www.homedepot.com/p/Orbit-Outdoor-Timer-Box-57095/100158884  I'm going to pick one up today.  I had a box I was going to use, but it wasn't well suited to the task.  This looks perfect.

I've been completely tied up for the last week or so and unable to do anything on the installation.  This week I'll have a little time here and there to work on it and the box you found will get me over the hump.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on February 05, 2018, 12:38:31 PM
Credit weathernick at WxForum.net (https://www.wxforum.net/index.php?topic=22428.0) for that enclosure.  He's got a very detailed Pi build for his weather station.  If you haven't read that thread yet, it may have some helpful info for your kiln monitoring.

I'm jealous that you can have instant gratification at Home Depot.  There are none of those stocked in Alaska.  I've been stuck at home the last few weekends, as temperatures at the property are uncomfortably cold.  Currently -36 F out there so I'm staying home instead and working on chores and my Pi project.

I'm not sure if it's a good fit, but have you looked at WeeWX?  It looks to be a decent way of displaying your sensor data.  I'm going to dig into it when I get a chance, as it may do most of the things I need for my weather station.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on February 05, 2018, 02:51:20 PM
I was very surprised that it turned up at HD and in stock no less.  It's probably because 50% (or more) of the homes around here have sprinkler systems.  I guess our weather is just a wee bit different than yours  ;).  I just got home with the newly acquired box.  It's going to work just fine.  Hopefully I can start fitting it up and get this thing installed.  I'm still pretty tied up on other things, but I have some cracks here and there.  The kiln is sitting empty until I get this thing installed, so I'd like to put it back in service.  The days are getting longer here now even though February is usually our worst weather.  I think maybe we got some of our  bad weather out of the way early, but the ground hog says there's still plenty of time for ugly weather.

I'll take a look at those sites.  Sounds like some interesting and useful stuff.

Stay warm.  -36 is not part of my DNA, and I don't expect that to change anytime soon.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on February 12, 2018, 07:38:38 PM
Seems like nothing's been going on with this thread lately. That's because I've been tied with a lot of mundane other things, but it looks like I'll be able to get the stuff installed this week hopefully.  There were lots of little details to work out with sensor housings and sunshades and wiring but most of that has been worked out.  Stay tuned.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on February 24, 2018, 07:31:31 PM
I finally got most of the installation completed.  The only item left is the sensor for ambient temp and rH.  It's a little more of a challenge to locate it correctly, since it needs to be far enough away from the kiln to avoid the heat island generated by the kiln.  Right now my kiln is located in the backyard in order to have proper sun exposure and reasonable access to a/c.  I plan to move it, but until then I don't want to create a big eye sore right near the house so can't just stick poles in the ground anywhere I want.

The Orbit sprinkler timer box worked pretty well as a housing for the thing.  A pretty good value all in all.  (Thanks for finding that Chugiak.)

(https://forestryforum.com/gallery/albums/userpics/39962/Kiln_Logger_02.jpg?easyrotate_cache=1519517643)

The relays for fan control are under the mounting panel, so the high voltage is safely isolated from the low voltage wiring out front.

(https://forestryforum.com/gallery/albums/userpics/39962/Kiln_Logger_01.jpg?easyrotate_cache=1519517643)

It's not the prettiest wiring job, but that's ok by me.  I wasn't trying to win a beauty contest, and done beats pretty right now.  It's been hard enough to carve out a little time to get this installed and functioning.

The kiln is empty right now, so the data is meaningless.  I plan to put a load in the next few days.  I will start putting the data up on ThingSpeak.com where it can be viewed easily.  More importantly, I am also storing the data locally in a file which will be useful for detailed analysis.

I'll post some data displays and links to the data files when they become relevant.


Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on February 28, 2018, 09:12:57 AM
Yesterday was the first sunny day since installing the logger.  Even though the kiln is empty, the data is interesting.  The weather and my schedule for the next week or so will probably keep me from putting a load in the kiln. 


(https://forestryforum.com/gallery/albums/userpics/39962/Kilndata_2-27-18.jpg?easyrotate_cache=1519826848)
 

The drop in temperature at 12:00 occurred when I opened the vents about 30%.  Before that, the vents were 99% closed.  The change in temp at 2:50 occurred when I turned on the fans with the vents still at 30% open. ??   Since there was no load in the kiln, the baffle was up and it was just a big chamber full of hot air.  This is not really indicative of typical operation, but interesting - to me at least.

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on February 28, 2018, 09:19:24 AM
(Chart posted on previous page:)
Kiln temp and humidity logger using the Raspberry Pi platform in Drying and Processing (http://forestryforum.com/board/index.php?topic=99386.msg1556921#msg1556921))

The data is being posted in real time to:
KilnDataTest2 - ThingSpeak IoT (https://thingspeak.com/channels/398226)
if you're interested.  

The raw data (excel) is here:
Dropbox - KilnData (https://www.dropbox.com/sh/5enlxju0c1o4j48/AAB0MTujwHFyij5eXQBFRoRZa?dl=0)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on February 28, 2018, 11:47:02 AM
btulloh thanks for posting this. that is some really good information. 60 degree ambient = 130 in the kiln. thats pretty crazy!
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: vfauto on February 28, 2018, 07:32:09 PM
Are you going to be selling these loggers?
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: YellowHammer on February 28, 2018, 11:02:31 PM
I've never heard of Thingspeak, very cool. 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on March 01, 2018, 06:14:17 PM
Quote from: vfauto on February 28, 2018, 07:32:09 PMAre you going to be selling these loggers?


Not likely.  This is really just a science project.  I doubt there's a market.  
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: vfauto on March 02, 2018, 09:43:47 AM
Quote from: btulloh on March 01, 2018, 06:14:17 PM
Quote from: vfauto on February 28, 2018, 07:32:09 PMAre you going to be selling these loggers?


Not likely.  This is really just a science project.  I doubt there's a market.  
I would be interested in one, what is the investment?
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on March 02, 2018, 11:21:28 AM
I don't have a big investment in parts - the big investment is time.  

It's one thing to make something like this for one's own personal use, but it's another thing entirely to make something that other people can use and be satisfied with.  At this point the logger is appropriate for someone who has a background in tech and is willing to nudge it here and there when necessary.  To take it beyond that requires a great deal more work in making the software bullet-proof, providing real robust sensors and appropriate sensor housings, documentation, and most of all SUPPORT.

I could make my software and a parts list available, but it's still a science project and it would only be appropriate for a few people that have a background in this stuff.  I may fab up a few pc boards just to clean up my own wiring and could make these available, which would make the implementation a lot easier and more robust.  In any case, it's a long way from a turn-key system, and the work required to get to that point is significant.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: ChugiakTinkerer on March 10, 2018, 11:49:31 AM
Looking awesome!  I really like how the enclosure box really ties it all together.  Looks pretty to me!

I've been distracted on my project, I need to get an enclosure and a proper shield for the sensor so I can start monitoring weather.  But it's work time at the property so my weather station project is going to have to wait.

I like the Thingspeak page you have set up.  It's all there and easy to see what is going on.

Well done, now time to put it to the real test!
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on March 11, 2018, 10:11:04 AM
Good to hear from you CT.  I figured you must've got sidetracked.  Life has a way of interrupting these fun projects.  I was lucky I got the bulk of the work done back in early January when I had a couple weeks of bad weather and a lull in the regular activities.  Since then it's been hard to find any time for this, or sawing, or putting a load in the kiln, or anything else really.  March is the start of yard and field work, plus I've been spending some time on firewood, and now today I have to deposit an hour of precious daylight into the Bank of Daylight Savings.  (I'm looking forward to the time when I can start withdrawing all that daylight I've saved over the years.  I hope it's earned some interest.)

I still haven't had time to get a load of lumber together to put in the kiln.  Just too many other things going on, plus we've only had seven days out of the last forty that were good for solar energy.  Clouds, rain, partly cloudy.  Rain and snow tonight and tomorrow.  It has been interesting to monitor the energy collected, but that's really not the primary mission.

It'll be interesting to see you what you come up with for a proper weather shield.  You've probably looked around at the various ways of doing it.  I skipped over that for now - just getting the ambient temp and rH from WeatherUnderground.  They have a lot of personal weather stations reporting to them, so my local data is coming from someone about a mile from me.  Works for now until I get the shield fabricated and properly located.

Keep us posted on your progress.  By the way, we could all stand some more pictures of your remote property.  Things are a little different up in your neck of the woods than down here in the L48.  At least from what I can see on the Discovery Channel.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on March 11, 2018, 10:15:10 AM
interesting article about DST in Smithsonian Magazine:

One Hundred Years Later, the Madness of Daylight Saving Time Endures | History | Smithsonian (https://www.smithsonianmag.com/history/100-years-later-madness-daylight-saving-time-endures-180968435/)

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 15, 2018, 10:14:34 AM
I'm attaching the file (.ods - from Libre Office Calc) with the data from the recent run of SYP (which was detailed in another thread).  If anyone needs this in xlsm format let me know.

Load - 350 bf of SYP, fresh sawn from older logs - starting mc was 42% by dry sample method

- Fans only for first couple days.

The humidity sensors I'm using (DHT22) seem to get inaccurate as the run progresses.  The readings just don't make sense.  This is not a huge surprise, but I was hoping these sensors might be ok.  Not so much.  I have temp sensors already installed that can be used for wb readings, but I've never put wicks on them.  Time to do that and check rh readings against a calibrated device.

I'm curious to see what anyone may have to say about this data, even with the suspicious rh readings.  The data in the spreadsheet should be self-explanatory, except for the stuff that isn't.  There are some comments on some of the column headers which may clear up any questions.

edit:( Attaching .xlsx version also)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 16, 2018, 08:48:37 PM
Very difficult to find the proper wick material or appropriate shoe laces for a wet-bulb. Hardest thing I ever attempted by a long shot. :( :( :( :( :( :(



I see four people have downloaded the data file.  Hopefully they'll have something to say/report/ask/tell/complain.  I'd be curious to know what someone else sees in the data. smiley_beatnik smiley_dark_bulb
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: PA_Walnut on July 16, 2018, 09:26:06 PM
Quote from: btulloh on July 16, 2018, 08:48:37 PMVery difficult to find the proper wick material or appropriate shoe laces for a wet-bulb. Hardest thing I ever attempted by a long shot.


Nyle's store has them in 25' rolls. I downloaded your XLS to check it out. The amount of data is great!! I questioned the max temp and time for proper sterilization.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 16, 2018, 11:03:47 PM
Thanks for the info .Ordering tomorrow.  Problem solved.

Called 3 big lab supply companies here and got nowhere.  Didn't turn up much on the interweb.  

As for sterilization temps and times, with the solar kiln i get what i get and that's it.  May not be perfect, but it beats doing nothing.  Same with setting the pitch.  Definitely not hot enough for long enough,but it does help somewhat.

Thanks for the feedback.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 16, 2018, 11:52:03 PM
This is the real-time data display which is updated every 10 seconds.  Not sexy, but useful.  

The WB's are waiting for their real wicks.


(https://forestryforum.com/gallery/albums/userpics/39962/2018-07-16-234222_671x430_scrot.jpg?easyrotate_cache=1531799484)
  
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: PA_Walnut on July 17, 2018, 06:48:00 AM
Quote from: btulloh on July 16, 2018, 11:03:47 PMAs for sterilization temps and times, with the solar kiln i get what i get and that's it.  May not be perfect, but it beats doing nothing.  Same with setting the pitch.  Definitely not hot enough for long enough,but it does help somewhat.


Agreed. Not being a critic, just what I noticed. There's certainly vast differences between personal use and retail, also sterilizing for posterity sake or legit matters like quarantined wood, etc. :)

I love your data-acq system. I need to build one. (Rasp Pi and some assoc parts are sitting in my Amazon cart, awaiting my decision to push CHECKOUT).

I have a little Lenovo i3 that I bought for a specific project that is over, so wondering if that may be prudent, in lieu of the Rasp. Pi.

Although I want/need something asap, not sure if I should add another to-do to The List that keeps going the wrong direction. :-\
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 17, 2018, 09:00:15 AM
"Agreed. Not being a critic, just what I noticed. There's certainly vast differences between personal use and retail, also sterilizing for posterity sake or legit matters like quarantined wood, etc."

True enough.  I didn't take it as criticism.  It's a lower bar when doing this just for myself.  It does make me appreciate what it takes to do it right for commercial purposes.

Lists are long and only get longer.  I managed to get this done back in January during a stretch of really bad weather.  Now I can just do a little work now and then and it doesn't impact the list too badly.

The Lenovo tablet could work, but it may more difficult to implement the i/o needed and may be challenging in general.  Anything is possible though.  The Pi has been worth the price of admission just for curiousity's sake if nothing else.  It's a pretty amazing little beast and fits the task pretty well.  I'd pull the trigger on that purchase and have it on hand when some free time pops up.  If and when you get into it, you're welcome to my code.  I went a little overboard with this project, but it doesn't have to be a complicated thing just to get a few readings.  It certainly isn't necessary to do all this to operate the solar kiln, but it is nice to keep an eye on things in there.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: PA_Walnut on July 17, 2018, 09:09:19 AM
Quote from: btulloh on July 17, 2018, 09:00:15 AMI'd pull the trigger on that purchase and have it on hand when some free time pops up.  If and when you get into it, you're welcome to my code.  I went a little overboard with this project, but it doesn't have to be a complicated thing just to get a few readings.  It certainly isn't necessary to do all this to operate the solar kiln, but it is nice to keep an eye on things in there.


If it's worth doing, it's worth over-doing! ;)

Information is your friend during drying. It would be nice to input some tables on the ideal and/or max moisture loss per species and make some if/then programming to make alarms and notifications

 It would be great to get a notice via SMS that the kiln load is in jeopardy do to losing x amount more moisture per period than expect. Or, the temperature has raised above the anticipated margin so turning-on fan x at z speed until remedied.  ;D
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 17, 2018, 09:30:49 AM
It's pretty easy to do all that once you have the basic measurements.  Tracking MC would be nice, but more challenging.  I'm working on that mc reading thing, but it's possible to do it using and existing moisture meter with an interface.  

The data can be uploaded automatically to an IoT server and most of those can implement alarms and send notices any way you want.  I have a little test going with data going up to a server.  It's not displayed very well right now, but it's a glimpse of the possibilities.  

KilnDataTest2 - ThingSpeak IoT (https://thingspeak.com/channels/398226)



Home page: IoT Analytics - ThingSpeak Internet of Things (https://thingspeak.com/)  (This IoT server doesn't really suit my purpose, but it's a free service.  There are lots of choices out there.)

One big advantage to the Pi is that the environment is designed to let you in and do stuff.  The Lenovo is designed to keep you out.  One of the interesting surprises when I first got the Pi was that the NOOBS distribution of the operating system was pretty much ready to start doing development right out the gate.  IDE, various compilers and interpreters, etc.  installed and ready to go.  Plug in a display and a keyboard and it's a computer.  Ethernet and wifi built in.  Once I got it up and running I converted to headless operation and use a remote desktop.  My kiln is within wifi distance of the house, so the system is on the network.  It's easy to do maintenance or further work while it's in operation in the kiln.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on July 17, 2018, 09:43:03 AM
Quote from: btulloh on July 16, 2018, 08:48:37 PM
Very difficult to find the proper wick material or appropriate shoe laces for a wet-bulb. Hardest thing I ever attempted by a long shot. :( :( :( :( :( :(



I see four people have downloaded the data file.  Hopefully they'll have something to say/report/ask/tell/complain.  I'd be curious to know what someone else sees in the data. smiley_beatnik smiley_dark_bulb
I was one of them and have not had time to compile it yet.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 17, 2018, 09:51:24 AM
Quote from: Crusarius on July 17, 2018, 09:43:03 AMI was one of them and have not had time to compile it yet.


Hey I'm not finding fault.  Just trying to stir the pot a little!  With that new youngin' to keep you busy you've got your hands full I bet!

PAW - Just ordered my wick from Nyle.  Many thanks for that info.  I can work on the math while I'm waiting for it to get here.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on July 17, 2018, 09:54:23 AM
I am still watching this very closely cause I would like to do the same thing. I just scored another real nice walnut tree so I need to start doing something soon. right now my biggest dilemma is storing the lumber. I need to just build a storage area for lumber. 

BTulloh, you ever think of just using resistance for moisture content? I don't know if there are any charts out there showing resistance vs moisture but it would not be hard to generate one. that could also be made a formula in an excel spreadsheet to take a resistance value and automatically calculate MC.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 17, 2018, 10:11:46 AM
The biggest challenge I faced when I started sawing lumber was storage.  Three years later it's still my biggest challenge.  I have quite a few outbuildings and NONE of them are what I need for storing lumber.  I feel your pain.  The good news is it's not too hard to make some level stacks somewhere outside and cover the stacks with a piece of tin.  Air-drying is a good first step to kiln-drying, and as long as you've got a good covered stack in a decent place your lumber will be happy until you get your kiln done.

As to MC measurements by resistance, that's one of the main ways the meters work (there's also capacitance and rf).  The data are readily available for R/mc/species, so there's that.  The challenge to implementation is the extremely high resistance values involved and making that measurement in a harsh environment with changing temps and humidity levels.  That's why good meters cost what they cost.  They are a bargain really.  I'm working along in the background on doing my own, but if I was really serious I'd buy a commercial unit with an interface. 

That being said, you can use the Yellowhammer method of stick-and-rudder, seat-of-the-pants flying and get your lumber dried just fine in the solar kiln with just a moisture meter.  No real need for IFR operation - VFR will get the job done.  But what's the fun in that?  :)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on July 17, 2018, 10:20:32 AM
I live on a 10 acre parcel that is all trees. very moist and on a hill. I really need to take some trees down and make a nice flat area for stacking but I also need to make it drier.

The worst part is how wet the parcel is. I do have some nice spalted maple because of it though.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 17, 2018, 10:24:22 AM
Quote from: Crusarius on July 17, 2018, 10:20:32 AMI do have some nice spalted maple because of it though


Every problem is just an opportunity in disguise.:D
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on July 17, 2018, 12:08:05 PM
So true. Now I need a metal detector. the spalted maple was a yard tree and already took out 2 blades.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 17, 2018, 02:49:51 PM
Maybe I should have said every problem is just and opportunity .  . .  to spend money.

The Woodwizard metal detector works ok and is not too expensive.  There have been some good discussions on here about detectors.


Edit:  LumberWizard   NOT Woodwizard.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 17, 2018, 03:13:59 PM
Well the wick is on the way from Nyle.  In the meantime I found a library of psychrometric functions already written in several languages including c++ on github.  Got it incorporated and checked out and all is fine.  Sure saved me a lot of work.  I had already written several functions for temp, rh, and dew point conversion which were working fine, but now I have ALL the needed functions.  Sort of makes up for all the wasted time chasing shoe laces and wicks.

PAW - thanks again for steering me to Nyle.  Wicks are on the way.

BTW - in my quest yesterday for wicks and shoe laces, I bought some 1/2" colman lantern wicks, which fit the sensor perfectly.  I was skeptical about them working correctly, (which was validated by Dr. Gene's post on WB's), but I installed one anyway, because - well - why not.  It didn't take up water very fast compared to other materials and appeared to be a complete bust yesterday evening.  This morning it seemed to get saturated pretty well and today I'm getting a WB reading that is 11-12 degr. below the dry bulb right next to it.  I have no reason to believe that to be accurate, but it's interesting that is sort of working.  Not that "sort of working" is very useful, but it gives me something to run through my new functions and test the math.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: GeneWengert-WoodDoc on July 17, 2018, 10:43:34 PM
In the fall meeting of the Southeast Dry Kiln Club in NC or VA, I believe there will be a presentation on measuring the MC in a kiln during drying using pins.  

This subject will also be in an article in Sawmill & Woodlot magazine, as soon as I write it.  It will be discussing the Delmhorst two-pin-depth system and results with white oak being dried green.  We got it working pretty good, indeed.  But it is tricky.

For resistance vs MC for many species, see Table 1 in
https://www.fpl.fs.fed.us/documnts/fplgtr/fplgtr06.pdf
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: boardmaker on July 18, 2018, 10:56:59 AM
Somehow I overlooked this thread.

The only thing I have ever done  with a Raspberry Pi is run an emulator so my son can play video games...

In my professional life, I am in charge of all the automation in a large sawmill.  I have redone our dry kiln controls.  All PLC based.  I always thought of adding or playing with some load cells.  I've never actually seen another company use them successfully.  I have noticed that some dry kiln manufacturers do offer them. So with all the advancements in automation over the last 20 years, I'm sure we can figure this out.

Anyone have a recommendation for a load cell to buy?  I'd be willing to purchase and guinea pig it.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 18, 2018, 05:18:20 PM
Quote from: boardmaker on July 18, 2018, 10:56:59 AMI've never actually seen another company use them successfully.


That seemed to be the conclusion when this came up earlier in this thread.  It doesn't preclude future success though.  I would think it comes down to cost/benefit more so than technology.  At some point that could change.  Maybe that's now.  I don't have any direct experience with load cells, but I'd be willing to bet someone on here does.  I would be interested in following your progress. 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: GeneWengert-WoodDoc on July 19, 2018, 02:18:51 AM
When drying hardwoods, we want the MC of the wettest pieces and not the average for a load.  So, we need to weigh individual samples.  I have yet to see a small load cell that can tolerate kiln conditions and not drift or lose calibration.  I built a load cell kiln back in 1986.  I saw one load cell kiln that had the cells on the outside with a wire running into the kiln and a sample was hung from the wire.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: boardmaker on July 19, 2018, 09:20:35 AM
Gene,

I've heard similar feedback.  I don't really like the idea of hanging by wire because that would mean your sample would be hanging in the back of the kiln.  I want mine in the pile.

I know SII offers individual sample load cell weighing, at least their website still shows them offered.  I haven't heard any feedback from anyone yet though.  I'm considering just calling them and seeing what they have to say.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on July 19, 2018, 09:49:49 AM
A series of 4 load cells in the floor with rubber seal on top to isolate them from the interior of the kiln would be ideal. 

Be very simple to write a formula in excel to start with baseline readings and then calculate MC based on weight loss. All you would need is weight of water and starting weight of stack. it will not give you MC for each board but will give you an average that will probably be close enough to determine if you can remove the stack or not.

Final check would still be done using moisture meter or some other measuring method. But the weight would at least make it so you did not have to go into the kiln all the time.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on July 19, 2018, 11:40:15 AM
Boardmaker, I think it would get more feedback if you started a new thread on this subject.  I don't mind getting off on a tangent here in this thread, but it would probably draw more attention from some of the people on the FF who have experience in this area if it was referenced in the heading.  Not trying to run you away, just thinking it might get some more input as a separate thread. 

Glad you're joining the discussion.  Sounds like you've got a of direct experience.  I'm just a hobbyist unconstrained by excess knowledge.  My career was far, far away from sawing and processing lumber.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: No_Dude on August 06, 2018, 11:31:35 PM
While I don't have any Pi experience, or Kiln experience for that matter, I did deal with some robotics code that was based off C++ I think it was ??? Anyway, I'm starting as an engineering student, so I'll be with some smart cats, hopefully I'll be able to hop in with yall on this. I imagine we could probably get a solar kiln set up on campus. For the sake of bringing everyone up to speed and centralizing what stage you are at, I think it would be a good idea to set up a road map on where we are and where to go. 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 09, 2022, 01:01:24 AM
@btulloh (https://forestryforum.com/board/index.php?action=profile;u=29962) whatever happened to this, are you elegantly driving your kiln from your cellphone while sitting in your arm chair?

I'm developing the same thing now, seems I've pretty well arrived at where this thread seems to have ended. I was going to use the node-red platform to make a web based dashboard to monitor and interface with.

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 09, 2022, 09:16:31 AM
Quote from: JoshNZ on January 09, 2022, 01:01:24 AM
@btulloh (https://forestryforum.com/board/index.php?action=profile;u=29962) whatever happened to this, are you elegantly driving your kiln from your cellphone while sitting in your arm chair?

I'm developing the same thing now, seems I've pretty well arrived at where this thread seems to have ended. I was going to use the node-red platform to make a web based dashboard to monitor and interface with.
Haha. My next project will give me the ability to stack lumber while sitting in my arm chair.  :D  A bit more complicated but highly desirable.

I did this project more out of curiosity about what was occurring in the solar kiln than any need for control. The solar kiln doesn't need much control beyond adjusting the vents as the load loses moisture and turning the fans on and off as needed.  Once you get sort of used to the solar kiln dynamics it's not complicated to run. That's why Yellowhammer calls them an easy-bake oven. It is possible to over dry if you don't pay attention as you approach the desired mc though.

I learned a lot about the kiln dynamics from the data I collected, but none of that is required for achieving good results. It also filled up some free time in the dead of winter when it was more pleasant in the house than outside.

Node Red should be the perfect platform for monitoring your sensors and building a web based graphical display. Sounds like you're well on the way.  I did a limited web based display using Thingspeak as a place to push data and display real time results.  Easy way to get something up on the web but limited ability to design the best gui.  My main objective was to store the data in a csv file then retrieve and analyze it later.

What are you using for humidity sensors?  That can be tricky as the easy choices are not robust and are not well suited to the environment. There are industrial sensors that can handle the kiln environment but I didn't go there. I ended up doing a wb/db arrangement that worked pretty well as long as I serviced the wb tank and wick regularly. All in all this project was more to satisfy my intellectual curiosity than to manage the solar kiln. Really no driving required, but it did give me a good way to automate the fans or control them remotely from my arm chair.  If I had added a way to control the vents remotely it would have been pretty slick, but that was a lot more complex and the weather got better long before I got to that point.  

Maybe this winter I'll work on that remote controlled lumber stacking machine i can run from my arm chair.

I'll be interested to see how your kiln control turns out.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 09, 2022, 03:03:20 PM
I'll keep you posted with how I go. I was going to get the first load running with a rudimentary tstat and hstat and then maybe ghost it with the rpi but I think I'm just going to punch straight into it first round, all in.

Im basically after a dashboard that has switches and status indicators of 4 things, the compressor, heater, compressor/heater fans, and circulation fans. I'll probably add vents later too but maybe not at first.
Then I want to display the RH and temperature, and I want to graph them both plus the time the compressor and heater will have been on. The heater more out of interest, for spotting a leak, and the compressor to know where the timber is at. I'll write it all to a CSV file too in case I ever need to view the whole lot but hopefully the node-red graph/charts display enough to never need to look.

I have a friend quite experienced in drying mixed loads, he doesn't follow any kiln schedules but rather brings the compressor set point down a little as everything equalises, which he monitors by the compressor duty time reducing, and I guess this is a sensible approach?

If there's anything you kiln experts think you'd like to have at your finger tips, if you could have it all on a screen in front of you, let me know. Kind of hard to know what you don't know.

Sensor I'm starting out with a dht22 like you did just because it's easy and they're everywhere. I see they make a less common one dht21 which is supposedly a bit more robust. Permanently wired and inside a case, it's what's on the end of my inkbird dh controller and I was told it would suit fine for the environment. Seems the chip in it sends more bits than the rpi is expecting (when using dht22 library) which pushes the first few important bits out of the array and gives a borked reading, definitely fixable in the library but I'm not experienced with stuff like that and it would be a slow grind for me to modify.
Sensors are easy enough to swap out anyway, I've no doubt they'll fail but if the dht22 does a few cycles and is a few dollars to replace then it's a non event but if they crap out mid cycle I'll replace it with something decent.

Did you expose your rpi to the web to view from anywhere or leave it behind a router? That's another thing that's got me head scratching. I'm not experienced in internet security I know forwarding ports to the rpi without securing it first is asking for trouble.

Did you ever get anywhere with this @Crusarius (https://forestryforum.com/board/index.php?action=profile;u=35059) ?
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 09, 2022, 03:25:02 PM
Nope. Without rereading the entire thread I think the last part was to remove the skylights in my roof so they can go into a solar kiln. I finally got the steel I need to do the roof but now its raining and snowing non stop so removing the skylights is not real high on my want to do list.

I do have more time on my hands now but I think I will focus more on my CNC and trying to setup a side gig so I do not have to go work for anyone anymore.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 09, 2022, 04:51:58 PM
The dht22 is the easy choice for sure and cheap. Swapping out wouldn't be a financial burden. The problem with them if i recall correctly is degraded accuracy more than total failure. Id have to research again, but there's plenty of info published on them. See how they work for you.

I guess I documented the fact that I used the ds18b20's for temp and i find them to be very dependable and I like the way the work and ship data. No major reason why you can't use the dht22 for temp though.

Can't recall the data bits issue.  I think wrote my own uart routine rather than using the library. Maybe that's the reason.?  I'd have to go back and see what I did.  I think there's a crc test that can be used to verify data integrity.?  I'll see if I can dig up my work on the thing.

Web data - yes can be a security issue, but won't be difficult to manage that if you just push the data to an iot server.  Lot's of free ones out there for users that don't need to push a ton of data. Just look up "iot server free".  Main thing is the kiln needs to be in range of your wifi or you'll have to add something for cellular data.  Not expensive to set up that type cell account for this little bit of data.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 12, 2022, 08:06:40 PM
I think I read their natural degrade in accuracy is something like 1% per year, would be no trouble to swap them out even every 6 months. I'll probably find an industrial grade sensor anyway.

This is where I have got to with my controller. All pretty straight forward and simple to use. I've been delighted the whole way through with how reliable the board is, amazing how stuff just works the way it is supposed to every time on Linux. The relays all fire as if the switch in the browser page were connected directly to them even across devices.

The interface consists of 3 modules I suppose, the controls and status for each kiln component, the settings to run those components in auto mode, and the data logging. The circulation fans is straight forward, on or off. The auto switches on the other components took a bit of fiddling with, I eventually ended up with a state machine I guess, and needed to store the switch states in the memory and call the auto functions periodically. I found it a bit hard to grasp the event-driven functionality style of node-red and it's possibly not the most elegant solution but it hasn't missed a beat yet. It is being fed random data in the picture below while building it, but the sensor worked perfectly out of the box with the default library.


(https://forestryforum.com/gallery/albums/userpics/47173/Nodered_Display.jpg?easyrotate_cache=1642035163)
 

It is a bit bizarre to be designing a kiln controller when I don't know how to run a kiln yet, I'm sure I will figure it all out with time but if the experts here don't mind giving me a starting point that'd be hugely helpful!

1. How many percentage points should I overlap on with the compressor on/off function? i.e. if the setpoint is 80%RH, I don't want the compressor switching on and off each time it gets to 79.9 or 80.1, right now I have it set to start when RH is 4% above the setpoint, and stop when it reaches the setpoint.

2. Should this overlap mentioned above, lets call it setpoint start threshold, be adjustable? Is there ever a reason I would want to change the amount of overlap in the interface or can I just code it to a value permanently?

3. How often would you call the function to resolve the auto settings? I'm thinking every 15 minutes but really have no idea how long it takes before any kind of change might be observed after the heater or compressor starts or stops.

4. Is the vent ever going to be used, practically speaking? If our days max out at 90F in summer and the chamber is in the shade, will I be venting to keep the temp under control?

And have I forgotten anything...?
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 13, 2022, 03:07:04 AM
Just found this thread tonight, and excited to read through it in the weeks ahead.  I skipped to the last two pages, and skimmed where you primary contributors are at presently.  Great stuff overall.  Basic background on me and my situation:

Stoked with what you have all done since this thread started several years ago.   Hoping to contribute in 2022 some how, some way.

Kelly
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 13, 2022, 03:18:01 AM
Quote4. Is the vent ever going to be used, practically speaking? If our days max out at 90F in summer and the chamber is in the shade, will I be venting to keep the temp under control?
This reminds me (with a smile) of the first week after we built our first solar kiln last June.  Painted all black inside and out, south facing in direct sun, 2x4 walls, 2x8 floors, all caulked and insulated with glass bats, and dual-pane polycarbonate roof panels.  With no ballast (i.e., wood load) in the kiln, it hit 160*F very quickly.  Realized that a runaway summer bake could destroy a load, so we installed temp-triggered exhaust fans on each end (900+ CFM, $90 on Amazon) which gave peace of mind.  
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 13, 2022, 05:15:33 AM
Sounds like we'll all be using your setup in the not too distant future - you're welcome to use my software while you develop it lol...

What did you think of those louvre vents? Do they last/operate smoothly/seal properly/stay closed in storms etc?
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 13, 2022, 01:14:19 PM
Quote from: JoshNZ on January 13, 2022, 05:15:33 AM
Sounds like we'll all be using your setup in the not too distant future - you're welcome to use my software while you develop it lol...

What did you think of those louvre vents? Do they last/operate smoothly/seal properly/stay closed in storms etc?
I am a huge fan of OSS (open source software) and happy to share with anyone with similar interests, especially those who contribute in any meaningful way.  I may take you up on bootstrapping from your beachhead.  ;-)

The louvered vents (https://www.amazon.com/gp/product/B08FF9Q5JH/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&th=1) have been great.  As to longevity, they've only been installed ~8 months, so no meaningful data there.  When we really want to cook, we use cardboard + duct tape to seal off the opening so outside air flow doesn't blow them open.  Orienting them to exhaust against the prevailing wind direction helps keep them closed naturally when not asked to exhaust.  The long (22') axis of my kilns point upwind, and the vents on each end blow upwind, so fresh outside air is drawn in on the downwind end by the "east vent", and hot humid air expelled in the upwind direction by the "west vent".  The fans are plenty strong alone (900+ CFM each), much less together, to effect a complete climate change inside in ~30 seconds.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 13, 2022, 03:11:43 PM
Only $90 to buy and $110 to ship to NZ :(.

I'll find something similar over here. I'm back and forth about whether to rely on gravity or actuate something that seals better with an actuator or solenoid, I don't know.

How did you go through the wall with all the wiring?
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 13, 2022, 03:19:30 PM
Not sure what you're asking with your last question.  My crass answer is "with a drill".  smiley_roller
Please clarify so I'm not tempted to be crass.   We have romex on the outsides of the tall/north wall and east and west end walls feeding into 110v outlets that are flush on the inside of the kiln.  Walls are 2x4 framing, so typical wall section, sheathed with 1/2 CDX plywood both sides.  Exhaust fan boxes are external to the kiln volume, with fan face and louvers in same plane as inside wall of kiln.  I'll get some photos up soon.

PS:  bummer about cost of shipping.  Where in NZ are you?  Spent a month there in the 80s, and could live many places there in a heartbeat.  Oh wait, you no longer allow foreigners.  :-[
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 13, 2022, 03:43:22 PM
Haha I suspected a drill might be the tool I'd use. I meant how are they sealed, I've gotta get 5 cables through a reefer container wall and don't want to just bore a big hole and bodge it full of silicone, wondering if there's a proper way to do it, a panel box with grometed holes for individual cables or something like it
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 13, 2022, 04:06:19 PM
Quote from: JoshNZ on January 13, 2022, 03:43:22 PM...a panel box with grommeted holes for individual cables or something like it
That's what I would do.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 14, 2022, 01:52:17 PM
Well, I would still like to contribute but I think you guys just jumped past my expertise :)

I am working on a CNC first and foremost though. Then may move onto the kiln again.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 18, 2022, 10:00:03 PM
I'm most of the way there by now, everything is wired up and functioning as it should. I still haven't added a vent, but the provision is there for one. It's one job I'm dreading and putting off for some reason.

I just need to add a baffle for the header fans then we'll be putting our first load in I think. I've got a bunch of cypress and cedar that is mostly air dried, wondering about putting it in as I assume that stuff can be dried at warp 9 both being softwoods?


(https://forestryforum.com/gallery/albums/userpics/47173/20220119_140056.jpg?easyrotate_cache=1642561133)
 
(https://forestryforum.com/gallery/albums/userpics/47173/20220119_140103.jpg?easyrotate_cache=1642561125)
 
(https://forestryforum.com/gallery/albums/userpics/47173/20220119_140138.jpg?easyrotate_cache=1642561127)
 
(https://forestryforum.com/gallery/albums/userpics/47173/20220119_140147.jpg?easyrotate_cache=1642561115)
 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 18, 2022, 11:58:01 PM
What functionality are we looking at?  Variable speed recirc fans?  Or on/off recirc fans?  Heater?  Condenser?

We've had a nice stretch of sunny weather recently, with more forecast in the days ahead.  My better kiln hit 104*F today, no electric heat, purely solar gain.  (The other kiln must have a leak somewhere, as it's lagging by a good 10-15*F on most days.)  I've concluded the box fans on each end of a 20+ foot long tightly loaded kiln aren't doing much good due to stickering and 1x redwood abutted laterally.  I ordered ten new fans, 110v, 4.7" x 4.7" x 1.5" that allegedly do 100CFM each, drawing 18 Watts.  Plan is to array five in each kiln, up high in the sunny apex of the kiln, pushing the warm air down the north backside and through each layer toward the south.  This should be substantially better recirc than I've had to date.  Having three temp+RH sensors in each kiln, and watching real time readings of each as I recirc and/or vent gives good visibility to air flow patterns.  I suppose I could put all six sensors in one kiln, study the heck out of recirc options, then replicate that in the second kiln.

I am manually "burping" each kiln every couple hours with the east and west end louvered exhaust fans, typically 5 to 10 minute exhaust cycles, triggered from my phone via WiFi switches.  Looking forward to automating all that soon.

My glazing (dual pane polycarbonate) measures 6.67 feet by 22 feet (Kiln 1) or 24' (Kiln 2).  Each kiln holding about 2,000bf of mostly 1x redwood.  So about a 13x ratio of BF to SF of glazing.  I guess that suggests my kilns are "underpowered".  Though mild climate and ideal south-facing zero-shade orientation seems provide enough energy in all but the few coldest / cloudiest / wet months of the year.

Currently recirc fans and Honeywell dehumidifers consuming about 1,000 Watts, 24x7.  I think that calc's to a few dollars a day total energy bill if grid-purchased.  This time of year a majority of my power is grid-purchased.  During summer half of the year PV provides the majority of kiln energy.  Small dollars overall given the value of KD'd heart redwood.

Dehumidifiers seem to be producing about 5 gallons of water per day each.  With a rain gauge on the DH outflow, I could get more scientific on weight/water loss.  This load I failed to put a weighed test piece in at the beginning for periodic weighing.  Next load I will remember to do that.  Tomorrow I put cheap pin moisture meter in the 1x to see what MC they're currently at.  Predicting mid teens in the warmer kiln, and high teens to low 20's in the leaking cooler kiln.

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 19, 2022, 04:53:51 AM
Heater compressor circulation fans and a vent to come. Nothing fancy in the software no PID control or anything, 15 minute samples on the sensor. The fans are on or off, 200watt each.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 19, 2022, 09:02:42 AM
I'll be curious to see if control is adequate without a PID routine.  Maybe so given the slow response time of the system, but I would think that lag, overshoot, and hysteresis would have to be factored in in some way.  In the end, PID might be the simplest way.  I would guess that there are some canned PID libraries out there that would be a good starting point.

Watching . . .
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 19, 2022, 09:11:25 AM
I am quite familiar with PID from drone flight controller systems. I seriously doubt whether that level of sophistication is necessary for kiln control given the massive inertia of the systems compared to something like a 3-axis flight controller. Also the set of environmental circumstances for the control routine to manage are extremely predictable. Sun comes up, box gets hot, sun goes down, box cools off. RH exceeds recipe? Exhaust for [X] minutes then sleep that routine for [Y] minutes/hours.

That said, refining a PID-based kiln controller would be a lot of fun.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: btulloh on January 19, 2022, 09:17:54 AM
Good discussion. Yes, vastly different loop times between the 3-axis control and a kiln. Keep in mind that your solar kiln is a different animal than Josh's DH kiln, so we've got some apples and oranges getting stirred together. Makes a tasty salad though. 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 19, 2022, 10:32:15 AM
Agree, Josh's DH kiln a different animal than my solar kilns.  @Josh, what type of heater(s)?  Electric, gas, propane?

One thing I could geek out on once automation underway is energy budget management:  which loads are worth running on what setting during non-sunny PV-free-energy times?  I have both DH appliances on continuous extract + high speed fan, and all box fans currently set on high, but I might be wasting kWh doing so.  I have oil-filled electric space heaters in each kiln, but have yet to use them as they pop the breaker unless I shut down most other loads.  (More circuits to kilns on the to do list.)  I suppose there is even an argument that periodic recirc could be nearly as effective as continuous recirc.  I.e., push the air around 5 minutes every 30 minutes, or something like that.  If the evaporation of the load is glacial, continuous recirc could be overkill.  That's where rain gauge measuring DH extraction, and/or scale measuring weight of test piece could gradually scale back kWh until results start to suffer.

I have no idea what is a reasonable total grid-bought energy cost for drying a load in the winter months.  Next load I will try to gather that data.  The first load of Doug Fir timbers and 2x that I dried last June/July was before my PV system became grid-attached, so bought energy cost there was $0.

I've seen posts elsewhere about electronic temp+RH sensors eventually going bad in the hot/humid/acidic environment of a kiln.  My ~$20 gumstick sensors from Ambient Weather are super helpful for instrumenting kiln ops.  I think the way I will monitor their health is between kiln loads, run all of the in-kiln sensors for a day or two in my Airstream office, alongside a sensor that was never subject to kiln environment.  I see differences out of the box between sensors of a degree or two, a percent or two.  I deem that variation completely acceptable.  The benchmarking between kiln sessions could identify any sensors starting to wander more than a few percent off the group average, in either temp or RH readings.

I also realized the to-be-built roller blanket for nighttime insulation could also double as a partial sun screen on very hot days.  There's a possible application for a simple PID loop.   :)  But now we're geeking out just for the sake of geeking out.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 19, 2022, 04:46:26 PM
I have got the software outputting every piece of data to a CSV, so we will get a good look at what is going on once we're underway. I never even considered PID, this ebac unit shipped with mechanical humidistat, hair element type direct switch I think. The guy I bought the hardware off said that is how he dried mixed loads, wait until that the compressor wasn't doing much work at the given set point then back the RH down until he heard the contacts click, and that was the new set point for tomorrow, reevaluate that evening. He had a data logger poked through the wall which he pulled and uploaded each night.

So I'm lightyears ahead of that, already.

I don't think the temp controller is going to need PID, it's either up to temp or it's not, start the heater or don't. I didn't bother with any threshold there as there is no harm in switching a heater on and off all day long to keep it on the money. The only thing I can think might possibly go wrong in that function is my sample rate being too low, which is an easy fix.

The compressor is much the same,
 in my mind (albeit based on zero experience). It's the environment you're controlling, not the wood mc right? The mc is the ultimate goal but it is by manipulation of the environment directly.

The heaters are electric, they look like a pair of old stove range elements, sitting up in front of the fans that pull on the DH gear.

That is one thing that has me a little worried is those fans are on a seperate circuit to the heaters. The fans need to be on for both the heaters and the compressor but I think certainly the heaters, or they're going to cook the ebac case. I don't think they'd start a fire but I don't like the idea that the fan circuit could fail and heater circuit could continue. I thought about switching those fans by seperate relays from the compressor circuit and heater circuit so that if either are on, the fans are on, but I'm just creating more failure points again by doing that. The unit does have tstat cutoffs for both compressor and heater so I guess it's best left as is.

The recirculation duty cycle is an interesting point. I bet continuous running is more than is needed but wouldnt have a clue what the ideal duty cycle would be. It'd be easy to lower my duty cycle but difficult to compare results I think.


(https://forestryforum.com/gallery/albums/userpics/47173/20220119_140359.jpg?easyrotate_cache=1642628187)
 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 19, 2022, 04:49:40 PM
I've got a good one for you wkf being a software guru, what's the safest/cheapest way to get access to the rpi board from behind a private IP/NAT 4G connection?

The kiln is on my orchard which we're building a house/shed on at the moment but I won't be living up there for another 8 months or so at best, so it'd be nice to not have to shoot up the road and connect to the router to see what's going on.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 20, 2022, 12:41:00 AM
@JoshNZ (https://forestryforum.com/board/index.php?action=profile;u=37173), not sure if this will accomplish your remote monitoring goal, but I used RealVNC® - Remote access software for desktop and mobile | RealVNC (http://www.realvnc.com) a few years ago when I was playing with remote access to Pi prototypes.  I could access and control the Pi from my phone or laptop.  VNC Viewer was the app on Android phone, as I recall.  With respect to your private IP/NAT 4G connection, I'm not deep enough in that space to know if that presents additional challenges, or the VNC platform will work fine for that connectivity or not.

Today was a good day for my solar kilns.  Peaked at 115*F (45*C).  Building solid momentum with plenty of sunny weather ahead.  Burped that kiln 3 times today, 5 to 10 minutes each burp.  Fired up the 4.7" x 4.7" x 1.5" 100cfm fan that I purchased ten of.  Debated ideal placement with my general contractor.  I think our first experiment will be scattering 5 across the high point near the north wall, blowing down the north wall, and 5 more low on the south wall, pulling air through the stack.  Should be fairly easy to see if middle of stack temp and RH are closer to the high points elsewhere in the kiln.

Kelly
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 20, 2022, 03:05:25 PM
 
(https://forestryforum.com/gallery/albums/userpics/64567/Swanton_Solar_Kiln_metrics_Jan_16-202C_2022.jpg?easyrotate_cache=1642708675)
 

Here is a snapshot of temperature in two solar kilns.  Each kiln has a temp+RH sensor on the west end, middle, and east end.  Bold red line is the hottest sensor in Kiln 1, with lighter red lines being the other two sensors in Kiln 1. Bold blue line is the hottest sensor in Kiln 2, with lighter blue lines being the other two sensors in Kiln 2.  In both kilns, the middle sensor reads the coolest, due to poor recirc by box fans on each end, with stickers blocking the end-to-end airflow.  I will graph RH separately.  A few of the brief down spikes in the red and blue lines are from manually exhausting the air in the kiln, typically 5 or 10 minutes, via the WiFi controlled louvered exhaust fans on east and west ends of each kiln.  Black line is outside air temperature.

Curious what the experts think about the nighttime / daytime temperature swing of ~35*F in each kiln.  Is that a good profile for solar kilns?  Better roof insulation overnight would narrow that band, and raise the floor of each daily cycle.  Note the increasing average temperature in each kiln as "thermal momentum" of each load builds day by day, despite same or slightly cooler outside air temps and solar radiation across the four days.  Yellow line is a temp sensor in my Airstream office adjacent.  Note its contents are mainly air, and it's not insulated [much] like the kilns are, so it doesn't build the thermal momentum day after sunny day.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on January 20, 2022, 03:43:37 PM
thats some great data. I would have never thought the daily thermal gain to continue to rise. But now that I think of it, it does make sense. as there is less moisture in the air there is less temperature loss to dehumidifying.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 20, 2022, 04:01:38 PM
 
(https://forestryforum.com/gallery/albums/userpics/64567/Swanton_Solar_Kiln_metrics_Jan_16-202C_2022_RH.jpg?easyrotate_cache=1642712147)
 

Above are the relative humidity readings from the three sensors in each kiln.  Kiln 1 is reds, Kiln 2 is blues, and black is outside RH.  Kiln 1 seems to be performing better than Kiln 2 overall, and thus the lower RH's.



(https://forestryforum.com/gallery/albums/userpics/64567/Swanton_Solar_Kiln_metrics_Jan_16-202C_2022_Avgs.jpg?easyrotate_cache=1642712147)
 

This graph averages the temp and humidity data for all three sensors in each kiln.  Makes it fairly apparent that Kiln 1 is running ~10*F warmer than Kiln 2, and it's RH is about 10 percentage points lower (toward drying goal) than Kiln 2.  I suspect a leak in Kiln 2 gasketing, my contract swears it's something else, like load differences, fan recirc, etc.  To me the data smacks of a leak.  The two kilns are right next to each other, both with same south-facing orientation, both painted black, same glass batt insulation, etc.  Loads are similar, mostly 1x Redwood, but some 2x and 6x6 in each.

[The sharp spikes down in RH are the 5-10 minute exhaust fan "burping", triggered by me.  Similarly the brief blips in temperature.  If I wasn't burping the load, the curves would be very smooth.]
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 20, 2022, 04:04:44 PM
Quote from: Crusarius on January 20, 2022, 03:43:37 PM
thats some great data. I would have never thought the daily thermal gain to continue to rise. But now that I think of it, it does make sense. as there is less moisture in the air there is less temperature loss to dehumidifying.
I saw the same daily rise in temp last summer when first baking Doug Fir.  The way I think of it is you apply very warm air all day long to the load, and you lose less of it each night than you gained during the day.  If the kilns were empty, you would see the nighttime cooling lose most/all the energy gained during the day, as your load is air.  The lumber load in each kiln provides thousands of pounds of "thermal ballast", so as you continue to bake it during a good sunny day, that energy doesn't disappear quickly overnight.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 21, 2022, 04:49:27 AM
I didn't exactly want remote desktop as that's more than I require and didn't want the slack performance that comes with that. Just a way to view a local page. I ended up going with zero tier anyway. Free and couldn't have been easier, I'm still waiting for the catch..

First load in today and launched into its maiden. Went with mostly cypress. The baffles and finishings all went really well, I ended up using old conveyor belts as seal lips, and door brushes for the hinging parts, the positive plenum is sealed up pretty tight!


(https://forestryforum.com/gallery/albums/userpics/47173/20220121_171255.jpg?easyrotate_cache=1642758028)
 
(https://forestryforum.com/gallery/albums/userpics/47173/20220121_171320.jpg?easyrotate_cache=1642758023)
 
(https://forestryforum.com/gallery/albums/userpics/47173/20220121_171328.jpg?easyrotate_cache=1642758024)
 

I got my partner to close the doors with me inside it while it was running, which was strangely unnerving lol but anyway I could feel a decent draught coming from the back of the stack all over, so hopefully I got the air flow right.

The software is functioning as it should, it came up to temp pretty quickly then switched off heater. I assume it's going to ripple for a while as the wood will still be sucking heat out of the air while the heater switches off. The RH isn't as high as I thought it would be.

I don't really know what I'm doing but I think my plan is to wait a while longer and see where that RH levels out, then put the set point a few percent below it.

I always thought these kilns were supposed to run about the ~100F mark but all of the kiln schedules I read for these woods are much higher, 160-170+ even. I'm wondering if the hardware inside is even up to that?

Any comments about how to drive this thing are welcome..


(https://forestryforum.com/gallery/albums/userpics/47173/Screenshot_20220121-223251_Chrome.jpg?easyrotate_cache=1642758317)
 
(https://forestryforum.com/gallery/albums/userpics/47173/Screenshot_20220121-223303_Chrome.jpg?easyrotate_cache=1642758315)


These are screen shots on my phone just now, from the couch at home. Bliss..!
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 21, 2022, 09:37:05 AM
Congrats on commencement of your maiden bake. And welcome to the Kiln Remote Control Club! Your control screens look great. Regarding the target temperatures, those seem much higher than anything I have read but I am also in my rookie season of drying wood, so what do I know? I have been progressing temperature from 90*F to 120*F as RH descends down in similar steps from high 90s to low 60s.. The only reason I would go above 120*F is for 24-Hour sterilization cycle. And I do believe 160*F will be substantially harder on your equipment.

Also, Emporia Wi-Fi plugs I use have the added benefit of reporting real time wattage of the various components in my system. Nice for budgeting total amperage, breaker size, approximating energy cost, Etc.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: wkf94025 on January 21, 2022, 10:37:47 AM
I just went out to "milk the cows", i.e., empty the 5gal buckets that the dehumidifiers drain in to.  One per kiln, and about 2,000bf of redwood per kiln.  Buckets were emptied ~12 hours ago, and are now full, so 10 gallons per 24 hour period is about 17 pounds of water extracted by the appliance.  If 2,000bf weighs a bit over 3lbs per bf, that would be ~6,500lbs per kiln.  That works out to about 1/4 of one percent weight loss per day from appliance water extraction.  I am about to install a second identical appliance in each kiln, also run full blast 24x7, so it will be interesting to see if I am atmosphere-constrained or appliance-constrained.  I.e., do 2x the appliances produce 2x the water extraction?  Since I didn't put test blocks in at the start of this bake, I can't really gauge total weight loss from start, to determine how much water is lost through appliance extract versus natural evaporation from lumber to atmosphere in kiln to leakage or exhaust fan expel out of kiln.

Fun with math and science.  I joke with my GC that if we entered the 4th grade science fair, saying this was all my son's idea, I think we'd take home gold.  ;D
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 21, 2022, 05:44:43 PM
Well I figured out I definitely need a vent. The compressor increases the temp about 3 degrees C over night. For this load I'll just open doors once or twice a day but I'll have something ready to install for the next round hopefully.

I took it up to 40C with the heater last night and switched compressor to auto, must've pulled ~6 litres of water in 12hrs exactly. No idea if that's good or not. I went in this morning with the doors open, the coils didn't look all wet, the first loop is frosty, the next two or three wet and the last 10+ however many are left, are dry. Not sure what to make of that, doesn't seem like optimal performance.

The dips in the curves are where I had the doors open.


(https://forestryforum.com/gallery/albums/userpics/47173/20220122_112351.jpg?easyrotate_cache=1642805070)
 
(https://forestryforum.com/gallery/albums/userpics/47173/Screenshot_20220122-114440_Chrome.jpg?easyrotate_cache=1642805063)
 
(https://forestryforum.com/gallery/albums/userpics/47173/Screenshot_20220122-114430_Chrome.jpg?easyrotate_cache=1642805061)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on January 24, 2022, 05:02:28 AM
Here's an update for anyone still interested..

The first screenshot is last night, steady enough between opening doors.

Second pic is a cleared graph, after I got it restarted today. I was drilling a hole in a junction box for a new conduit/cable, blew right through the wall and into the wires, heard the kiln go silent. Probably belongs in the did something dumb today thread, super dumb.
I went inside and ran a new circuit in the 40C heat, that'll teach me.

Pretty amazing how responsive the atmosphere is to the dehumidifier on the second graph (to me anyway, I didn't have much faith in that DH unit). It's keeping it to within about 2% rh. The only reason it oscillates as much as it does is because I don't want to cycle my compressor any quicker than that, I don't know what else you could do other than more stops and starts per hour.

About 40L of water out now


(https://forestryforum.com/gallery/albums/userpics/47173/received_494421182097222.jpeg?easyrotate_cache=1643017960)
 
(https://forestryforum.com/gallery/albums/userpics/47173/Screenshot_20220124-223442_Chrome.jpg?easyrotate_cache=1643017963)
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: PaulD on February 20, 2022, 06:07:58 PM
This raspberry pi set up sounds interesting. Can you email me details of hardware and software you are using. Did you write the software yourself? If so is it open source?
Thanks
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on February 20, 2022, 10:45:28 PM
The hardware is pretty well all visible in post#151, the CBs power the groups of components I thought made sense to group together. The power to each component is switched through that relay board, of which each relay is controlled by one of the GPIO pins of the pi. Any old relay board or set of relays would work as long as they can be switched by the pi's logic level of 3.3v and not exceed its current capacity, each pin is bugger all, 16mA maybe. If you were going to design that circuit yourself drive the relay via an NPN transistor switched by the GPIO.

The pi is running a piece of software called node-red which is open source, I'd be happy to upload my code but it would take some getting your head around to adapt it to your application if you've not used it. Node-red hosts the web page with the widgets that are the controls and loggers, and also does the auto-functionality script. I used zero tier one to create a VPN between my phone/laptop.

I'm about 5 days into my second load, first load took 24 days and came out about 11% mark, the pi hasn't missed a beat across either loads, with the exception of one power cut where I found the kiln back on its default settings of all off. I'll add a node that e-mails me when it powers up after a power cut when I get around to it. In the next couple of years for sure xD.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Ianab on February 21, 2022, 02:22:38 AM
For the non-computer folks, the Raspberry Pi is a fascinating project. It began a few years back when some folks in the UK thought "Wouldn't it be cool if there was a really cheap computer that kids could buy and experiment with". So cheap it wouldn't really matter if they blew it up. I think they originally aimed at 10 UK pounds, or some chump change like that.  It would run Linux on an ARM cpu. It had networking, USB, video out etc, and would run from a micro SD card. No point making a 10 pound computer if it needed a 50 pound hard disk to boot. But they had worked out down to the last cent how much each component added to the board would cost. They hoped they could sell 10,000 of them. As of last year they had sold 40 million of the various models. 

They now have a range from about $4 to $70. The $4 Pico is a tiny board for robotics / remote measurement / gadgets and is pretty limited. Probably plenty enough to run a kiln actually.  The $70 Pi 400 is basically a "desktop" computer with a 4 core CPU, 4gb of RAM, built into a keyboard. Connect a mouse and monitor and away you go. Can even run Win10 now. 

It's been crazily more successful than envisioned and is being used for all sorts of commercial applications now. Most of the software is Open Source, which is one reason you can buy a complete computer for less than a copy of Windows. 

This is my Pi, that's currently connected to the TV for streaming video. 

(https://forestryforum.com/gallery/albums/userpics/10460/20210618_102746.jpg?easyrotate_cache=1623969237)


So that little board has a 4 core CPU, 4 gb of RAM, wired and wireless networking, 2 HDMI video ports, AND the GPIO pins along the bottom edge than can be connected to "anything". Sensors / relays etc. 

Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on February 21, 2022, 04:04:16 AM
I'm definitely insulting mine by having it exist to check on a sensor every few minutes lol those were pretty respectable specs to have in your laptop not so long ago.
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Ianab on February 21, 2022, 04:32:04 AM
When I started working with computers a single 2 mhz, 8 bit CPU was state to the art.  :D

Now the Pi pico has a 2 core. 32 bit, 133 mhz CPU, and costs $4, including RAM  and Flash. 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on July 27, 2022, 05:56:44 AM
I upgraded the little relay board to SSRs today. Noticed the third or fourth load maybe I was starting to get relays sticking particularly on the heater.

Opto22 have a series of SSR relays, on the bench they only drew 2.1mA from the pin at 3.3v which is pretty amazing.

The pi and software have been great, hasn't missed a beat yet otherwise.


(https://forestryforum.com/gallery/albums/userpics/47173/20220727_154030.jpg?easyrotate_cache=1658915616)


I cracked one of the little blue relays open to look at the contacts, they're about the size of a ballpoint pen end  ;D don't know where they got their 10A rating. Better not to use them in kiln projects.


(https://forestryforum.com/gallery/albums/userpics/47173/20220727_155546.jpg?easyrotate_cache=1658915719)
 
(https://forestryforum.com/gallery/albums/userpics/47173/20220727_155446.jpg?easyrotate_cache=1658915722)
 
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: Crusarius on July 27, 2022, 09:26:26 AM
thats 10 amps in chinese metric :)

I have been wondering the same thing about alot of that stuff. I know for a fact some of those 30 amp switches I would not trust with 10!
Title: Re: Kiln temp and humidity logger using the Raspberry Pi platform
Post by: JoshNZ on September 17, 2022, 04:53:58 PM
I've been pondering another couple of questions about my kiln and thought this would be the best thread to ask them in..

All still going great, the pi controller is a fortress. Will be another kiln or two on the way at some point.

I wondered - should I be including a defrost cycle in my software? Practically speaking is it OK to run the compressor for 24h straight, or does it want to switch off for 6 minutes every hour to thaw the coils? Right now it is running continuously and still seems to bucket water out when I've got a green load in there but I'm wondering if this is optimal.

Also, I would like to encorporate an "EMC at given settings" on the interface page so I don't have to refer back to tables. I see there are calculators online which take a temp and RH, but I thought it must surely vary from species to species? Is there a one size fits all formula?

I've been creating a list of error conditions for a watchdog timer type piece of code to check, simple things like temp gradient too steep upwards (fire or failure), or downwards (stranger opened door and stealing wood!), and a power cut check - this one has caught me out a couple of times as the pins are defaulted to low on power up.