How to Build A Bluetooth App Based Poultry Farm

In this tutorial post, we will be discussing how to build a Bluetooth App controlled and monitored poultry farm project design. This project design is a low cost one that won’t cost more than 50 US dollars reproducing it.

This article will take you on a journey through building a Bluetooth app-based poultry farm system using Arduino Uno, an HC-05 Bluetooth module, and a tungsten bulb for temperature control. Whether you’re an experienced Arduino user or a complete beginner, this guide will walk you through the steps to create an automated system that controls your poultry farm’s environment with ease. Let us look at how it is made. But first, let us understand Poultry Farming and why we would make it smart.

The Power of Smart Poultry Farming

Bluetooth-controlled automation
Bluetooth-controlled automation courtesy of electronics hub

In the modern world of agriculture, technology has completely transformed the way we manage and control farming operations. One of the most fascinating applications is Bluetooth-controlled automation, which allows you to manage crucial functions like lighting, temperature, and feeding through a simple app on your smartphone. This shift toward smart farming not only reduces labor but also enhances productivity, especially for small-scale poultry farmers.

What Is a Bluetooth App-Based Poultry Farm?

Imagine being able to control every aspect of your poultry farm from your phone, without stepping foot into the farmyard. A Bluetooth app-based poultry farm is an automated system that enables you to monitor and manage farm operations—such as lighting, temperature, and even feeding systems—through a mobile app. The technology relies on the use of a Bluetooth module (HC-05) to communicate between the farm’s systems (run by an Arduino Uno) and your smartphone.

In this project, the Bluetooth connection allows you to control a tungsten bulb, which serves as a heat source, directly from your smartphone.

Why Use Arduino for Poultry Automation?

You may wonder why an Arduino Uno is the ideal choice for controlling your poultry farm. The Arduino Uno is a microcontroller known for its simplicity, versatility, and affordability. It offers a great platform for beginners to learn.

Read also DIY Remote-Controlled Fan Using Arduino: A Step-by-Step Guide

Why Automation in Poultry Farming?

Before diving into the technical setup, it’s crucial to understand the benefits of automation in poultry farming. Poultry farming involves constant care to ensure optimal conditions such as lighting, temperature, and feeding. Managing these factors manually can be tedious and inefficient, particularly for larger operations.

automation in poultry farming

With automation, these conditions can be easily monitored and controlled remotely. Automating lighting, for example, ensures that your chickens have the proper light cycle to promote healthy growth and egg production. A Bluetooth-controlled system gives farmers the flexibility to adjust settings without being physically present, making it both a time-saving and cost-effective solution.

Why Automate Lighting in Poultry Farms?

Proper lighting is essential for poultry. Chickens rely on light cycles to regulate their growth, feeding habits, and egg production. Automating the lighting system with a Bluetooth app allows farmers to:

  • Ensure optimal light exposure.
  • Adjust light levels remotely.
  • Save time by automating day and night cycles.

A Bluetooth-controlled system allows for remote control within a short distance, making it easy for the farmer to manage the lights while on-site.

Read also Remote Health Monitoring System with ESP32, LoRa, & ThingSpeak

Overview of the Project: What You’ll Build

In this project, you will design and implement a system that allows you to control a tungsten bulb in a poultry farm using a smartphone app. The setup will use Bluetooth communication to send commands to an Arduino Uno, which will turn the bulb on or off. The RemoteXY app will be used to create a simple, user-friendly interface to control the bulb, while the Arduino Uno and HC-05 Bluetooth module will handle the hardware control.

Also, in this project, we will add an automated part that uses DHT11 temperature and humidity sensor control and monitoring system that reads and adjusts the temperature and humidity around the poultry farm living quarters using a digital humidity and temperature sensor, DHT11. A chicken’s body temperature typically ranges from 41.5 degrees Celsius to 42.5 degrees Celsius, depending on its surroundings, as long as air movement—which typically ranges from 10 to 15 degrees below the body temperature—is present. The Arduino unique microcontroller Atmega328P-PU, which was designed to communicate with a Wi-Fi module using the Arduino IDE, would form the foundation of the proposed system

Components/Materials Needed

Smart Bluetooth app-based poultry farm
Smart Bluetooth app-based poultry farm, the breadboarding phase
  • Arduino Uno: The central microcontroller that will manage the commands and control the bulb.
  • HC-05 Bluetooth Module: Enables communication between the smartphone and Arduino.
  • Tungsten Bulb: This acts as the light source for the poultry house.
  • Relay Module: Switches the bulb on or off based on the commands received.
  • Power Supply: To power the entire system.
  • Smartphone: To run the Bluetooth app for controlling the bulb.
  • Wires and Breadboard: For connections.
  • DHT11 sensor module (Optional): For auto controlling of the poultry farm model

