Self-Regulating Isopod Enclosure

Audrey Reiley

Final outcome of my self-regulating isopod enclosure integrated into the bins I use to house my isopods.

Final outcome of my self-regulating isopod enclosure integrated into the bins I use to house my isopods.

Project Overview 

I've recently become a pet parent to Dairy Cow and Zebra isopods (terrestrial crustaceans) and was excited to use this project to learn more about their care by making an automated isopod enclosure for them. The enclosure's regulated aspects included  automatic regulation of the soil's moisture levels, monitoring  of temperature and humidity levels, and administering water to the soil and air through a humidifier if the enclosure's condition was not optimal. 

My Zebra isopods (they are black with white stripes) and a good amount of frass, or bug poop, which indicates that my substrate and enclosure needs a touch-up (frass looks like small, brown, square pellets).

My Zebra isopods and a good amount of frass, or bug poop, which indicates that my substrate and enclosure needs a touch-up (frass are the small, brown, square pellets in the image). 

My Dairy Cow isopods (they have black and white coloration reminiscent to cows and long butt spikes)  that were hiding underneath some cork wood with some springtails (they are very small, tan, and oval in shape. Springtails are in this enclosure because they work independently and synergistically with isopods because they control mold).  ).

My Dairy Cow isopods  that were hiding underneath some cork wood with some Springtails. The Springtails they are very small, tan, and oval in shape. They are in this enclosure because they work independently and synergistically with isopods to control mold.

Project Outcome

LCD Displaying the enclosure's temperature and humidity, and the soil moisture. Temperature read: -1.00 degrees Celsius (incorrect reading). Humidity read: 6.70%. Soil Moisture read: 0%.
This is an interior image of the enclosure's irrigation system, which moistens the soil. The irrigation system consists of small plastic tubes with holes punched in them and are connected together with hot glue. They are attached to the bottom of the enclosure, with one pipe leading to the exterior of the enclosure so it can be attached to the exterior perilistic pump.

LCD displaying the enclosure's temperature and humidity, and the soil's moisture .

Interior image of the enclosure's irrigation system to moisten the soil.

Close up of peristaltic pump housed in a wooden vessel and water source (cup of water with pipe in it).
Mounting of ultra sonic humidifier and close up of soldered wires contained in heat shrink electrical tubing.

Close up of peristaltic pump and water source.

Mounting of ultra sonic humidifier and close up of soldered wires contained in heat shrink electrical tubing. 

Audrey-Reiley-Self-Regulating-Isopod-Enclosure.MOV

This video shows the following features of my project functionally working: the ultrasonic humidifier diffusing water into the air, the peristaltic pump pumping water where the enclosure's soil should be (this is continuous because the soil moisture sensor is not in soil and therefore reads the moisture as zero), and the temperature and the humidifier sensor being read on an LCD. The LCD and the peristaltic pump are attached to a wooden box where the rest of the prototype's hardware is internally stored.

Process & Review

My process for creating my final prototype consisted of two rounds of ideation sketching and the creation of cardboard prototypes for the ultrasonic humidifier and the peristaltic pump. 

The sketches gave me a visual layout of how these components would be integrated into the isopods' enclosure:


The physical cardboard prototypes allowed me to find an optimal size for the clear acrylic "shelf" where the ultrasonic sensor's water supply source would be placed. I chose to make this shelf out of clear acrylic so as not to obstruct my view of the enclosure from a bird's eye view and to prevent molding, which I was worried about when initially considering using wood for the "shelf's" material. Additionally, the other cardboard prototype allowed me to measure the circumference of the peristaltic pump so it could be propped up above the water supply source and allow for greater flow for the irrigation system inside the tank. 


While mocking up the physical aspects of my design, I also worked on wiring up the hardware and conducting software testing. For the most part, this part went well and without little issues until I started soldering the project's wires onto a perf board. One problem, which was a simple fix after my classmate Nenna pointed out, was that my prototype was not working because I had soldered the power to my Arduino to ground and my ground to power; thankfully, this did not harm my computer or any of the other components in any way. Another issue that I was having trouble with was correctly mapping the values of the temperature sensor to the LCD (as seen in the outcomes photo above); when I first began mapping out the temperature and humidity, everything seemed to display accurately, but this may have been an issue because I might have inserted old error-riddled code into my final code.

