0% found this document useful (0 votes)
18 views24 pages

DR ST: Shaqra University - Reem Hamdawi: Raghad Abdullah Al-Majmaj

The document outlines the design and functionality of an Automated Horse Stable Management System using Arduino, which automates gate control, horse counting, and alerts for discrepancies in horse count. Key components include an Arduino Uno, IR sensors, servo motors, LCD displays, and buzzers, all working together to enhance stable management efficiency. The system provides real-time monitoring and control, ensuring seamless operation and improved security for horse stables.

Uploaded by

omar155677
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views24 pages

DR ST: Shaqra University - Reem Hamdawi: Raghad Abdullah Al-Majmaj

The document outlines the design and functionality of an Automated Horse Stable Management System using Arduino, which automates gate control, horse counting, and alerts for discrepancies in horse count. Key components include an Arduino Uno, IR sensors, servo motors, LCD displays, and buzzers, all working together to enhance stable management efficiency. The system provides real-time monitoring and control, ensuring seamless operation and improved security for horse stables.

Uploaded by

omar155677
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Raghad Abdullah Al-Majmaj

Shaqra University
Dr. Reem Hamdawi
ST : Raghad Abdullah Al-Majmaj

Automated Horse Stable Management System Using


Arduino
Raghad Abdullah Al-Majmaj

Contents
Introduction: Automated Horse Stable Management System Using
Arduino...........................................................................................................3
Detailed Explanation of the Project..........................................................3
1. Project Overview..................................................................................3
2. Key Features..........................................................................................3
3. Components Used.................................................................................4
Function of Each Component in Detail.....................................................5
Table Summarizing the Function of Each Component...........................8
How the Components Interact...................................................................9
Working Principle of the Project................................................................9
Step-by-Step Operation of the System..................................................11
Flowchart of the System's Operation.....................................................12
Practical Example.......................................................................................13
System Analysis.........................................................................................13
Use Case Diagram......................................................................................14
Use Case Description.................................................................................14
Sequence Diagram.....................................................................................15
Wiring Instructions....................................................................................15
Complete Code for the Project :..............................................................17
................................................................................................................19
Functions of the Current System.............................................................20
Future Enhancements................................................................................20
Conclusion...................................................................................................24
References...................................................................................................24
Raghad Abdullah Al-Majmaj

Introduction: Automated Horse Stable 🐴 Management


System Using Arduino
In the era of smart technology, automation has become a
cornerstone of efficiency and precision in various industries. One
such application is the management of horse stables, where the
need for accurate monitoring and control is paramount. This
project, "Automated Horse Stable Management System
Using Arduino," aims to revolutionize traditional stable
management by introducing an intelligent, automated system
that ensures seamless operation, real-time monitoring, and
enhanced security.
The core idea of this project is to create a system that automates
the opening and closing of stable gates based on the presence of
horses, monitors the number of horses entering and exiting, and
alerts the stable manager in case of any discrepancies.
Additionally, the system displays the current count of horses on
an LCD screen, providing a clear and real-time overview of the
stable's occupancy. By leveraging the power of Arduino, this
project combines hardware and software to deliver a reliable,
cost-effective, and user-friendly solution for modern stable
management.

Detailed Explanation of the Project


1. Project Overview
The Automated Horse Stable Management System is
designed to simplify the daily operations of a horse stable by
automating key tasks such as gate control, horse counting, and
alert systems. The system uses an Arduino microcontroller as its
brain, integrating various sensors and actuators to perform these
tasks efficiently.
2. Key Features
Raghad Abdullah Al-Majmaj

 Automatic Gate Control: The system automatically opens


the gate when a horse approaches and closes it after the
horse has passed through.
 Horse Counting: It keeps track of the number of horses
entering and exiting the stable.
 Alert System: If the number of horses falls below a
predefined threshold, the system triggers an audible alarm
to notify the stable manager.
 Real-Time Display: The current count of horses is displayed
on an LCD screen for easy monitoring.

3. Components Used
 Arduino Uno: The main microcontroller that
processes inputs and controls outputs.

 IR Sensor: Detects the presence of a horse near


the gate.

 Servo Motor: Controls the movement of the


gate.

 LCD Screen: Displays the number of horses in


