กลับไปหน้ารวมไฟล์
smart-hen-coop-arduinocloudgames2022-0813be-en.md

I have hens that are not at the same place as I live. They have an automatic door that can open and close on time I set, but the hens are living creatures, not machines. They sometimes don‘t get in in time. That means that I have to travel for about 15 minutes to the hen-coop, open the door manually and then travel back home. I thought there must be a better solution, something I can open/close not only in time but on my demand too. But there isn’t. Well, there wasn’t… Because I made the solution myself… behold the Smart Hen Coop! And it comes with far more than just opening and closing door at demand, it can turn on/off heater based on inside temperature, notify you when hen is possibly closed outside and also check if your automatic water feeder isn’t malfunctioning and oberflowing!

SENORS

Open/close door switch

I use micro switches to know if the doors are opened or closed

Movement sensor (PIR SENSOR)

Waterlevelsensor

In my case, the only problem I had was that the water in the automatic filling system could fail and I wanted it to notify me if it does, so I cut a hole the tank and put the soil oplá kit moisture sensor in. So when the water gets to it, it triggers.

Door servo

Temperature sensor

Unfortunately, I couldn’t find a photo of the temperature sensor I used

Relay

Now we connect everything according to the schematic

PCB

IoT Cloud setup

activityLog - Character String, Read Only, On change

closeTime - Time, Read & Write, On change

doorRealState - Integer Number, Read Only, On change

doorShouldBe - Boolean, Read & Write, On change

doorState - Boolean, Read Only, On change

errorLog - Character String, Read Only, On change

heatingState - Boolean, Read & Write, On change

heatingTempStartup - Floating Point Number, Read & Write, On change

humidity - Floating Point Number, Read Only, Periodically (30s)

motionOutside - Character String, Read Only, On change

doorState - Boolean, Read Only, On change

openTime - Time, Read & Write, On change

pressure - Pressure, Read Only, Periodically (30s)

temperatureIn - Temperature, Read Only, Periodically (10s)

waterOverFlow - Boolean, Read Only, On change

IFTTT Notifications (requires IFTTT Pro+)

First we create new applet and add webhook trigger with JSON payload to it.

Then we add what the trigger should do. I chose notification, but you can choose email and other things.

Then we add filter

and paste this to the filter code

var payLoad = JSON.parse(MakerWebhooks.jsonEvent.JsonPayload);
if (payLoad.value1 == "motionOutside"){
if (payLoad.value2 == "Motion outside detected!"){
IfNotifications.sendNotification.setMessage("Motion outside detected!")
}else{
IfNotifications.sendNotification.skip();
}
}else if (payLoad.value1 == "waterOverFlow"){
if (payLoad.value2 == "true" || payLoad.value2 == "1" || payLoad.value2 == "True" ){
IfNotifications.sendNotification.setMessage("Water is overflowing!")
}else{
IfNotifications.sendNotification.skip();
}
}else if (payLoad.value1 == "errorLog"){
IfNotifications.sendNotification.setMessage("Error! Check errorLog!");
}else if (payLoad.value1 == "heatingState"){
if (payLoad.value2 == "true" || payLoad.value2 == "1" || payLoad.value2 == "True" ){
IfNotifications.sendNotification.setMessage("Heating turned on...")
}else{
IfNotifications.sendNotification.skip();
}
}
else{
IfNotifications.sendNotification.skip();
}

Then we continue and finish.

Now under the profile icon we click My services and find webhooks

Open the documentation.

We change the {event} in trigger with JSON payload to our trigger name and copy it.

Then we go back to Arduino IoT Cloud and click set webhook.

We paste there our link add it and thats it!

3D printed parts

Unfortunately, I couldn't find where I downloaded most of the models so adding it here without credit would be plagiatorism, but I'm sure you can find models that are right for you!

DASHBOARD

You have lots of options on the dashboard with this project, so make it yourself-friendly!

EXPANDED TECHNICAL DETAILS

Livestock Safety Automation

Created for the #ArduinoCloudGames2022, this project focuses on the total automation of a chicken coop to ensure flock safety.

  • Smart Door Actuation: Uses a High-Torque Stepper Motor or Linear Actuator to open/close the door based on sunrise/sunset data synced from the web.
  • Internal Monitoring: Includes a PIR sensor to detect intruder movement (predators) and a weight sensor (Load Cell) to count the number of hens inside the coop.

Cloud Dashboard

  • Arduino IoT Cloud: Provides a real-time web interface. If the door fails to lock at night, the system triggers a "Critical Alert" to the farmer's phone, allowing for immediate remote intervention.

ข้อมูล Frontmatter ดั้งเดิม

title: "Smart Hen Coop #ArduinoCloudGames2022"
description: "Smart Coop door, that ensures that your life is easier not only for you but even for your hens."
author: "krystof018"
category: "Internet of Things, BT & Wireless"
tags:
  - "arduinocloudgames2022"
  - "hen"
  - "iot"
  - "smart"
  - "chicken"
views: 2326
likes: 0
price: 699
difficulty: "Intermediate"
components:
  - "1x 3 and 4 lane wires"
  - "1x Continuous servo"
  - "1x 3D Printer (generic)"
  - "1x Relay 230V 5V"
  - "1x Solder Wire, Lead Free"
  - "1x Arduino Oplà IoT Kit"
  - "1x PCB prototyping board"
  - "1x Micro switch"
  - "1x Solder Flux, Soldering"
  - "1x Soldering iron (generic)"
  - "1x 18650 battery"
  - "1x SHT40 Temperature sensor"
  - "1x 18650 battery holder with 5V boost"
tools: []
apps:
  - "1x Arduino IoT Cloud"
  - "1x Maker service"
  - "1x Arduino IDE"
downloadableFiles:
  - "https://github.com/arduino-libraries/Arduino_MKRIoTCarrier"
  - "https://github.com/Sensirion/arduino-i2c-sht4x"
  - "https://create.arduino.cc/editor/krystof018/bc1ec893-2256-432a-938d-adb3cc08f972/preview"
  - "https://create.arduino.cc/editor/krystof018/bc1ec893-2256-432a-938d-adb3cc08f972/preview"
  - "https://github.com/Sensirion/arduino-i2c-sht4x"
  - "https://github.com/arduino-libraries/Arduino_MKRIoTCarrier"
documentationLinks: []
passwordHash: "23b8640a315de71b48ffde4277347c5cdade8c81dbf38871262b9525161995c6"
encryptedPayload: "U2FsdGVkX18u38A/tJcrOgS7/79rqFSDvlSpxODTnpde3A4+sWtkba6CU5tfSsvvkmDtGJpVwM2f4Y6pxzKWeefk6iH5ZII2cBxd/PmmVmZZvYuQmkppxa68LRIVLsE8UTPA0kQLzZ79dxzOoUjXdA=="
seoDescription: "Automate your poultry care with the Smart Hen Coop project using Arduino to make life easier for you and your hens."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/smart-hen-coop-arduinocloudgames2022-0813be_cover.jpg"
lang: "en"