UploadedSubmitted by: nickcinquino Project Website: N/A
PICAXE 08M2 Controlled Humidity Chamber - Nick Cinquino 1/12/13
A humidity-controlled chamber has several practical uses, such as the storage of tobacco and cigars at optimal %RH, storage of spices and other herbal materials, for the evaluation of circuit boards and soldering flux residue to insure the flux residue will not become corrosive due to humidity, and other scientific experiments.
The Picaxe series of microcontrollers are ideal for the control of a humidity chamber; it can hold the % relative humidity at any (above ambient) programmed value, and alert the user to a low or high humidity condition.
HOW IT WORKS: A large glass jar holds the cigars/tobacco/herbs/spices, etc. An analog output humidity sensor is bolted to the inside of the cap. When the humidity is found to be low by the Picaxe, an air pump is switched on. An air pump is set up in a closed circuit…dry air from the chamber is drawn into the pump; the pump pushes air into a hydrator (a small glass jar with a dip tube, to bubble air into pure, distilled water). The hydrator increases the humidity by exposing the dry air, at high surface area, to water and by forming tiny airborne droplets. The high-humidity air is then pushed into the chamber, and this cycle repeats until the preset humidity is reached. The Picaxe then turns off the pump and monitors conditions.
This kind of “humidor” is ideal for the storage of cigars and other tobacco items. Cigars apparently favor a relative humidity of 65% to 70% RH. Supposedly this matches the tropical environment where the cigars were made. (Here in Illinois, the %RH is presently at 28%, way too low for a happy cigar). 65%RH yields a cigar that’s smooth, not harsh, and with a slightly pliable, not crumbly, wrapper. An old rule of thumb is 70/70…70 degrees F at 70% RH for perfect cigar storage. Other types of humidors use chemicals to hold the humidity at approximate levels, such as propylene glycol. Personally, I prefer my propylene glycol to stay in my car radiator, not my rare cigar! This humidor uses only pure, distilled water. I’ve seen discussions in which people say tapwater is OK for tobacco humidors. I disagree; chlorine, and halogenated organics from tapwater will volatilize out and into the chamber, and as the water is evaporated, eventually lime and scale from the water minerals will precipitate into the bottom of the water jar. Distilled water has none of the above problems. I highly recommend distilled water for this type of humidor.
Exactly how much water is being “injected” into the closed circuit flow of the chamber? At 22 degrees C, and 65% relative humidity, that air contains 12.9 grams of water per kilogram of air. Air’s density is around 1.1 kg/m3, so we can figure about 12g/m3. Once your selected chamber is ready, you can calculate the exact volume in m3, and determine the amount of water circulating in the air inside! Too much fun; maybe we should have the Picaxe take care of that!
ELECTRONICS: A 12VDC, 300mA transformer powers the relay, and after voltage regulation to 5VDC, powers the programmed Picaxe chip and humidity sensor. A larger Picaxe with more I/O would be nice, but is not absolutely necessary. The analog voltage from the humidity sensor is applied to input 1. Output 4 turns on a general purpose NPN transistor to switch on a small relay. In the case of the unit built, the relay sends power to a fishtank air pump. But you can also find low voltage DC air pumps (12VDC), such as the small pumps made by Sensidyne. The output from the humidity sensor was noisy, and driving the 08M2 crazy, so I added a lowpass filer of 2 resistors and one capacitor to smooth it out. Any 5V analog humidity sensor will work, you may need to adjust the program values to hit the desired 65%. Just calibrate your chamber after construction by placing a digital humidity meter inside the chamber, and make the needed adjustments. Small digital humidity meters are available through Ebay for around $3. A diode should be included in parallel with the relay load, but I did not show it since it happens to be built into the relay.
PROGRAMMING THE 08M2: The code is very simple and straightforward, as shown:
main: ;Picaxe Controlled Humidity Chamber output 2 input 1 output 4 readadc C.1, b1 ; Read the humidity sensor voltage wait 1 debug b1 ; Display the value if b1 >= 87 then warnhigh if b1 >= 82 then good ; comparator section if b1 <= 81 then warnlow good: high 2 ; yellow full on low 4 ; relay off wait 2 ; Wait a while goto main ; Repeat warnlow: high 4 ; relay ON for b9 = 1 to 5 ; blink, rapid sets of 5 loop high 2 pause 100 low 2 pause 100 next b9 wait 1 ; Wait a while goto main ; Repeat warnhigh: low 4 ; relay off for b9 = 1 to 3 ; blink, slow sets of 3 loop high 2 pause 200 low 2 pause 200 next b9 wait 1 ; Wait a while goto main ; Repeat
When operating, the yellow LED stays steady on when the %RH is in the good range, of 65-70%. When the humidity is low, the LED flashes rapid sets of 5 blinks to let you know. If overly high (and that’s nearly impossible for Illinois in the winter), the LED does slow double-blinks. So the Picaxe communicates the chamber’s status via LED. It would be nice to use a larger Picaxe, and add digital display of %RH and temperature, but this is optional. When %RH is low, the pump and red LED switch on.
From a dry chamber starting at 30%RH, the pump will run continuously for 30 minutes to 1 hour, and then begin slowly cycling, turning on and off every 10 to 15 minutes (depends on the size of your chamber). A nice addition to the software would be hysteresis; have it switch on the pump at a lower setting, and turn off at a higher setting, to reduce cycle time further, but the humidity sensor seems to respond slow enough to add its own level of hysteresis.
CONSTRUCTION: Hot glue was used to seal all pipe feedthroughs. From the chamber, run a hose to the input of the air pump. The output of the air pump has a hose to the input of the hydrator jar…this will have the dip tube, running below the water level. The output of the hydrator is another hose running back to the chamber. This is a closed-circuit system…the air cycles around and around, passing through a hydrator containing pure distilled water.
CALIBRATION: With a meter inside the chamber, run the unit for a while, taking notes of the Picaxe debug values vs. the %RH reading from inside the chamber.
Use Excel to make a chart of %RH vs. debug reading. If it looks decently linear, choose the debug values for high, good and low humidity and change the code if needed.