How I Automated My Barn with Arduino, Raspberry Pi, Kafka, Docker, Kubernetes, Mongo and the Cloud


A few years ago I created a small system to automate some tasks in our barn where we keep pet potbelly pig and our chickens. Simple things, like scheduling when the lights turn on and off, temperature monitoring and a webcam. It was nice to automate those things, but the best part for me was being able to tinker with the sensors and devices and learn new libraries, frameworks and languages.

I’ve recently re-imagined the system as a way to learn more new technologies. I’ve created a prototype version to demonstrate how I might build it again if I were to start over from scratch and in this session we’ll look at that model and learn about the hardware and software used in it. At it’s core, the system uses an Arduino, Raspberry Pi and various pumps, solenoids, motors and sensors to simulate the automation of certain tasks like filling a water bowl, opening and closing doors, monitoring environment and turning on and off lights on demand or via schedule. The hardware runs a Groovy based program which interfaces with Kafka for messaging to both store sensor data in a MongoDB instance as well as receive commands for remotely performing certain tasks on demand. The persisted data is formatted and displayed on a web application running in a Docker container that is deployed to a cloud-based Kubernetes cluster.

We’ll look at both the hardware and software that power this system and how I’ve used the project as a playground for learning new technologies, languages and frameworks.


Todd Sharp

Todd Sharp