LoRaWAN chicken door

The ultimate IoT goal: connect a hen house to Internet

Public Chat
Similar projects worth following
This project shows what is the next obvious step to the everything-should-speak-on-internet™ : make an automated hen house door and connect it to internet ! Why ?
* Because the only dev board I had available when I did the project was with a LoRa chip
* Because everything should be online
* Because my chickens love technology
* Finally, after all those obvious reason, the silly one: It appears that the system have a battery life of about five weeks, that is enough for me to forgot to change the battery. I had no solar panel on hands but the LoRa chip was on the board => zero cost solution found :)

Furthermore chickens are easy to to predict: they always go back in the hen house at sunset and want to go out at sunrise; no fancy counting/image processing or weighting need to be added to the hen house, only a luminosity sensor.

Hardware is based on what I had laying in my drawer: custom Arduino/LoRaWAN board, small geared DC motor, light sensor + 3D printed parts



I used my own board featuring just an Arduino compatible Atmega328p with LoRa radio (HopeRF RFM95) and an LDO; more details here.


Light sensor: I could have use a simple light dependent resistor but I use the system also need to have rough idea of ambient luminosity (cloud/sun/night detection) for other projects so I used a MAX44009 I had laying around

I do not use any feedback sensor for the door, I just rely on timing + a margin: when the door is fully closed (or opened) the motor stalls. It is not the best way to do but avoid giving wiring to eat to chickens.

Motor & its driver

It is a basic "60 rpm 6V DC geared motor" as advertised by lot of Chinese sellers. I tried the 30 rpm version but as I supply it with only 3.5 to 4.2 V it was not able to move the door. Lower rpm is nice to increase force needed to open the door, so it is harder for the fox to open it :) Anyway the door worked for more than a year without fox issue !

Is use a cheap XXX H-bridge to control it, simple but efficient. The drawback is its power consumption in standby so I added a N channel mosfet to cut its power when not used.


Door slider

The door in a simple sheet of plywood mounted on a cheap linear rail thanks to 3D printed parts, Door stops are made by two nails and a string is attached to a screw in the middle of the door.

String transmission

Motor rotation is converted to translation by a simple string with enough friction to avoid slipping. A 3D printed pulley mounted on 608ZZ bearing (old skateboard leftover)  is enough at the opposite of the motor.

IT and display

Device data are pushed to Home Assistant, this allows me to integrate the light sensor with other automation, create notification in case of device failure or battery running low...

Node-Red is involved to get data from LoRaWAN network server (TheThingsNetworks), translate and forward them to Home Assistant, all by MQTT.


Code is published on Github. Thanks to LoRaWAN, downlinks can be send to the device to:

  • Open/close door
  • Change door movement time
  • Change board sleep time

LoRaWAN uplinks payload data format is Cayenne LPP, this allows easy debug directly in TTN.

Portable Network Graphics (PNG) - 10.72 kB - 09/05/2019 at 13:06


  • 1 × MAX44009 Ambient light sensor
  • 1 × Note RF V2 Board LoRaWAN enabled boards with atmega 328p, Arduino bootloader:
  • 1 × 6 V DC geared motor I used a 60 rpm version
  • 1 × 3D printed pulleys
  • 1 × 18650 battery From an old laptop battery

View all 6 components

  • Fox always finds its way

    Olivier09/06/2019 at 13:42 0 comments

    The door has worked for more than a year without any issue, and did a really good job at protecting chickens and remind be to change the battery once in a while. Unfortunately we forgot to close "maintenance door" after a clean up.... And the fox was faster than us to figure it out :/

    No I need to add a sensor for that maintenance door :)

    Anyway I published the project as I might help or inspire others.

View project log

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates