Electronics
Board
I used my own board featuring just an Arduino compatible Atmega328p with LoRa radio (HopeRF RFM95) and an LDO; more details here.
Sensors
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.
Hardware
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.
Software
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.