Recently My neighbor went out of town and asked me to feed his pigeons daily around 10 am in the morning. After feeding them for few days, I realized that I can make a 10$ Automatic timer based pigeon feeder using NodeMCU which can really ease my task of feeding pigeons daily. So I quickly started off.
VideoThis is the full tutorial and my journey of creating the automatic pigeon feeder.
DesignI created very simple design to make the pigeon feeder. My ultimate goal was to make it under 10$ and by using as much as recycled stuff I could find. So the design basically revolved around scattering of seeds due to vibration. The design had a simple plastic container which will be hung upside down. Pigeon food can be put in the container from a small hole at the bottom of the container. There will be a motor connected to a "food scattering section" which will have a long pipe like structure. So when the motor will revolve, it will revolve the scattering section throwing seeds from the pipe like structure. The pigeon food would automatically come down due to vibration in the body and gravity thus scattering pigeon food all across the floor. Here is the rough sketch which I made before creating the actual work.
Making Structure
Making the upper part. So our upper part basically consists of a lid connected to a dc motor on the inside of the container. The motor will rotate a cardboard circular structure which will scatter pigeon food on the floor while rotating. And a hole in the plastic lid of the container will constantly allow pigeon food to go down on the scattering platform. A tiny hole on the bottom of the container will allow me to to put pigeon food from there inside the container.
Testing the Structure
After that simply assemble everything and connect the motor to a 6V or 9V power source to make sure that everything is working fine.
Follow this circuit diagram. The circuit is really simple with relay is connected to pin D0 of ESP12E and both are powered by a 9V battery.
Then pack it together and hang it outside where you want to feed pigeons.
Since I wanted to make it low cost solution, Instead of using RTC for getting the time, I made a simple function to get the time from internet.
So I started off by declaring my D0 pin on NodeMCU as output pin
pinMode(D0, OUTPUT);
digitalWrite(D0, 1);
To get the time from internet, I made a small function, which pings google.com and gets the exact time in 'GMT' format. I got this function on this forum http://www.esp8266.com/viewtopic.php?f=29&t=6007&start=5 . This helped me to save money on my RTC.
String getTime() {
WiFiClient client;
while (!!!client.connect("google.com", 80)) {
Serial.println("connection failed, retrying...");
}
client.print("HEAD / HTTP/1.1\r\n\r\n");
while(!!!client.available()) {
yield();
}
while(client.available()){
if (client.read() == '\n') {
if (client.read() == 'D') {
if (client.read() == 'a') {
if (client.read() == 't') {
if (client.read() == 'e') {
if (client.read() == ':') {
client.read();
String theDate = client.readStringUntil('\r');
client.stop();
//dated="";
// dated=theDate;
return theDate;
}
}
}
}
}
}
}
}
Then I had to extract only the hour part. For ex : if the time returned was 'thu, 27 oct 2017, 10:09:00' then from the time '10:09:00' I had to extract only '10' and compare it in the program so that if it gets 10 then it should turn on the feeder for 30 seconds. That would be enough to scatter food. So here is the logic. And the logic will check the time every 50 seconds. We can increase the timer to make it more power consumption friendly. Also first time when the feeder turns on, it will set the flag as 1 and would turn on once again in the evening.
tm=dated.substring(17,19);
if((tm == "04") && (flag==0))
{
digitalWrite(D0, 0);
flag=1;
delay(30000);
digitalWrite(D0, 1);
}
else if((tm == "12") && (flag==1))
{
digitalWrite(D0, 0);
flag=0;
delay(30000);
digitalWrite(D0, 1);
}
delay(50000);
You can change the time by converting GMT to your time zone by using the below website.
I really enjoyed making this tutorial because it was something which I would use and still using. Let me know if you have any questions. Also if you make something like this, please send me link. I would really love to see it.
Comments
Please log in or sign up to comment.