Autonomous and Interactive Chicken Coop Livestream

HenHangout

Chirping
Dec 24, 2024
41
132
69
This project started sometime in October when an online friend in Italy casually suggested I stream my chicken coop. I'm not sure whether or not they were serious but at the time I thought "Yeah... I should totally do that...". Fast forward a couple months and way too much time spent designing, installing, programming and implementing and the setup is finally complete and live

The final product: twitch.tv/HenHangout

All features:
  • Four POE cameras
  • Two of which are pan/tilt cameras that can be moved by X°:Y° or to a preset via twitch chat
  • Focused camera can be changed via twitch chat
  • Vote to change focused camera via twitch chat
  • Two feed dispensers that can be called upon to dispense treats via twitch chat
  • Stream includes updated temperature, sunset/sunrise times, current time, and days since streaming started (since Feb 1)
  • IRC (internet chat relay) bot sits in chat and adds 'points' to viewers every minute to bypass twitch's 'channel points' feature which is only available to 'affiliates'
  • These points are used to limit overuse of dispensers or moving cameras too much
  • AI chatbot that can answer viewer questions based upon a given set of instructions in twitch chat
  • AI moderator bot that removes messages that violate rules defined in a given set of instructions
  • Net deployed over the entire free-range area to ensure chicken protection and that viewers don't witness harm to the chickens carried out by hawks
  • Gutters installed on the chicken coop to route rainwater to a bin with water nipples installed ensuring constant fresh water
  • ~1600 cubic inches of feed hoppers ensuring a weeks worth of food in my absence
  • Raspberry Pi Pico W programmed to handle coop operations, with built in failsafes and will accept and run raw python code remotely
  • I can send raw python code to the Pico and print the output via twitch chat
  • TOPENS Gate opener installed on the run gate
  • Coop run gate automatically opens 30 min prior to sunrise and closes 30 min post sunset via the Pico connected to (sort of hacked into) the TOPENS gate opener
  • Nesting boxes open 4 hours prior to sunrise and close 1.5 hours prior to sunset
  • Each nesting box is controlled via its own dedicated servo, allowing me to disable a specific nesting box in case a hen is brooding
  • All stream, camera and chatbot operations are hosted on a dedicated home server that has failsafe operations, and commands the cameras to reboot and restarts the stream daily at 1am, allowing for 100% autonomous operation
  • Pan/Tilt cameras revert to a designated focal point upon reset
  • Camera X°:Y° movement is calibrated per camera based on time taken to move completely on the X/Y axis with complex image processing to determine whether or not the camera has stopped

Everything was designed to be a solid system that effectively runs itself with minimal intervention on my part
 

Attachments

  • stream.jpg
    stream.jpg
    370.7 KB · Views: 23
  • about.jpg
    about.jpg
    443.3 KB · Views: 6
  • microcontroler housing.jpg
    microcontroler housing.jpg
    676.1 KB · Views: 7
Updates:
I made it so the focus changes to the most active camera (based on similarity index over a span of 10 snapshots taken 1 second apart) so long as nobody has changed the focus or moved a camera within the past 20 minutes and outside the time frame of the run gate being kept open (made sense to me since only one camera matters at night). This should ensure that something interesting will be on screen.

A viewer suggested that I post random chicken facts in chat so I use AI to generate them every hour. Its not supposed to repeat a fact for 20 days but we'll see if that works I guess.

Other than that, not much has changed besides adding the chat to the stream, but I made it opaque so it can be legible but not distracting.

To do:
Fine tune the auto focus, it likes to focus inside the coop even if its just a chicken walking in to feed or jump into a nesting box. Perhaps make it the average of all similarity indexes for that camera?

Better protection around dispensers. My barred rock hen is smart enough to peck at the dispenser hoppers. I have some leftover plastic sheet from a custom picture that fell off and broke which I used to make the nesting box covers, I can cut it to make durable feed hopper shields.

Toys. I'd like a rope bridge that runs between to coop and fence, a swing, maybe a mirror chickens can look into, probably placed in view of camera 4.
 
Last edited:

New posts New threads Active threads

Back
Top Bottom