ThatsMyPurseIdontknowyou
Chirping
I looked at a bunch of automatic coop doors, and none of them met my needs.
I realize this might be over some folks heads, but I thought I'd post it and maybe someone else will see it and it will inspire them to make it even better.
I use a server at my house called Home Assistant. https://www.home-assistant.io/
You can do all kinds of cool stuff and control just about anything that talks to the internet. I can control my TV's, IP cameras, dishwasher, etc. I have door locks on my back doors that I can control and unlock via my phone.
So I started looking into what I could do to control it with this and found the ESP32 chip. These are really cheap. I got one for $10 at a Microcenter. That, and a L298N motor controller and a bit of my time, and I have a door I can control from my server.
I bought the cheapest coop door I could find online. I just wanted the moving door and the motor.
https://www.ebay.com/itm/316056534216
The photocell eye, the motor circuit, etc got ripped out. That photocell was super touchy and a cloud going over would make it close.
This is what I started with:
At first I thought maybe I could modify that motor circuit using a wifi controlled relay. But I had no luck.
So, I went to microcenter and got the ESP32 and ordered the L298N online.
I mocked everything up first
Then once I was happy I hot glued it all in place. I would like to be able to remove and move to a different housing, as after I prove this out I'm going to upgrade to a metal housing instead of plastic.
I'm using a 5V power supply for the motor driver and USB to power the ESP32. There is an issue with the ESP32 where it won't have wifi if you power it with 5V instead of USB. So, I have to have 2 power adapters. I will fix this in the next version.
I put it all back together.
Here is the pertinent ESPHome code. I didn't get fancy yet, I just timed how long for it to open and close.
However I have some hall effect sensors on the way so I can use a magnet to detect when the door is open or close. Again, this was proof of concept, that will be in the next version.
And, a video of it working:
So why would I do this?
Because now I can control my chicken coop door from anywhere. I can open it from my phone. I can open it on vacation.
And, I can automate it. I can use Home Assistant to have it open 15 minutes before today's sunrise and close 15 minutes after today's sunset.
I can use AI and the camera in my coop to detect if the coop door is closed and a chicken is moving around in the main part of the chicken house where it shouldn't be, and alert me that someone might have missed bed time.
Also because I like to do this sort of stuff. I realize its overkill.
I realize this might be over some folks heads, but I thought I'd post it and maybe someone else will see it and it will inspire them to make it even better.
I use a server at my house called Home Assistant. https://www.home-assistant.io/
You can do all kinds of cool stuff and control just about anything that talks to the internet. I can control my TV's, IP cameras, dishwasher, etc. I have door locks on my back doors that I can control and unlock via my phone.
So I started looking into what I could do to control it with this and found the ESP32 chip. These are really cheap. I got one for $10 at a Microcenter. That, and a L298N motor controller and a bit of my time, and I have a door I can control from my server.
I bought the cheapest coop door I could find online. I just wanted the moving door and the motor.
https://www.ebay.com/itm/316056534216
The photocell eye, the motor circuit, etc got ripped out. That photocell was super touchy and a cloud going over would make it close.
This is what I started with:
At first I thought maybe I could modify that motor circuit using a wifi controlled relay. But I had no luck.
So, I went to microcenter and got the ESP32 and ordered the L298N online.
I mocked everything up first
Then once I was happy I hot glued it all in place. I would like to be able to remove and move to a different housing, as after I prove this out I'm going to upgrade to a metal housing instead of plastic.
I'm using a 5V power supply for the motor driver and USB to power the ESP32. There is an issue with the ESP32 where it won't have wifi if you power it with 5V instead of USB. So, I have to have 2 power adapters. I will fix this in the next version.
I put it all back together.
Here is the pertinent ESPHome code. I didn't get fancy yet, I just timed how long for it to open and close.
However I have some hall effect sensors on the way so I can use a magnet to detect when the door is open or close. Again, this was proof of concept, that will be in the next version.
captive_portal:
output:
- platform: ledc
id: motor_1_a
pin: GPIO2 # Pin to IN1
- platform: ledc
id: motor_1_b
pin: GPIO4 # Pin to IN2
- platform: ledc
pin: GPIO5 # Pin to EAN
id: motor_enable
frequency: 1000Hz
fan:
- platform: hbridge
id: Door_Motor
name: "Door Motor"
pin_a: motor_1_a
pin_b: motor_1_b
decay_mode: SLOW
enable_pin: motor_enable
speed_count: 100
button:
- platform: template
name: "Door Up"
on_press:
then:
- fan.turn_on:
id: Door_Motor
direction: Forward
- delay: 5s
- fan.turn_off: Door_Motor
- platform: template
name: "Door Down"
on_press:
then:
- fan.turn_on:
id: Door_Motor
direction: REVERSE
- delay: 5s
- fan.turn_off: Door_Motor
And, a video of it working:
So why would I do this?
Because now I can control my chicken coop door from anywhere. I can open it from my phone. I can open it on vacation.
And, I can automate it. I can use Home Assistant to have it open 15 minutes before today's sunrise and close 15 minutes after today's sunset.
I can use AI and the camera in my coop to detect if the coop door is closed and a chicken is moving around in the main part of the chicken house where it shouldn't be, and alert me that someone might have missed bed time.
Also because I like to do this sort of stuff. I realize its overkill.