Introduction: Moisture Test: Build an Arduino Controlled Low Temp Oven
A cheap oven with a programmable temperature range. This could be useful for making a controlled temperature area for tempeh, yoghurt or drying out wet electronics, shoot, I don't know your life.
Our problem: We need to know the % of moisture in each batch of manure to determine how much carbon material (sawdust, coffee hulls, etc) to add to achieve 50-60% moisture (typical ideal moisture for aerobic decomposition). We didn't have an oven that could accurately maintain temperatures between 221-230 F (and we didn't really want to put manure samples in our oven).
It costs about $8 to send a sample to the lab to determine moisture, but we wanted a cheap way to determine it ourselves so that we could see if our moisture assumptions were right.
Our solution:
For our "oven" we lined a cardboard box with tinfoil. Then we controlled an incandescent light bulb with a Solid State Relay (SSR) to turn on if the temperature is less than 105 C and make it turn off if the temperature is more than 109 C.
We followed standard protocol's for moisture tests:
Calculate the % moisture for each of the materials you plan to compost.
a) Weigh a small container.
b) Weigh 10 g of the material into the container.
c) Dry the sample for 24 hours in a 105-110 C oven (221- 230 degrees Fehrenheit)
d) Reweigh the sample, subtract the weight of the container, and determine the moisture content using the following equation:
Mn = ((Ww-Wd)/Ww) x 100(in which:(Mn = moisture content (%) of material n(WW = wet weight of the sample, and(Wd = weight of the sample after drying.
This is from Cornell's division of Science and Engineering.
Step 1: Materials Needed
container for oven: we used a cardboard box, tin foil and tape to adhere the tin foil to the box.
For heat source: and incandescent light bulb (we used a 75 watt bulb) with fixture and plug.
To control the temperature:
-one Ground Fault Interruptor (GFI or GFCI), the kind of plug you have in your bathroom. You should always use one of these while playing with AC power, because dying sucks.
-one standard electrical outlet and a junction box to house it's wires.
-14 gauge wire for AC electronics
-Wire nuts for AC wire junctions
-one solid state relay (Sharp S202S02, DigiKey part # 425-2403-5-ND).
-a microcontroller development board like a Teensy, Arduino, Freeduino, etc. We like to keep it local (and cheap) here in Portland, OR so we used the Teensy.
-microUSB to regular USB cable
-Arduino 21 software download at http://arduino.cc/en/Guide/HomePage
-power supply for your microcontroller so you don't have to keep it plugged into your computer (we used LadyAda's breadboardable power supply).
-We used a breadboard for DC electronics DO NOT BREABOARD AC POWER!
To measure the temperature:
Dallas OneWire DS18B20
These things are awesome and pretty cheap. In bulk they drop below $4 each. They are self-calibrating, low-power devices, and the DS18B20 has 1/2 degree Celsius accuracy. They are easily wired up for parasitic or independent power. The official Arduino guide to OneWire describes how they work and gives you links to libraries.
Mat created his own printed circuit board (pcb) to attach long strings of temperature sensors to microcontrollers, but you really don't need these. we just have 100 of them.
For heat source: and incandescent light bulb (we used a 75 watt bulb) with fixture and plug.
To control the temperature:
-one Ground Fault Interruptor (GFI or GFCI), the kind of plug you have in your bathroom. You should always use one of these while playing with AC power, because dying sucks.
-one standard electrical outlet and a junction box to house it's wires.
-14 gauge wire for AC electronics
-Wire nuts for AC wire junctions
-one solid state relay (Sharp S202S02, DigiKey part # 425-2403-5-ND).
-a microcontroller development board like a Teensy, Arduino, Freeduino, etc. We like to keep it local (and cheap) here in Portland, OR so we used the Teensy.
-microUSB to regular USB cable
-Arduino 21 software download at http://arduino.cc/en/Guide/HomePage
-power supply for your microcontroller so you don't have to keep it plugged into your computer (we used LadyAda's breadboardable power supply).
-We used a breadboard for DC electronics DO NOT BREABOARD AC POWER!
To measure the temperature:
Dallas OneWire DS18B20
These things are awesome and pretty cheap. In bulk they drop below $4 each. They are self-calibrating, low-power devices, and the DS18B20 has 1/2 degree Celsius accuracy. They are easily wired up for parasitic or independent power. The official Arduino guide to OneWire describes how they work and gives you links to libraries.
Mat created his own printed circuit board (pcb) to attach long strings of temperature sensors to microcontrollers, but you really don't need these. we just have 100 of them.
Step 2: Build Adjustable Breadboard Power Supply
We used the adjustable power supply from Adafruit industries. The kit is $15 and comes with great instructions.
After building the power supply, set the output voltage selection switch to 5 volts.
Plug the DC plug or AC-DC adaptor in to the DC jack.
After building the power supply, set the output voltage selection switch to 5 volts.
Plug the DC plug or AC-DC adaptor in to the DC jack.
Step 3: Connect Power Supply, Light Fixture, Relay and Teensy
In the spirit of accessibility Mat hand drew how all the components fit together.
The only thing not included on this drawing is how to connect the Arduino (labeled arduino in the drawing but we used the teensy in the photos) to the power supply so that the Arduino can run the system.
ONE! Place the Teensy and the adjustable power supply on the same breadboard. There are two sets of pins on the bottom of the power supply and those will fit perfectly on to a 2 1/2" wide breadboard so that the negative pins and positive pins go in their corresponding areas on the breadboard.
TWO Now use the drawing to run colored wire from the light fixture, temperature sensor, relay, arduino and GFI.
The labels on the temperature sensor are rather difficult to see. I wrote on one with a white gel pen and then smeared the white ink into the text imprints to read them. The COM pin on the temperature sensor stands for communication and should be connected to whatever pin you've decided to address, for ours we chose Pin 13 which you'll see in the Arduino sketch. We used solder to connect the wires to the temperature sensors and then just plugged the other ends in to the Teensy.
When you unscrew the light bulb you'll see that one of the wires connects to a darker connection and the other to a lighter piece of metal. The wire that connects to the darker mount is the live wire and should be connected to the relay. We used solder to connect the relay to the wires to the lightbulb.
For the GFI you can connect the wires by just twisting them around the screws or use solder.
Now all your wires are connected to the right things and with any luck when you plug in the DC power supply in to the GFI the red and green lights on the arduino light up. yes? great.
The only thing not included on this drawing is how to connect the Arduino (labeled arduino in the drawing but we used the teensy in the photos) to the power supply so that the Arduino can run the system.
ONE! Place the Teensy and the adjustable power supply on the same breadboard. There are two sets of pins on the bottom of the power supply and those will fit perfectly on to a 2 1/2" wide breadboard so that the negative pins and positive pins go in their corresponding areas on the breadboard.
TWO Now use the drawing to run colored wire from the light fixture, temperature sensor, relay, arduino and GFI.
The labels on the temperature sensor are rather difficult to see. I wrote on one with a white gel pen and then smeared the white ink into the text imprints to read them. The COM pin on the temperature sensor stands for communication and should be connected to whatever pin you've decided to address, for ours we chose Pin 13 which you'll see in the Arduino sketch. We used solder to connect the wires to the temperature sensors and then just plugged the other ends in to the Teensy.
When you unscrew the light bulb you'll see that one of the wires connects to a darker connection and the other to a lighter piece of metal. The wire that connects to the darker mount is the live wire and should be connected to the relay. We used solder to connect the relay to the wires to the lightbulb.
For the GFI you can connect the wires by just twisting them around the screws or use solder.
Now all your wires are connected to the right things and with any luck when you plug in the DC power supply in to the GFI the red and green lights on the arduino light up. yes? great.
Step 4: Build the Oven
We insulated a cardboard box using tin foil. We initially used bubble wrap and tin foil, but we decided against that after remembering that bubble wrap is low density polyethylene (LDPE) which melts around 200 F and our oven will be getting up to 230 F.
Step 5: Build Heater for Oven
Our lightbulb fixture was already part of an ugly lamp so we unscrewed the bulb and attachment points so we could pull the cord out of its black box (literally).
Once the cord was out we re-assembled the fixture through a hole in the top of our insulated cardboard box.
Remember to put everything back in the same order, don't remove anything that looks "unnecessary."
The center terminal of the light socket should have the live wire attached.
Also, the ribbed side of the wire is usually the neutral wire.
Step 6: Find a Tray for Samples
If you're going to dry out compost to determine it's moisture content (like us) then it's best to find a small tray to hold your 10 g sample.
I folded a 4" by 3" tray out of some thin aluminum scrap since my housemates weren't offering their fine china for this experiment.
Step 7: Program the Arduino to Control the Temperature
1. You will need to download Arduino 21 for whatever operating system you use.
2. If you set up your pins a bit differently, change the code accordingly in the sketch (see below)
3. Plug your microcontroller in to your computer. I used a microUSB to regular USB cable. The green light should twinkle on the board.
4. Verify the sketch and if there's no problem, upload the sketch to the microcontroller. The microcontroller now has the program and when supplied with power will run the program till you remover power.
Here's the sketch to use. Much thanks to our intern Laura Tully-Gustafson for putting this altogether.
/* make a drying oven, controlling an incandescent lightbulb with a solid state relay to turn on if the temp is less than 105 C and make it turn off if the temperature is more than 109 */
//released under the GPL v3.0 by Laura Tully-Gustafson
#include <OneWire.h>
#include <DallasTemperature.h>
// Onewire device is plugged into port 7 on the Arduino
#define ONE_WIRE_BUS 7
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
int currenttemp;
int minimum = 105; // change minimum and maximum temperature in degrees C.
int maximum = 109;
void setup(void)
{
// start serial port
Serial.begin(9600);
// Start up the library
sensors.begin();
pinMode(13, OUTPUT); //set up pin 13 for a warning LED
digitalWrite(13, HIGH);
pinMode(1, OUTPUT);
digitalWrite(1, HIGH); //set up pin 1 for a Solid State Relay
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// reques
// t to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
Serial.print("Temperature for the device 1 (index 0) is: ");
currenttemp = sensors.getTempCByIndex(0); //changing to getTempFByIndex will change the system to degrees F
Serial.println(sensors.getTempCByIndex(0));
if (currenttemp < minimum) {
digitalWrite(13, HIGH); // so that the warning LED light goes on
digitalWrite(1, HIGH); // so that the incandescent lightbulb goes on
}
if (currenttemp > maximum) {
digitalWrite(13, LOW);
digitalWrite(1, LOW);
}
}
2. If you set up your pins a bit differently, change the code accordingly in the sketch (see below)
3. Plug your microcontroller in to your computer. I used a microUSB to regular USB cable. The green light should twinkle on the board.
4. Verify the sketch and if there's no problem, upload the sketch to the microcontroller. The microcontroller now has the program and when supplied with power will run the program till you remover power.
Here's the sketch to use. Much thanks to our intern Laura Tully-Gustafson for putting this altogether.
/* make a drying oven, controlling an incandescent lightbulb with a solid state relay to turn on if the temp is less than 105 C and make it turn off if the temperature is more than 109 */
//released under the GPL v3.0 by Laura Tully-Gustafson
#include <OneWire.h>
#include <DallasTemperature.h>
// Onewire device is plugged into port 7 on the Arduino
#define ONE_WIRE_BUS 7
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
int currenttemp;
int minimum = 105; // change minimum and maximum temperature in degrees C.
int maximum = 109;
void setup(void)
{
// start serial port
Serial.begin(9600);
// Start up the library
sensors.begin();
pinMode(13, OUTPUT); //set up pin 13 for a warning LED
digitalWrite(13, HIGH);
pinMode(1, OUTPUT);
digitalWrite(1, HIGH); //set up pin 1 for a Solid State Relay
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// reques
// t to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
Serial.print("Temperature for the device 1 (index 0) is: ");
currenttemp = sensors.getTempCByIndex(0); //changing to getTempFByIndex will change the system to degrees F
Serial.println(sensors.getTempCByIndex(0));
if (currenttemp < minimum) {
digitalWrite(13, HIGH); // so that the warning LED light goes on
digitalWrite(1, HIGH); // so that the incandescent lightbulb goes on
}
if (currenttemp > maximum) {
digitalWrite(13, LOW);
digitalWrite(1, LOW);
}
}
Attachments
Step 8: Use It!
Now you can test the moisture content of samples or provide a controlled temperature environment for fermenting yoghurt, tempeh or whatever project you have in mind.
Calculate the % moisture for each of the materials you plan to compost.
a) Weigh a small container.
b) Weigh 10 g of the material into the container.
c) Dry the sample for 24 hours in a 105-110 C oven (221- 230 degrees Fehrenheit)
d) Reweigh the sample, subtract the weight of the container, and determine the moisture content using the following equation:
Mn = ((Ww-Wd)/Ww) x 100(in which:(Mn = moisture content (%) of material n(WW = wet weight of the sample, and(Wd = weight of the sample after drying.
Suppose, for example, that you weigh 10 g of pig manure (Ww) into a 5 g container and that after drying the container plus clippings weighs 7.5 g. Subtracting out the 5-g. container weight leaves 2.5 g as the dry weight (Wd) of your sample. Percent moisture would be:
Mn = ((Ww-Wd)/Ww) x 100(= ((10 - 2.5) / 10) x 100(= 75% for our pig manure.
And naturally we named our Poop Oven "Pooven."
The sample we tested in Pooven came in at 75% moisture. The sample we sent to the lab (from the same sample of manure) came in at 79% moisture.