leather from mashrooms
The purpose of my project is to address the problem of animal cruelty, specifically the killing of animals for their skins. My solution involves using mushrooms to create a sustainable, plant-based leather alternative, which does not involve the use of animals. The mushroom leather is not only eco-friendly, but it is also biodegradable and can be grown at home, making it both accessible and environmentally responsible.
I care deeply about this issue because I am passionate about the environment and maintaining ecological balance. Protecting animals and reducing our reliance on animal-based products is crucial to preserving the planet's biodiversity. I was inspired by Nile University, which focuses on sustainability projects and supports ideas that contribute to environmental well-being. Their emphasis on projects like mine that focus on sustainable alternatives encouraged me to refine and develop my concept, especially because they offer funding opportunities for such initiatives.
banana fiber & banana plates
There are other projects as well, such as extracting fibers from banana trees and creating fabric from these fibers. We could develop a machine to extract and spin the fibers. Another project involves making plates from the layers of banana tree trunks as an alternative to plastic plates. In all of my projects, I encourage sustainability and work to reduce the environmental impact of waste.
THIS IS THE CODE
C++
// Define pins
const int pumpPin = 2;
const int fanPin = 3;
const int ledPin = 4;
const int humidityPin = A0;
const int temperaturePin = A1;
const int switchPin = 7; // Switch connected to digital pin 7
// Calibration values (adjust these based on your sensors)
const int humidityThreshold = 80; // Changed to 80%
const int temperatureHighThreshold = 27; // Changed to 27°C
const int temperatureLowThreshold = 24; // Changed to 24°C
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
// Set pin modes
pinMode(pumpPin, OUTPUT);
pinMode(fanPin, OUTPUT);
pinMode(ledPin, OUTPUT);
pinMode(humidityPin, INPUT);
pinMode(temperaturePin, INPUT);
pinMode(switchPin, INPUT_PULLUP); // Switch with internal pull-up resistor
}
void loop() {
// Read switch state
int switchState = digitalRead(switchPin);
// Check if the switch is HIGH (closed)
if (switchState == HIGH) { // Assuming the switch is active HIGH
// Read sensor values
int humidityValue = analogRead(humidityPin);
int temperatureValue = analogRead(temperaturePin);
// Convert analog readings to actual values (adjust these based on your sensors)
float humidity = map(humidityValue, 0, 1023, 0, 100); // Example mapping, adjust accordingly
float temperature = map(temperatureValue, 0, 1023, -50, 100); // Example mapping, adjust accordingly
// Print sensor values for debugging
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.print("% Temperature: ");
Serial.print(temperature);
Serial.println("°C");
// Control pump
if (humidity < humidityThreshold) {
digitalWrite(pumpPin, HIGH); // Turn pump ON
Serial.println("Pump ON");
} else {
digitalWrite(pumpPin, LOW); // Turn pump OFF
Serial.println("Pump OFF");
}
// Control fan
if (temperature > temperatureHighThreshold) {
digitalWrite(fanPin, HIGH); // Turn fan ON
Serial.println("Fan ON");
} else {
digitalWrite(fanPin, LOW); // Turn fan OFF
Serial.println("Fan OFF");
}
// Control LED
if (temperature < temperatureLowThreshold) {
digitalWrite(ledPin, HIGH); // Turn LED ON
Serial.println("LED ON");
} else {
digitalWrite(ledPin, LOW); // Turn LED OFF
Serial.println("LED OFF");
}
delay(1000); // Wait for 1 second before the next reading
} else {
// Switch is LOW (open), do nothing or turn everything off
digitalWrite(pumpPin, LOW);
digitalWrite(fanPin, LOW);
digitalWrite(ledPin, LOW);
Serial.println("Switch OFF - all devices OFF"); // Optional: print a message
delay(1000); // Small delay to prevent excessive checking
}
}
Project Overview:
This Arduino project is designed to automate environmental control based on humidity and temperature readings. It uses sensors to monitor these values and activates a pump, fan, and LED to maintain desired conditions, all controlled by a physical switch.
Code Breakdown:
Variable Declarations (Pin Assignments):
C++
const int pumpPin = 2;
const int fanPin = 3;
const int ledPin = 4;
const int humidityPin = A0;
const int temperaturePin = A1;
const int switchPin = 7;
const int: This keyword signifies that these integer variables are constants, meaning their values won't change during program execution.
Each line assigns a specific digital or analog pin number to a descriptive variable name. This makes the code more readable and maintainable.
For instance, pumpPin = 2 means the pump is connected to digital pin 2 of the Arduino.
A0 and A1 are analog pins.
Calibration Thresholds:
C++
const int humidityThreshold = 80;
const int temperatureHighThreshold = 27;
const int temperatureLowThreshold = 24;
These constants define the trigger points for the control logic.
humidityThreshold is the minimum percentage of humidity before the pump activates.
temperatureHighThreshold is the maximum temperature in degrees Celsius before the fan turns on.
temperatureLowThreshold is the minimum temperature in degrees Celsius before the LED turns on.
These values are adjustable to fine-tune the system's response.
setup() Function (Initialization):
C++
void setup() {
Serial.begin(9600);
pinMode(pumpPin, OUTPUT);
pinMode(fanPin, OUTPUT);
pinMode(ledPin, OUTPUT);
pinMode(humidityPin, INPUT);
pinMode(temperaturePin, INPUT);
pinMode(switchPin, INPUT_PULLUP);
}
void setup(): This function runs once when the Arduino starts or resets.
Serial.begin(9600): Initializes serial communication at 9600 baud for debugging. This allows the Arduino to send data to a computer via USB.
pinMode(..., OUTPUT): Sets the pump, fan, and LED pins as outputs. This means the Arduino will send signals to these pins to control the connected devices.
pinMode(..., INPUT): Sets the humidity and temperature sensor pins as inputs. The Arduino will read analog values from these pins.
pinMode(switchPin, INPUT_PULLUP): Sets the switch pin as an input with an internal pull-up resistor. This simplifies the wiring by eliminating the need for an external resistor. When the switch is open, the pin will read HIGH. When closed, it will read LOW.
loop() Function (Main Program Loop):
C++
void loop() {
int switchState = digitalRead(switchPin);
if (switchState == HIGH) {
// ... sensor readings and control logic ...
} else {
// ... turn off all devices ...
}
delay(1000);
}
void loop(): This function runs repeatedly after the setup() function.
int switchState = digitalRead(switchPin): Reads the state of the switch. If the switch is closed, switchState will be HIGH; otherwise, it will be LOW.
if (switchState == HIGH): This condition checks if the switch is closed. If it is, the code within the if block executes.
else: If the switch is open, the code within the else block executes, turning off all devices.
delay(1000): Pauses the program for 1 second (1000 milliseconds) before the next loop iteration. This prevents the Arduino from constantly checking the sensors and switch, reducing unnecessary processing.
Sensor Readings and Value Conversion (Inside if (switchState == HIGH)):
C++
int humidityValue = analogRead(humidityPin);
int temperatureValue = analogRead(temperaturePin);
float humidity = map(humidityValue, 0, 1023, 0, 100);
float temperature = map(temperatureValue, 0, 1023, -50, 100);
analogRead(humidityPin) and analogRead(temperaturePin): Read the analog values from the humidity and temperature sensors. These values range from 0 to 1023.
map(humidityValue, 0, 1023, 0, 100): Converts the analog humidity reading to a percentage (0-100).
map(temperatureValue, 0, 1023, -50, 100): Converts the analog temperature reading to degrees Celsius. Important: The -50 and 100 values should be adjusted based on the sensor's specifications.
Control Logic (Inside if (switchState == HIGH)):
C++
if (humidity < humidityThreshold) {
digitalWrite(pumpPin, HIGH);
Serial.println("Pump ON");
} else {
digitalWrite(pumpPin, LOW);
Serial.println("Pump OFF");
}
// Similar logic for fan and LED
These if-else statements implement the control logic.
If the humidity is below the humidityThreshold, the pump turns on (digitalWrite(pumpPin, HIGH)). Otherwise, it turns off (digitalWrite(pumpPin, LOW)).
Similar logic is used to control the fan based on temperatureHighThreshold and the LED based on temperatureLowThreshold.
Serial.println(...): Sends messages to the serial monitor indicating the status of each device.
Switch Off State (Inside else):
C++
else {
digitalWrite(pumpPin, LOW);
digitalWrite(fanPin, LOW);
digitalWrite(ledPin, LOW);
Serial.println("Switch OFF - all devices OFF");
}
If the switch is open (switchState == LOW), this code turns off all devices and prints a message to the serial monitor.
In essence:
The code continuously monitors the switch and, when it's closed, reads sensor data, converts it to meaningful units, and uses threshold values to control the pump, fan, and LED. When the switch is opened, all devices are turned off. This creates an automated environmental control system.