This is the second round of ideation sketching in pencil for prototype components, placement, and containers to house additional hardware. This sketch also includes how components would be attached to or integrated into a plastic bin of the same make and model I currently use to house my isopods.

This is the second round of ideation sketching for prototype components, placement, and containers to house additional hardware.

Cardboard physical prototype(s) to house part of the ultrasonic humidifier (right) and prototype to support the peristaltic pump, LCD, and additional hardware (left).

Cardboard physical prototype(s) to house part of the ultrasonic humidifier (right) and prototype to support the peristaltic pump, LCD, and additional hardware (left).

Test the ultrasonic humidity sensor with Arduino and a small water dish. During testing, The ultrasonic sensor works and distributes water into the Physical Computing Lab.

Testing ultrasonic humidity sensor with Arduino and small water dish.

In progress image of soldering wires to perf board.

In progress image of soldering wires to perf board.

Creating pipes for watering irrigation system using plastic pipes with holes poked into them and hot glue. Pipes are halfway connected and are being held down with tape during the pipe attachment process.

Creating pipes for watering irrigation system using plastic pipes with holes poked into them and hot glue. 

Discussion

Response

Overall, the verbal feedback was fairly positive, and I was happy to see that people were interested in my project and my cute pets! It was also great to talk to the IDeATe academic coordinator, Ryan, who had his own isopods and share information about them with other students. He also told me about his interests in bugs and plants and the fantastic projects he's worked on! For feedback surrounding further ideation, Ryan raised a great question about "ethical testing" and asked if I would put my isopods in this enclosure (I will not do that and will touch upon this more in my next steps). Additionally, Garth asked if there could be "a water source for the humidifier so that there would be a constant source of water for the ultrasonic humidifier to pull from"; this is a great point that I had wondered about myself but chose not to explore during this project due to time constraints and the depth of the humidifier's water source which was a small plastic lid. 

Self Critique


I am generally satisfied with my prototype despite my issues with the LCD and humidity sensor. Still, there are issues with the way I designed this enclosure that, upon further research, proved to be problematic. 


The list of issues is as follows:


However, I thought it was fun and helpful to bring my actual enclosure to the demo so that my peers and the guest reviewers would better understand how this prototype would look in the real world. 

What I Learned

As previously mentioned in the self-critique, I learned a lot about isopod care for my specific isopods, which was a great learning-by-making experience! Additionally, I learned again about the harsh realities of proper file management, as I wasn't properly naming my files, saved new code over old code, and struggled to organize my demo code when integrating different IDE files for certain components together. 

Next Steps

For my next steps, I will not be placing my isopods in a self-regulating enclosure as I do not have the breadth of knowledge, or technical skills necessary to make me confident that my isopods would be health and safe. If I continue this project, I would like to speak with a professional who knows the nuances and intricacies of my specific isopods' care needs. Still, I am excited to place them in a new enclosure with live moss and plants to create a bioactive terrarium in the future once my isopod culture is robust enough. Regarding physical computing, I will be more vigilant about practicing good file hygiene so I do not run into the coding issues I constantly had during this project.

Technical Information

Block Diagram

Schematic

Code

/* 

 Physical Computing Project 2: Self-Regulating Isopod Enclosure | Audrey Reiley

The project aims to maintain optimal conditions within my isopod enclosure by automatically regulating soil moisture levels, monitoring temperature and humidity, and administering water if necessary through a humidifier. This code initializes sensor instances, pins for controlling the pump and humidifier, and sets up the OLED display. In the loop() function, my code continuously reads sensor data, updates sensor readings, displays the data on both the OLED display and the serial monitor, adjusts humidity if necessary, checks soil moisture, controls the pump accordingly, and then turns off the pump after a delay.

Sources:

https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

https://learn.sparkfun.com/tutorials/soil-moisture-sensor-hookup-guide/all#soil-moisture-sensing-project

https://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-an-arduino/ 

https://chat.openai.com/ (for slight trouble shooting)


Pin Mapping:

Arduino pin | Role        | Details

--------------------------------

DHT_PIN     | Input       | DHT11 sensor pin

pumpPin     | Output      | Relay control pin for pump

soilMoisturePin | Input   | Analog pin to read soil moisture

HUMIDIFIERPIN | Output    | Relay control pin for humidifier

*/