Read also Automatic Headlight Dimmer For Vehicles Using Arduino

The Circuit Diagram Setup

Schematic diagram of Bluetooth App controlled and monitored poultry farm project design.
Schematic diagram of Bluetooth App controlled and monitored poultry farm project design.

The first step is to wire all the components together. Below is a simplified wiring guide:

  1. Arduino to HC-05:
    • TX of HC-05 → Pin 2 on Arduino.
    • RX of HC-05 → Pin 3 on Arduino.
    • VCC of HC-05 → 5V on Arduino.
    • GND of HC-05 → GND on Arduino.
  2. Arduino to Relay Module:
    • Pin 8 on Arduino to control the relay.
    • VCC of Relay → 5V on Arduino.
    • GND of Relay → GND on Arduino.

The relay module will connect directly to the tungsten bulb to control power. Since we are working with Alternating Current (A.C) voltages of above 220V. This can can be deadly and we needed something to isolate it from the DC voltage we are using on the Arduino Uno and the PC.

Read also RFID Access Control System For Home Automation

Explanation of Circuit Diagram of Bluetooth App-Based Smart Poultry Farm

circuit diagram of the system setup

The Android phone and Bluetooth module will be linked so that the status of this chicken farm may be viewed and managed remotely from that device. The Android device would run an app that was created exclusively with  RemoteXY to show the temperatures on its screen. The app would also allow the user(s) to control the temperature by pressing a button on the screen.

Designing the App on RemoteXY Web Interface

designing the app for the smart Bluetooth app smart poultry
designing the app for the smart Bluetooth app smart poultry

To design this app GUI, you can used a switch button. You can edit this to the width and height you deem fit as shown on the image above. The app was designed in both the vertical and horizontal app view. Also, a label was used to write the string text that would show the temperature and humidity we included from the DHT11 Sensor.

Once this design is down, you can click on the “Get Source Code” to get the basic GUI Arduino code for this GUI. It is also interesting to note that you have to specify which button on the Arduino Uno , the button switch widget would have to control or toggle its state when you slide press it.

Read Bluetooth App Controlled Smart Door Using Arduino

Programming the Project Design

// you can enable debug logging to Serial at 115200
//#define REMOTEXY__DEBUGLOG    

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__SOFTSERIAL

#include <SoftwareSerial.h>
#include "DHT.h"

// RemoteXY connection settings 
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600


#include <RemoteXY.h>

// RemoteXY GUI configuration  
#pragma pack(push, 1)  
uint8_t RemoteXY_CONF[] =   // 112 bytes
  { 255,23,0,0,0,105,0,18,0,0,0,31,2,106,200,200,84,1,1,5,
  0,2,31,34,44,22,59,15,83,9,0,2,26,31,31,79,78,0,79,70,
  70,0,7,49,82,56,16,94,34,61,12,100,64,2,26,2,11,7,49,133,
  56,16,93,49,63,13,100,64,2,26,2,11,129,255,86,47,10,31,35,51,
  11,64,8,84,101,109,112,32,105,110,32,39,67,0,129,2,135,41,12,38,
  51,37,11,64,8,72,117,109,58,32,37,0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t switch_01; // =1 if switch ON and =0 if OFF
  char Temp[11]; // string UTF8 end zero
  char Hum[11]; // string UTF8 end zero

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;   
#pragma pack(pop)
 
/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#define PIN_SWITCH_01 8
#define relayPin 7

#define DHTPIN 6 

#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE); 

void setup() {
  RemoteXY_Init (); 

  Serial.begin(9600);
  Serial.println(F("DHTxx test!"));

  dht.begin();
  
  pinMode (PIN_SWITCH_01, OUTPUT);
  pinMode (relayPin, OUTPUT);
  
  // TODO you setup code
  
}

void loop() { 
  RemoteXY_Handler ();
  
  digitalWrite(PIN_SWITCH_01, (RemoteXY.switch_01==0)?LOW:HIGH);
  if (digitalRead(PIN_SWITCH_01) == HIGH) {
 digitalWrite(relayPin, LOW);
  }
  else if (digitalRead(PIN_SWITCH_01) == LOW) {
  digitalWrite(relayPin, HIGH);
  }
  delay(200);

  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.readHumidity();
  // Read temperature as Celsius (the default)
  float t = dht.readTemperature();
  // Read temperature as Fahrenheit (isFahrenheit = true)
  float f = dht.readTemperature(true);

  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t) || isnan(f)) {
    Serial.println(F("Failed to read from DHT sensor!"));
    return;
  }

  // Compute heat index in Fahrenheit (the default)
  float hif = dht.computeHeatIndex(f, h);
  // Compute heat index in Celsius (isFahreheit = false)
  float hic = dht.computeHeatIndex(t, h, false);

  dtostrf(t, 0, 2, RemoteXY.Temp);
  dtostrf(h, 0, 2, RemoteXY.Hum);

  Serial.print(F("Humidity: "));
  Serial.print(h);
  Serial.print(F("%  Temperature: "));
  Serial.print(t);
  Serial.print(F("°C "));
  Serial.print(f);
  Serial.print(F("°F  Heat index: "));
  Serial.print(hic);
  Serial.print(F("°C "));
  Serial.print(hif);
  Serial.println(F("°F"));

}

