The Terrarium (PCB351) by PedalPCB is an electronic component designed to monitor and control the environmental conditions within a terrarium. This component is ideal for creating a small, self-sustaining ecosystem, often used for decorative or educational purposes. It integrates sensors and actuators to maintain optimal conditions for plant growth, such as temperature, humidity, and light levels.
Parameter | Value |
---|---|
Operating Voltage | 5V DC |
Current Consumption | 100mA |
Power Rating | 0.5W |
Temperature Range | 0°C to 50°C |
Humidity Range | 20% to 90% RH |
Light Sensor Range | 0 to 1000 lux |
Pin No. | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (5V DC) |
2 | GND | Ground |
3 | TEMP | Temperature sensor output |
4 | HUM | Humidity sensor output |
5 | LIGHT | Light sensor output |
6 | CTRL | Control signal for actuators (e.g., fans, lights) |
// Include necessary libraries
#include <DHT.h>
#include <Wire.h>
// Define pin connections
#define TEMP_PIN A0
#define HUM_PIN A1
#define LIGHT_PIN A2
#define CTRL_PIN 7
// Initialize DHT sensor
DHT dht(TEMP_PIN, DHT11);
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Initialize sensor pins
pinMode(TEMP_PIN, INPUT);
pinMode(HUM_PIN, INPUT);
pinMode(LIGHT_PIN, INPUT);
pinMode(CTRL_PIN, OUTPUT);
// Start DHT sensor
dht.begin();
}
void loop() {
// Read temperature and humidity
float temperature = dht.readTemperature();
float humidity = dht.readHumidity();
// Read light level
int lightLevel = analogRead(LIGHT_PIN);
// Print sensor values to serial monitor
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.print(" °C, Humidity: ");
Serial.print(humidity);
Serial.print(" %, Light Level: ");
Serial.println(lightLevel);
// Control actuator based on sensor values
if (temperature > 30 || humidity < 40 || lightLevel < 200) {
digitalWrite(CTRL_PIN, HIGH); // Turn on actuator
} else {
digitalWrite(CTRL_PIN, LOW); // Turn off actuator
}
// Wait for 2 seconds before next reading
delay(2000);
}
Inaccurate Sensor Readings:
Power Supply Issues:
Actuator Not Responding:
By following this documentation, users can effectively integrate the Terrarium (PCB351) into their projects, ensuring optimal performance and reliability.