Electric chicken stall door with Arduino
Diy motorized door for a chicken stall, controlled by Arduino Nano
- motor can be controlled with
- buttons on the main controller box
- 433 Mhz remote
- UART (RX/TX) communication (can be used with a PC or with a ESP8266 to make the system controllable over Wifi)
- two Reed-switches to indicate top and bottom position of the door
- safety end-stop-switch to cut off the power if the door in case of failure does not stop in its top position
- Solenoid lock to lock the door
- leds to indicate error/ready state
The Code and other Project Files are hosted on Github:
- Motor with gear-system to create some holding torque in the top position (and stop the door from going down again by itself). I used one with 20 rpm and a torque of 0,15Nm (link)
- HG7881 motor driver board, I used this one (link)OR: A TLE4202B and a N-Channel Mosfet to create your own motor- and solenoid-driver board (see below)
- 2x Some kind of door reed contact (link)
- 433 Mhz receiver (link)
- Solenoid Lock (link, 12V/350mA version)
- Some leds, resistors, screw terminals, …
Front panel for the main controller
The size of this frontpanel is 125x70mm. You can customize it using the free “Frontplatten Designer”.
You can either use a premade motor driver like the one I linked in the parts list or build your own. The pins on the main pcb for this driver stay the same. This driver is based on the TLE4202B. Since the solenoid lock doesn’t need a in the polarity switchable voltage, we can use a simple Mosfet to control it.
This circuit is not perfect, since it does not feature any filter-capacitors, which are recommended in the datasheet. But it works for the most parts :).
Winch drum for the motor
I created a 3D-model for a winch drum, to which rope of the door the can be spooled to. It fits to the flattened motor axis. A M3 screw can be screwed in the second hole to tighten the motor axis. The rope can also be tightened to this screw (if the screw is long enough). This part fits to the motor linked in the parts list and I think it will also fit to any other motor with 6mm axis. You can customize the model using tinkercad and this link.
Mount for the solenoid lock
This part is used to hold the solenoid lock. It will fit to the solenoid linked in the parts list. For other solenoids please check the dimensions. You can customize the model using tinkercad and this link.
In the code I am using the RCSwitch-library. Since it is already included in the code-folder there is no need to download an import it manually. I have linked it in the code anyway.
To get your 433Mhz remote working with the controller fist upload the
ReceiveDemo_Simple.ino-sketch from the RCSwitch-Library examples. Now open the serial monitor an then press the keys on your remote, that you want to use. Now copy the received codes from the serial monitor into the
Remote Codes-Section in the code.
You need to test out how long your opening/closing process of the door takes with your motor. If you have measured it add a few seconds to the value an change the
motor_timeout-variable in the code to this value in milliseconds (10s = 10000ms). If the motor is running longer than this timeout it stops automatically.
I implemented a serial interface to control the movement. If you add a Wifi-capable microcontroller (like the ESP8266) to this interface, it can make the system remote-controllable over wifi.
The functionality of the UART interface:
- Baudrate: 9600 Commands:
- Request State of the Door: ‘S’
- Returns: 1 – Door is open, 0 – Door is closed, 2 – Unknown Position
- Open Door: ‘U’
- Returns: ‘U’
- If it fails or not possible (already open): ‘E’
- Open Door: ‘D’
- Returns: ‘D’
- If it fails or not possible (already closed): ‘E’
- Stop Movement: ‘H’
- Returns: ‘H’
- RC Switch Lib: https://github.com/sui77/rc-switch
- CCC – Chicken-Coop-Control: https://sites.google.com/view/arduino-chicken-coop-control/home
This work by Dustin Brunner is licensed under CC BY 4.0
Dieses Werk von Dustin Brunner ist lizenziert unter einer Creative Commons Namensnennung 4.0 International Lizenz.