Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Incubator-Set-up

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Step 1: Identify Components

Gather and understand the components you'll need for the project. These include:

 Arduino board (e.g., Uno, Mega)


 Thermistor (for temperature sensing)
 DHT Sensor (for humidity and temperature sensing)
 Relay modules (to control high-voltage devices)
 220V Bulb (for heating)
 220V Synchronous Stepper Motor (to move eggs or air circulation)
 12V Fan (to maintain air circulation)
 32x2 LCD Display (to show temperature and humidity data)
 Resistors (as needed for thermistor and other connections)
 Power Supply (e.g., 5V for Arduino, 12V for the fan, and 220V for the bulb and motor)
 Wires and breadboard (for connections)

Step 2: Divide the Circuit into Modules

Break down the system into manageable modules for better understanding:

1. Temperature and Humidity Sensing: Thermistor and DHT sensor.


2. Heating Control: 220V bulb connected via a relay module.
3. Motor Control: Stepper motor connected via a relay module.
4. Fan Control: 12V fan powered through a transistor or relay circuit.
5. Display: LCD for data output.
6. Arduino Connections: Central controller managing all inputs and outputs.

Step 3: Begin with the Arduino Connections

1. Power: Connect the Arduino to a regulated 5V supply or via USB.


2. Thermistor:
o Connect one end of the thermistor to 5V and the other end to an analog pin (e.g., A0).
o Place a pull-down resistor (10kΩ) between the thermistor’s analog pin and GND.
3. DHT Sensor:
o Connect the VCC pin to 5V, GND to ground, and data pin to a digital pin (e.g., D2).

Step 4: Add Relays for High-Voltage Components

1. Relay for Bulb:


o Connect the signal pin of the relay module to a digital pin (e.g., D8).
o Connect the NO (Normally Open) and COM (Common) pins of the relay to the 220V circuit with
the bulb.
2. Relay for Stepper Motor:
o Use a separate relay module, connecting its signal pin to another digital pin (e.g., D9).
o Wire the motor’s 220V circuit to the NO and COM terminals.
Step 5: Connect the 12V Fan

1. Fan Power: Connect the fan to an external 12V power supply.


2. Control: Use a relay module or a transistor to switch the fan on and off, controlled by a digital pin (e.g.,
D10).

Step 6: Attach the LCD

1. Connect the LCD's SDA and SCL pins to the Arduino’s respective I2C pins (e.g., A4 for SDA and A5 for
SCL on an Uno).
2. Power the LCD with 5V and GND.

Step 7: Power Management

Ensure all components are powered correctly:

 Arduino: 5V
 Fan: 12V
 Bulb and Motor: 220V through relays.

Step 8: Test the Circuit

1. Assemble the circuit on a breadboard.


2. Program the Arduino to read sensor data and control the relays.
3. Test each module independently.

Step 9: Draw the Circuit Diagram

Using software like Fritzing, Tinkercad, or manual drawing, map the connections. Include:

1. Power connections.
2. Sensor connections.
3. Relay modules.
4. High-voltage devices.
5. LCD and Arduino connections.
SET-UP

Here is a sample Arduino program for your Automatic Arduino-Controlled Incubator. This
program includes temperature and humidity monitoring, relay control for the bulb, fan, and
stepper motor, and LCD display functionality.

Assumptions:

1. DHT Sensor: Using DHT22/11 connected to digital pin 2.


2. Thermistor: Connected to analog pin A0.
3. Relay Pins:
o Bulb Relay: Digital pin 8.
o Fan Relay: Digital pin 9.
o Motor Relay: Digital pin 10.
4. LCD: Uses I2C interface (connected to SDA and SCL).
CODE:

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

#include <DHT.h>

// Define DHT sensor type and pin

#define DHTPIN 2

#define DHTTYPE DHT22 // Change to DHT11 if using DHT11

DHT dht(DHTPIN, DHTTYPE);

// Define LCD

LiquidCrystal_I2C lcd(0x27, 16, 2); // Adjust the I2C address (0x27 or 0x3F)

// Relay pins

const int bulbRelay = 8;

const int fanRelay = 9;

const int motorRelay = 10;

// Thermistor parameters

const int thermistorPin = A0;

const int seriesResistor = 10000; // 10k Ohm resistor

const float nominalResistance = 10000;

const float nominalTemperature = 25; // in Celsius

const float bCoefficient = 3950;


// Set temperature thresholds

const float tempMin = 36.5; // Minimum temperature for the incubator

const float tempMax = 37.5; // Maximum temperature for the incubator

const float fanThreshold = 38.0; // Temperature to turn on the fan

void setup() {

// Initialize serial monitor

Serial.begin(9600);

// Initialize DHT sensor

dht.begin();

// Initialize LCD

lcd.begin();

lcd.backlight();

// Set relay pins as output

pinMode(bulbRelay, OUTPUT);

pinMode(fanRelay, OUTPUT);

pinMode(motorRelay, OUTPUT);

// Default relay state

digitalWrite(bulbRelay, LOW);

digitalWrite(fanRelay, LOW);
digitalWrite(motorRelay, LOW);

// Welcome message

lcd.setCursor(0, 0);

lcd.print("Incubator Ready");

delay(2000);

lcd.clear();

void loop() {

// Read DHT sensor data

float humidity = dht.readHumidity();

float tempDHT = dht.readTemperature();

// Read thermistor temperature

float tempThermistor = readThermistor();

// Average temperature from DHT and Thermistor

float temperature = (tempDHT + tempThermistor) / 2;

// Display data on LCD

lcd.setCursor(0, 0);

lcd.print("Temp: ");

lcd.print(temperature, 1);

lcd.print("C");
lcd.setCursor(0, 1);

lcd.print("Humidity: ");

lcd.print(humidity, 1);

lcd.print("%");

// Control bulb relay

if (temperature < tempMin) {

digitalWrite(bulbRelay, HIGH); // Turn on bulb

} else if (temperature > tempMax) {

digitalWrite(bulbRelay, LOW); // Turn off bulb

// Control fan relay

if (temperature > fanThreshold) {

digitalWrite(fanRelay, HIGH); // Turn on fan

} else {

digitalWrite(fanRelay, LOW); // Turn off fan

// Control motor relay (example: periodic egg turning)

if (millis() % 3600000 < 5000) { // Activate motor for 5 seconds every hour

digitalWrite(motorRelay, HIGH);

} else {

digitalWrite(motorRelay, LOW);

}
// Delay for stability

delay(2000);

// Function to read thermistor temperature

float readThermistor() {

int adcValue = analogRead(thermistorPin);

float resistance = (1023.0 / adcValue - 1) * seriesResistor;

float steinhart;

steinhart = resistance / nominalResistance; // R/Ro

steinhart = log(steinhart); // ln(R/Ro)

steinhart /= bCoefficient; // 1/B * ln(R/Ro)

steinhart += 1.0 / (nominalTemperature + 273.15); // + (1/To)

steinhart = 1.0 / steinhart; // Invert

steinhart -= 273.15; // Convert to Celsius

return steinhart;

}
PROJECT KEY POINTS:

Key Points:

1. Temperature Control:
o The bulb turns on when the temperature drops below the minimum threshold and
turns off when it exceeds the maximum.
2. Fan Control:
o The fan activates if the temperature exceeds the fan threshold.
3. Motor Control:
o The motor turns on periodically to simulate egg turning.
4. LCD:
o Displays real-time temperature and humidity data.

You might also like