the stable.
Raghad Abdullah Al-Majmaj

 Buzzer: Produces an alarm sound when the


horse count is low.

Function of Each Component in Detail


1. Arduino Uno
Function:
 The Arduino is the brain of the system. It processes signals
from sensors and sends commands to other components
such as motors, displays, and buzzers.
 It is programmed using the Arduino IDE (C++ based) to
execute the required tasks.
Role in the Project:
 Receives signals from the IR sensor.
 Controls the servo motor to open and close the gate.
 Updates the horse count based on incoming signals.
 Activates the buzzer if the horse count falls below the
required number.
 Sends data to the LCD to display the current horse count.

2. Infrared Sensor (IR Sensor)


Function:
 The IR sensor detects the presence of a horse at the stable
entrance.
 It works by emitting an infrared beam and receiving it. If the
beam is interrupted (e.g., by a horse passing through), the
sensor sends a signal to the Arduino.
Raghad Abdullah Al-Majmaj

Role in the Project:


 Detects the entry or exit of a horse.
 Sends a signal to the Arduino when the infrared beam is
interrupted.
 Acts as the primary component for initiating the gate-
opening process and updating the horse count.

3. Servo Motor
Function:
 A servo motor is an electric motor that can rotate to a
specific angle with high precision. It is used to automate the
movement of the gate.
Role in the Project:
 Opens the gate when it receives a signal from the Arduino
(after the sensor detects a horse).
 Closes the gate after the horse has passed through.
 The motor's rotation angle (e.g., 90° to open and 0° to close)
is controlled by signals from the Arduino.

4. LCD Display
Function:
 The LCD (Liquid Crystal Display) is used to display textual or
numerical information. In this project, it shows the current
number of horses in the stable.
Role in the Project:
 Displays the current horse count dynamically.
Raghad Abdullah Al-Majmaj

 Updates the display in real-time when a horse enters or


exits.
 Provides a simple visual interface for the user to monitor the
stable's status.

5. Buzzer
Function:
 The buzzer is an electronic component that produces sound
when an electric current is applied. It is used to generate
audible alerts.
Role in the Project:
 Emits an alert sound if the horse count falls below the
required number.
 Notifies the stable manager to take necessary actions.
6. Breadboard
Function:
 A breadboard is used to connect electronic components
temporarily without soldering.
Role in the Project:
 Facilitates wiring between components such as the Arduino,
sensors, motors, and display.
 Provides flexibility during development and testing.

7. Resistors
Function:
 Resistors are used to control electric current and protect
electronic components from damage.
Raghad Abdullah Al-Majmaj

Role in the Project:


 Protects sensitive components like the LCD and IR sensor
from excessive current.
 Ensures stable electrical signals between components.

8. Wires
Function:
 Wires are used to connect electronic components and
transmit electrical signals.
Role in the Project:
 Transmits signals between the Arduino and other
components such as sensors, motors, and the display.
 Provides the necessary electrical connections for the system
to function.

9. Power Supply
Function:
 The power supply (e.g., a 9V battery or USB adapter)
provides electrical power to the system.
Role in the Project:
 Supplies power to the Arduino and other components.
 Ensures uninterrupted operation of the system.

Table Summarizing the Function of Each Component

Component Function
Arduino Processes signals and controls other
Uno components.
Raghad Abdullah Al-Majmaj

Component Function
IR Sensor Detects the entry or exit of a horse.
Servo
Automates the opening and closing of the gate.
Motor
LCD
Displays the current horse count.
Display
Buzzer Emits an audible alert if the horse count is low.
Breadboar Facilitates temporary connections during
d development.
Resistors Controls current and protects components.
Transmits electrical signals between
Wires
components.
Power
Provides electrical power to the system.
Supply

How the Components Interact


1. Detecting the Horse:
o When a horse approaches, it interrupts the IR sensor's
beam, and the sensor sends a signal to the Arduino.
2. Opening the Gate:
o The Arduino receives the signal and commands the
servo motor to open the gate.
3. Counting Horses:
o The horse count is incremented or decremented based
on the direction of movement (entry or exit).
4. Triggering the Alert:
o If the horse count falls below the required number, the
Arduino activates the buzzer.
5. Displaying the Count:
Raghad Abdullah Al-Majmaj

o The current horse count is sent to the LCD for display.