#include <DHT.h>

#include <SPI.h>

#include <Wire.h>

#include <Adafruit_GFX.h>

#include <Adafruit_SSD1306.h>


// Pin definitions

const int DHT_PIN = 2;

const int pumpPin = 3;

const int soilMoisturePin = A3;

const int HUMIDIFIERPIN = 4;


// Create DHT sensor instance

DHT myDHT(DHT_PIN, DHT11);


// Variables to store sensor readings

float tempC = 0;

float tempF = 0;

float humidity = 0;

int moisturePercentage = 0;


// Ideal humidity and moisture levels

const float IDEAL_HUMIDITY_MIN = 45.0;

const float IDEAL_HUMIDITY_MAX = 55.0;

const int IDEAL_MOISTURE_THRESHOLD = 70;


// OLED display parameters

#define SCREEN_WIDTH 128

#define SCREEN_HEIGHT 64

#define OLED_RESET -1

#define SCREEN_ADDRESS 0x3C


// Create display instance

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);


// Setup function

void setup() {

  Serial.begin(9600); // Start serial communication

  Serial.println("Hi");


  // Initialize DHT sensor

  myDHT.begin();

 

  // Set pump and humidifier pins as outputs

  pinMode(pumpPin, OUTPUT);

  pinMode(HUMIDIFIERPIN, OUTPUT);


  // Initialize OLED display

  if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {

    Serial.println(F("SSD1306 allocation failed"));

    for (;;);

  }


  // Clear and display the OLED

  display.display();

  delay(2000);

  display.clearDisplay();

  display.display();

}


// Loop function

void loop() {

  // Read soil moisture sensor

  int soilMoistureValue = analogRead(soilMoisturePin);

  moisturePercentage = map(soilMoistureValue, 0, 1023, 0, 100);


  // Update sensor readings

  updateSensorReadings();


  // Display sensor data on OLED and serial monitor

  displaySensorData();


  // Adjust humidity if necessary

  adjustHumidity();


  // Check soil moisture and control pump accordingly

  checkSoilMoisture();

 

  // Turn off pump after delay and display OLED

  turnOffPump();

  display.display();

  delay(1000);

}


// Function to update sensor readings

void updateSensorReadings() {

  tempC = myDHT.readTemperature();

  tempF = myDHT.readTemperature(true);

  humidity = myDHT.readHumidity();

}


// Function to display sensor data

void displaySensorData() {

  Serial.print("Soil Moisture: ");

  Serial.print(moisturePercentage);

  Serial.println("%");


  Serial.print("Temperature (C): ");

  Serial.print(tempC);

  Serial.print(" Temperature (F): ");

  Serial.print(tempF);

  Serial.print(" Humidity (%): ");

  Serial.println(humidity);

  delay(2000);


  // Display data on OLED

  display.clearDisplay();

  display.setTextSize(1);

  display.setTextColor(SSD1306_WHITE);

  display.setCursor(0, 0);

  display.print("Temp: ");

  display.print(tempC);

  display.println(" C");

  display.print("Humidity: ");

  display.print(humidity);

  display.println("%");

  display.print("Soil Moisture: ");

  display.print(moisturePercentage);

  display.println("%");

}


// Function to adjust humidity

void adjustHumidity() {

  if (humidity < IDEAL_HUMIDITY_MIN || humidity > IDEAL_HUMIDITY_MAX) {

    Serial.println("Adjust humidity...");

    if (humidity < IDEAL_HUMIDITY_MIN) {

      digitalWrite(HUMIDIFIERPIN, HIGH);

      Serial.println("Humidifier is ON");

    }

  }

}


// Function to check soil moisture and control pump

void checkSoilMoisture() {

  if (moisturePercentage < IDEAL_MOISTURE_THRESHOLD) {

    Serial.println("Soil moisture below threshold - Turning ON pump");

    turnOnPump();

    delay(5000);

  }

  if (moisturePercentage > IDEAL_MOISTURE_THRESHOLD) {

    turnOffPump();

    Serial.println("Pump turned OFF");

  }

}


// Function to turn on the pump

void turnOnPump() {

  digitalWrite(pumpPin, HIGH);

}


// Function to turn off the pump

void turnOffPump() {

  digitalWrite(pumpPin, LOW);

}