Explanation of the Arduino Source Code

This Arduino code integrates the RemoteXY library to create a graphical user interface (GUI) for controlling and monitoring a DHT11 temperature and humidity sensor. The code begins by defining the connection mode and including necessary libraries like SoftwareSerial and DHT. It sets up the RemoteXY connection settings and GUI configuration, which includes defining the structure for input variables such as a switch and strings for temperature and humidity readings. The setup() function initializes the RemoteXY interface, starts serial communication at 9600 baud, and initializes the DHT sensor. It also sets the pin modes for the switch and relay.

In the loop() function, the code handles the RemoteXY interface and reads the state of the switch to control a relay. It reads temperature and humidity from the DHT11 sensor, checks for read errors, and computes the heat index in both Celsius and Fahrenheit. The temperature and humidity values are then formatted and stored in the RemoteXY variables for display on the GUI. The sensor readings are also printed to the serial monitor for debugging purposes. This setup allows for real-time monitoring and control of the sensor data through a user-friendly interface.

Testing The System

testing the Bluetooth App based smart poultry design by turning off the tungsten bulb

Once everything is wired and the code is uploaded, you can test your system. Pair your smartphone with the HC-05 Bluetooth module. Open the RemoteXY app and use the button to toggle the bulb. Press the button, and the tungsten bulb should turn on. Press again to turn the bulb off.

testing the Bluetooth App based smart poultry design

The image of this working on the breadboarding phase is shown above. The tungsten is controlled effectively. By using the GUI button on the mobile app. We can also see the digital humidity and temperature of the DHT11 sensor as being read on the screen.

Troubleshooting Common Issues

  • Bluetooth Not Pairing: Ensure the HC-05 module is properly connected and that your phone’s Bluetooth is enabled. Check the baud rate in the code matches the module’s default setting (usually 9600).
  • Bulb Not Responding: Double-check the wiring, especially the relay module’s connection. Make sure the code is uploaded correctly and the Arduino is powered.

Advantages of Automating Poultry Lighting

  • Scalability: This system can be expanded to control more aspects of the poultry farm, such as feeding or temperature.
  • Consistency in Lighting: Automation ensures that your chickens receive consistent light cycles, promoting better growth and egg production.
  • Time-Saving: Rather than manually turning lights on and off, you can do it remotely from your smartphone.
  • Energy Efficiency: By controlling the lighting based on specific needs, you can reduce electricity costs.

Enhancing Your System: Ideas for Future Expansion

  1. Temperature and Humidity Control: In this project design, you have already used a DHT11 sensor to monitor the poultry house’s temperature and and humidity, and now, you can use it to automate fans or heaters.
  2. Feeding Automation: You can add a motorized feeder that can be controlled through the same app.
  3. Light Intensity Adjustment: Replace the tungsten bulb with an LED system that can adjust brightness based on time of day.

Conclusion

In conclusion, this Bluetooth-controlled poultry lighting system is an easy-to-build and cost-effective way to automate key operations in your poultry farm. With a simple Arduino Uno and HC-05 Bluetooth module, you can create a smart system that not only saves time but also improves the productivity of your farm. Automation is the future of farming, and this project is a perfect first step into the world of smart agriculture.

Frequently Asked Questions (FAQs)

1. Can I control more than one bulb with this system?
Yes, you can expand the system to control multiple bulbs by using additional relay modules.

2. What’s the range of the HC-05 Bluetooth module?
The range of the HC-05 is typically around 10 meters in open space. Obstacles like walls may reduce the range.

3. Can I use this system to automate feeding?
Yes, you can add a motorized feeding system and control it with the same smartphone app by adding more relays and adjusting the code.

4. Can I monitor the temperature in the poultry house?
Absolutely! By adding a temperature sensor like the DHT11, you can automate fans or heaters to keep the environment optimal for poultry.

5. Can I use a different type of bulb?
Yes, you can replace the tungsten bulb with an LED bulb or another light source, as long as you adjust the power requirements and relay setup accordingly.

Leave a Comment

Follow by Email
Pinterest
Pinterest
fb-share-icon
Instagram
Telegram
WhatsApp