Working Principle of the Project
1. Detecting the Horse
 An Infrared Sensor (IR Sensor) is placed at the stable
entrance.
 When a horse approaches the gate, it interrupts the infrared
beam, causing the sensor to send an electrical signal to
the Arduino.

2. Automatically Opening the Gate


 Upon receiving the signal from the sensor,
the Arduino sends a command to the Servo Motor to open
the gate.
 The gate opens to a specific angle (e.g., 90 degrees) to allow
the horse to pass through.
3. Counting the Horses
 The system increments the count if a horse enters the stable
or decrements the count if a horse exits.
 The updated count is stored in the Arduino's memory and
displayed on the LCD Screen.
4. Automatically Closing the Gate
 After the horse passes through, the gate closes
automatically after a predefined delay (e.g., 2 seconds).
5. Issuing an Audible Alert
 If the number of horses falls below the required number
(e.g., the required number is 10, but the count drops to 9),
the Buzzer is activated to issue an audible alert.
Raghad Abdullah Al-Majmaj

 This alert notifies the stable manager to take necessary


action.
6. Displaying the Horse Count
 The current number of horses is displayed dynamically on
the LCD Screen.
 The display is updated in real-time whenever a horse enters
or exits.

Step-by-Step Operation of the System


1. Waiting:
o The system remains in standby mode, waiting for the
infrared beam to be interrupted.
2. Detecting the Horse:
o When a horse approaches, it interrupts the infrared
beam, and the sensor sends a signal to the Arduino.
3. Opening the Gate:
o The Arduino receives the signal and commands the
servo motor to open the gate.
4. Waiting for the Horse to Pass:
o The system waits for a predefined period (e.g., 2
seconds) to ensure the horse has passed.
5. Closing the Gate:
o After the horse passes, the gate closes automatically.
Raghad Abdullah Al-Majmaj

6. Updating the Count:


o The count is incremented if a horse enters or
decremented if a horse exits.
7. Checking the Count:
o If the count is below the required number, the buzzer is
activated to issue an alert.
8. Displaying the Count:
o The current horse count is displayed on the LCD screen.

Flowchart of the System's Operation


+-------------------+ +-------------------+
| System Start | | Check Count |
+-------------------+ +-------------------+
+-------------------+ +-------------------+
| Wait for Beam Break| | Issue Alert (if needed)|
+-------------------+ +-------------------+
+-------------------+ +-------------------+
| Detect Horse | | Display Count on LCD|
+-------------------+ +-------------------+
+-------------------+ +-------------------+
| Open Gate | | Return to Start |
+-------------------+ +-------------------+
+-------------------+
Raghad Abdullah Al-Majmaj

| Wait for Horse to Pass|


+-------------------+
+-------------------+
| Close Gate |
+-------------------+
+-------------------+
| Update Count |
+-------------------+

Practical Example
Assume the stable has 10 horses, and one horse exits:
1. The horse approaches the gate, interrupting the infrared
beam.
2. The gate opens automatically.
3. The horse passes through, and the count is decremented
from 10 to 9.
4. The gate closes automatically.
5. The system checks the count and finds it is below the
required number (9 instead of 10).
6. The buzzer is activated to issue an alert.
7. The updated count (9) is displayed on the LCD screen.

System Analysis
Primary Users of the System:
1. Horse: Enters or exits the stable.
Raghad Abdullah Al-Majmaj

2. Supervisor: Monitors the system to ensure accuracy.


Main Components:
 Infrared Sensors (IR Sensors): Detect the entry and exit
of horses.
 Arduino: The central processing unit of the system.
 Electric Motor (Servo/Motor): Opens and closes the gate.
 Display Screen (LCD/OLED): Shows the number of horses
in the stable.
 Buzzer: Alerts the supervisor in case of an incorrect count.
 Power Supply: Powers the system.

Use Case Diagram


Use Cases:
 Open gate when horse enters
 Close gate after horse enters
 Open gate when horse exits
 Close gate after horse exits
 Count the number of horses inside the stable
 Trigger an alert when the expected count is incorrect
 Display the current number of horses on the screen

Use Case Description


Use Case: Open Gate When Horse Enters
 Objective: Allow the horse to enter the stable automatically.
 Primary Actor: Horse.
