Published on

Java Automation Tutorial – Cluckburg Part 1 - Hardware

Authors

Those with children will no doubt remember that the first few weeks after the arrival of a new baby throws routines completely out of the window, with baby feeding every two hours. Those with backyard chickens may also know the hassle of needing to lock the chickens up/let them out during daylight hours so neighbouring foxes don’t get an easy meal. These two things combined motivated me to automate some functions of our backyard chicken area to give us some flexibility. Welcome to Cluckburg!

img1

First up – the coop door. This post will cover using a microcomputer to drive a stepper motor, which I hope to power a drawbridge style system that activates around dusk/dawn.

img2

My first step was digging out an old Raspberry Pi 1 Model B I had laying around unused, and ordering a stepper motor and driver board. My starting materials were:

  • Raspberry Pi 1 Model B (you can and probably should just get a newer Pi board)
  • ModMyPi Driver Board and “28BYJ-48” Stepper Motor
  • Soldering Iron + coil of solder
  • 8GB SD Card with Raspbian Jessie installed

img3

Once the motor and driver arrived, I performed some surprisingly not completely disastrous soldering work on the board loosely following this guide: http://mypishop.com/Stepper.html

img4

It’s worth noting that the pieces that came with my kit looked a little different as you can see in my images. There were no real surprises other than one set of LEDs being completely ill-suited for purpose as they were too broad to stand next to each other.

img5

This was then mounted onto the raspberry pi, the SD Card plugged in and I started on the software side:

img6

Next Steps:

  • Getting the motor to move via code
  • Writing testing code to open/close the coop door via stepper.
  • Designing a simple prototype winch system and testing string length/torque against the weight of the door.
  • Figuring out how to tell if there is daylight out, triggering opening and closing appropriately
  • Deciding on how to power the pi once inside Cluckburg – solar/running a wire to a weatherproof box to also power a heatlamp etc.