Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino-Controlled Quail Egg Incubator with Temperature Regulation and Stepper Motor Egg Turner

Image of Arduino-Controlled Quail Egg Incubator with Temperature Regulation and Stepper Motor Egg Turner

Circuit Documentation

Summary

This circuit is designed for an egg incubation system using an Arduino UNO as the main controller. It features a DHT22 sensor for temperature measurement, a 5V relay to control a heating element (AC Bulb), a stepper motor for egg rotation, an LCD display for user interface, and pushbuttons for manual control. The system aims to maintain a set temperature for egg incubation, display the current temperature and heater status, and periodically rotate the eggs using the stepper motor.

Component List

DHT22 Temperature and Humidity Sensor

  • Pins: +, Out, -
  • Description: Measures the ambient temperature and humidity.

5V Relay

  • Pins: Normally Open, Common terminal, Normally Closed, In, GND, VCC
  • Description: Electromechanical switch used to control the AC Bulb for heating.

LCD 16x2 (Wokwi Compatible)

  • Pins: VSS, VDD, V0, RS, RW, E, D0, D1, D2, D3, D4, D5, D6, D7, A, K
  • Description: Displays the temperature and heater status.

LCM1602 IIC

  • Pins: GND, VCC, SDA, SCL, D6, D7, A, K, VSS, VDD, V0, RS, D2, D3, D4, D5, RW, E, D0, D1, LED_A, LED_B
  • Description: I2C interface for the LCD display.

Pushbutton

  • Pins: Pin 2, Pin 1, Pin 3, Pin 4
  • Description: User input for manual control of the system.

Resistor

  • Pins: pin1, pin2
  • Description: Current limiting and pull-up/down applications.
  • Properties: Various resistance values.

AC Bulb

  • Pins: P, N
  • Description: Acts as the heating element in the incubation system.

POWER SUPPLY 12V 5AMP

  • Pins: 220V Positive Pole (AC), 220V Negative Pole (AC), GND, GND (DC), 12V-24V Output (DC)
  • Description: Provides power to the circuit.

120mm Fan 12V

  • Pins: 12V+, GND
  • Description: Provides air circulation within the incubator.

Arduino UNO

  • Pins: Various digital and analog pins, power, and ground.
  • Description: Microcontroller board that controls the system.

Stepper Motor (Bipolar)

  • Pins: D, B, C, A
  • Description: Rotates the eggs at set intervals.

A4988 Stepper Motor Driver Carrier

  • Pins: ENABLE, MS1, MS2, MS3, RESET, SLEEP, STEP, DIR, GND, VCC, 1B, 1A, 2A, 2B, VMOT
  • Description: Drives the stepper motor.

Potentiometer

  • Pins: GND, Output, VCC
  • Description: Allows user to adjust the speed of the stepper motor.

Electrolytic Capacitor

  • Pins: -, +
  • Description: Stabilizes the voltage supply to the stepper motor driver.

12V Power Supply

  • Pins: +, -
  • Description: Provides 12V power to the stepper motor driver and fan.

Wiring Details

DHT22 Temperature and Humidity Sensor

  • + to 5V supply
  • Out to Arduino UNO pin D5
  • - to GND

5V Relay

  • In to Arduino UNO pin D6
  • VCC to 5V supply
  • GND to GND
  • Common terminal to 220V Positive Pole (AC) from POWER SUPPLY 12V 5AMP
  • Normally Open to AC Bulb P pin

LCD 16x2 (Wokwi Compatible)

  • Connected via LCM1602 IIC interface

LCM1602 IIC

  • GND to GND
  • VCC to 5V supply
  • SDA to Arduino UNO pin A4
  • SCL to Arduino UNO pin A5
  • Other pins connected to corresponding pins on LCD 16x2

Pushbuttons

  • One side to Arduino UNO pins D2, D3, and D4 (for different buttons)
  • Other side to GND through 200 Ohm resistors

Resistor

  • Various resistors used for pull-up/down and current limiting

AC Bulb

  • N to 220V Negative Pole (AC) from POWER SUPPLY 12V 5AMP

POWER SUPPLY 12V 5AMP

  • Provides AC power to the relay and AC Bulb
  • Provides DC power to the 120mm Fan 12V

120mm Fan 12V

  • 12V+ to 220V Negative Pole (AC) from POWER SUPPLY 12V 5AMP
  • GND to GND

Arduino UNO

  • Various connections to sensors, actuators, and power supply

Stepper Motor (Bipolar)

  • Connected to A4988 Stepper Motor Driver Carrier

A4988 Stepper Motor Driver Carrier

  • VCC to 5V supply
  • GND to GND
  • STEP to Arduino UNO pin D9
  • DIR to Arduino UNO pin D8
  • 1A, 1B, 2A, 2B to corresponding pins on Stepper Motor (Bipolar)
  • VMOT to 12V supply
  • GND to GND of 12V supply
  • RESET connected to SLEEP

Potentiometer

  • GND to GND
  • Output to Arduino UNO pin A1
  • VCC to 5V supply

Electrolytic Capacitor

  • + to VMOT of A4988 Stepper Motor Driver Carrier
  • - to GND of 12V supply

12V Power Supply

  • Provides power to the A4988 Stepper Motor Driver Carrier and the electrolytic capacitor

Documented Code

/*
 * Projek Penetasan Telur Puyuh Menggunakan Arduino
 *
 * Deskripsi:
 * - Menggunakan DHT22 untuk membaca suhu
 * - Menggunakan LCD 16x2 untuk menampilkan suhu dan status pemanas
 * - Menggunakan relay untuk mengontrol pemanas
 * - Menggunakan stepper motor untuk memutar telur
 * - Menggunakan potentiometer untuk mengatur kecepatan stepper motor
 * - Menggunakan pushbutton untuk menambah/mengurangi suhu target dan
 *   menghidupkan/mematikan pemanas secara manual
 */

#include <Stepper.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <DHT.h>

#define STEPS 200 // Jumlah langkah stepper motor
#define DHTPIN 5  // Pin DHT22
#define DHTTYPE DHT22

// Inisialisasi Stepper Motor
Stepper stepperMotor(STEPS, 8, 9);

// Inisialisasi LCD
LiquidCrystal_I2C lcd(0x27, 16, 2);

// Inisialisasi DHT22
DHT dht(DHTPIN, DHTTYPE);

int suhuSet = 37; // Suhu target
bool pemanasOn = false;

// Pin pushbutton
const int buttonTambahPin = 2;
const int buttonKurangPin = 3;
const int buttonPemanasPin = 4;
const int relayPin = 6; // Relay untuk pemanas
const int potPin = A1; // Potentiometer pin

// Debounce variables
unsigned long lastDebounceTimeTambah = 0;
unsigned long lastDebounceTimeKurang = 0;
unsigned long lastDebounceTimePemanas = 0;
unsigned long debounceDelay = 50;

void setup() {
  Serial.begin(9600);
  pinMode(buttonTambahPin, INPUT);
  pinMode(buttonKurangPin, INPUT);
  pinMode(buttonPemanasPin, INPUT);
  pinMode(relayPin, OUTPUT);
  stepperMotor.setSpeed(10); // Initial speed
  lcd.begin(16, 2); // Initialize the LCD with 16 columns and 2 rows
  lcd.backlight();
  dht.begin();
  Serial.println("Setup complete");
}

void loop() {
  //