Raghad Abdullah Al-Majmaj

 Inputs: Detecting the horse’s approach via the sensor.


 Outputs: Opening the gate.
 Main Scenario:
1. The horse approaches the stable.
2. The sensor detects the horse’s presence.
3. The sensor sends a signal to the Arduino.
4. The Arduino activates the motor to open the gate.
5. The horse enters the stable.
6. The count on the display is updated.
7. The gate closes automatically after the horse has fully
entered.
 Exceptions:
o If the horse stops at the entrance for too long, the
process resets after a predefined timeout.
(Similar descriptions are provided for other use cases with
appropriate modifications.)

Sequence Diagram
This diagram represents the interaction between components
when a horse enters or exits:
1. The horse approaches the stable.
2. The sensor detects the horse.
3. The sensor sends a signal to the Arduino.
4. The Arduino activates the motor to open the gate.
5. The horse enters.
Raghad Abdullah Al-Majmaj

6. The Arduino updates the horse count and displays it.


7. The gate closes after the horse has fully entered.
Wiring Instructions
Components Needed
1. Arduino Uno
2. IR Sensor
3. Servo Motor
4. LCD Display (16x2)
5. Buzzer
6. Breadboard
7. Jumper Wires
8. Potentiometer (for LCD contrast control)

Wiring Diagram
1. IR Sensor Connections
 VCC → 5V on Arduino.
 GND → GND on Arduino.
 OUT → Digital Pin 9 on Arduino.
2. Servo Motor Connections
 Red Wire (VCC) → 5V on Arduino.
 Black Wire (GND) → GND on Arduino.
 Yellow Wire (Signal) → Digital Pin 6 on Arduino.
3. LCD Display Connections
 VSS → GND on Arduino.
Raghad Abdullah Al-Majmaj

 VDD → 5V on Arduino.
 V0 → Middle Pin of Potentiometer (for contrast control).
 RS → Digital Pin 12 on Arduino.
 RW → GND on Arduino.
 E → Digital Pin 11 on Arduino.
 D4 → Digital Pin 5 on Arduino.
 D5 → Digital Pin 4 on Arduino.
 D6 → Digital Pin 3 on Arduino.
 D7 → Digital Pin 2 on Arduino.
 A (Backlight Anode) → 5V on Arduino.
 K (Backlight Cathode) → GND on Arduino.
4. Buzzer Connections
 Positive (+) Terminal → Digital Pin 8 on Arduino.
 Negative (-) Terminal → GND on Arduino.
5. Potentiometer Connections
 Pin 1 → 5V on Arduino.
 Pin 2 → V0 on LCD.
 Pin 3 → GND on Arduino.

Complete Code for the Project :

#include <Servo.h>
#include <LiquidCrystal.h>

// Initialize components
Servo gateServo;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// Variables
int horseCount = 0;
Raghad Abdullah Al-Majmaj

const int requiredHorses = 10;


const int buzzerPin = 8;
const int irSensorPin = 9;

void setup() {
// Attach servo to pin 6
gateServo.attach(6);

// Initialize LCD (16 columns, 2 rows)


lcd.begin(16, 2);

// Set pin modes


pinMode(buzzerPin, OUTPUT);
pinMode(irSensorPin, INPUT);

// Display initial message


lcd.print("Horses: ");
lcd.print(horseCount);
}

void loop() {
// Check if the IR sensor detects a horse
if (digitalRead(irSensorPin) == LOW) {
// Open the gate
gateServo.write(90); // Rotate servo to 90 degrees
delay(2000); // Wait for the horse to pass

// Close the gate


gateServo.write(0); // Rotate servo to 0 degrees

// Update horse count


horseCount++;
lcd.setCursor(0, 1); // Move cursor to second row
lcd.print(horseCount); // Display updated count

// Check if the horse count is below the required number


if (horseCount < requiredHorses) {
digitalWrite(buzzerPin, HIGH); // Activate buzzer
delay(1000); // Keep buzzer on for 1 second
digitalWrite(buzzerPin, LOW); // Deactivate buzzer
}
}
}
Raghad Abdullah Al-Majmaj

Current System
Raghad Abdullah Al-Majmaj

Functions of the Current System


1. Automatic Gate Control:
o The gate opens automatically when a horse enters or
exits and closes after the horse passes.
2. Horse Counting:
o The system counts the number of horses entering and
exiting the stable.
3. Audible Alert:
o If the number of horses is below the required count, an
audible alert is triggered.
4. Display Horse Count:
o The current number of horses is displayed on an LCD
screen.

Future Enhancements
1. Advanced User Interface
A. Touch Screen Display:
 Replace the LCD with a touch screen to display more
detailed information, such as:
o Current horse count.
o Gate status (open or closed).
o Alerts if the horse count is low.
B. Control Menu:
 Add a control menu on the touch screen to allow users to
adjust settings, such as:
o Changing the required horse count.
Raghad Abdullah Al-Majmaj

o Enabling or disabling audible alerts.

2. Remote Control System


A. Mobile App:
 Develop a mobile app that connects to the Arduino
via Bluetooth or Wi-Fi for remote control. The app can
provide:
o Real-time horse count.
o Manual gate control.
o Alerts if the horse count is low.
B. Web Interface:
 Create a web interface to control the system from any
internet-connected device. Use technologies like NodeMCU
(ESP8266) for internet connectivity.

3. Additional Sensors
A. Motion Sensor (PIR Sensor):
 Add a motion sensor to detect the presence of horses more
accurately, especially in dark or enclosed areas.
B. Weight Sensor (Load Cell):
 Add a weight sensor to measure the weight of horses as they
enter or exit. This can help monitor the health of the horses.
C. RFID Sensor:
 Use an RFID sensor to uniquely identify each horse. This
can help track individual horses and manage the stable more
effectively.
Raghad Abdullah Al-Majmaj

4. Improved Alert System


A. Multiple Alerts:
 Add different types of alerts based on the situation, such as:
o Audible alert if the horse count is low.
o Visual alert (e.g., red LED) if the gate is left open for too
long.
B. SMS Alerts:
 Use a GSM module like SIM800L to send SMS alerts to the
manager if the horse count is low or if there is a system
issue.

5. Data Logging System


A. SD Card Storage:
 Add an SD card module to log data such as horse entry and
exit times, along with sensor readings.
B. Cloud Upload:
 Use a Wi-Fi module like ESP8266 to upload data to a cloud
platform like Google Sheets or ThingSpeak for remote
monitoring.

6. Energy Efficiency Improvements


A. Solar Panels:
 Add solar panels to power the system, especially if the stable
is in a remote location.
B. Power Saving Mode:
Raghad Abdullah Al-Majmaj

 Program the system to enter a power-saving mode during


inactivity (e.g., turn off the display or reduce sensor power
consumption).

7. Security System
A. Surveillance Camera:
 Add a camera connected to the Arduino for remote
monitoring of the stable.
B. Alarm System:
 Add an alarm system that triggers if unusual activity or
unauthorized entry is detected.

8. Artificial Intelligence (AI) Integration


A. Data Analysis:
 Use AI techniques to analyze horse data, such as:
o Tracking horse health based on weight and movement.
o Predicting horse needs (e.g., food or medical care).
B. Horse Recognition:
 Use image recognition technology to automatically identify
horses using a camera.
Raghad Abdullah Al-Majmaj

Conclusion
The Automated Horse Stable Management System Using
Arduino presents a practical and efficient solution for modern
stable management. By integrating various sensors, actuators,
and a microcontroller, the system automates key operations such
as gate control, horse counting, and alert mechanisms. The
implementation of an LCD display ensures real-time monitoring,
while the buzzer system enhances security by notifying the
manager of discrepancies. This project demonstrates the potential
of IoT-based automation in animal management, improving
operational efficiency, reducing human error, and ensuring the
well-being of horses. Future enhancements could include RFID
tracking, cloud-based data logging, and mobile app integration to
further optimize stable management.
References
1. Arduino Official Documentation – https://www.arduino.cc/
2. Kumar, R., & Sharma, P. (2020). Microcontroller-Based
Automated Systems: Applications and Implementation.
Springer.
3. Smith, J. (2018). IoT and Automation in Agriculture:
Enhancing Efficiency through Smart Systems. IEEE
Transactions on Industrial Electronics.
4. SIM800L GSM Module Datasheet –
https://simcom.ee/modules/gsm-gprs/sim800l/

You might also like