Chicken project -board selection help for my requirements please.

I would greatly appreciate some guidance on hardware.

I am new to microcontrollers but have a fair bit of coding experience so I hope the plunge into building will be reasonably straightforward. I am not yet even clear that arduino vs pi is settled though I am leaning to arduino to keep it smaller and simple.

Here are my project goals:

  1. Manage the devices / sensors remotely by having a basic on board web-server. I have seen some examples of a basic server on arduino.

  2. Network connection only by wired ethernet. I don't want to spread more wifi out there and I have now wired in the coop with Cat6 an a PoE+ switch to connect several cameras -currently running. I make my own cable and have plenty to run out to the new door. I would add a splitter to drive power for both the boards and motors -PoE+ can send 30w.

  3. Control motor (DC/servo/stepper?) to open and close a small door to the fenced run of my chicken coop. The door will run horizontally and not need as much torque as a lifting door would need. Door control to be via a web-page button and with a wired button beside the actual door as a backup.

  4. Control solenoid that will lock the chicken door open or closed by driving a pin into an opening.

  5. Read local air temperature

  6. Read the water level in a closed and slightly heated watering bucket.

  7. Count objects (chickens) going through the door: report the counts to the lan, read in from code on my ubuntu server and processed there. The count will only really be useful as an end of day count to double check on all birds in or possibly prior to some other reason to close up the run. I was considering an IR transmitter / receiver pair for the counting. Perhaps two sets spaced before and after if I want to get fancy and maintain a running count.

  8. Strain gauge measure of the weight of the feeder -not yet seeing sensors that might do that.

To support this set of goals I imagine the following:

Uno, ethernet 2 shield, H-bridge motor board or arduino motor shield, Grove temp sensor, Grove water sensor (would that work sitting in water and read out when the level falls below a mark?), Grove IR emitter / receivers.
Motor: 12v pwm small but not yet spec'd. Locking pin solenoid: could be a small servo / stepper

Questions:

  1. Does this list of requirements look well matched to the parts I was considering?
  2. By the time I buy and uno and the ethernet shield I might not be better off with a pi?
  3. Would it be better to use smaller boards, possibly something like the adafruit ethernet wing?
  4. Should I use the uno just as a prototyper on the way to smaller boards?

Only thing I think might be an issue is the limited pins of the Uno. Do your homework on each sensor and motor you want to control and see how many pins you need for each. Some may be able to share pins. Some won't. You may find you need a Mega.

Also, if the door is big enough for 2 or more birds to go through at the same time, your count will likely not be correct.

There have been similar discussions about this before.

Why not share your progress here as you proceed.

FYI

IMO, a small gear motor would be better than a servo motor.

The Chicken Door project yet again!!

:astonished: :astonished: :astonished:

I do realize that automating a chicken door has been done a lot and I respect that there is a lot of background there.

I have not seen one that wants to add the parts I list but more importantly I want to enable remote actuation via a web server and not on wifi.

Thank you for the point about the number of pins. I will map that out carefully.

Thank you also for the circuit image, for some reason I am having trouble extracting it but that's my local problem.

I'm happy to share what I do on this.

Look into the ESP32.

Built in WiFi and web server, and lots of I/O pins.

Or an ESP8266 with a number port expanders will also do.

As usual, start with one thing, make sure it works, add to your project. Then add the next thing. The hardest part is going to be the counter - lots of discussions on this board on people counter projects.

Dominic_Ryan:
I do realize that automating a chicken door has been done a lot and I respect that there is a lot of background there.

I have not seen one that wants to add the parts I list but more importantly I want to enable remote actuation via a web server and not on wifi.

Thank you for the point about the number of pins. I will map that out carefully.

Thank you also for the circuit image, for some reason I am having trouble extracting it but that's my local problem.

I'm happy to share what I do on this.

any Micro can handle some port expanders or shift registers so pin count on the base unit is not super critical.
BTW : the image is tiny.
you might want to read that other thread

[joke mode]
did you hear about that college Halloween party
a guy dressed as a chicken met a girl dressed as and egg
they went back to her place and were able to answer that age old question
[/joke mode]

darn... I forgot to use [funny joke mode]....

Thanks for the pointer about that system on a chip. One of my criteria is to connect via ethernet and not wifi. I don't want to add any wifi noise to the environment around my house. In addition, I have already run cat6 out to the space for some IP cameras. I have a PoE+ switch driving all the power as well.

So part of my question is to understand what the reasonable alternatives are for connecting the project over ethernet as well as hooking up the various sensors I am contemplating.

I have seen rudimentary webserver code for arduino, here area couple of examples:

That might be enough to pull in from the ubuntu server that I run bluecherry on for the cameras.

On the notion of other board makes I am starting to look at the adafruit line. They have an ethernet featherwing and a version of a Mega. I don't know yet how to assess the two approaches but at first glance the Ada approach looks to be smaller packaging.

I cam across a very interesting approach to monitoring the waterers for the chickens, using an ultrasonic ping to report depth to the water surface. This is one example but there are others online:

To recap my first question, what do you recommend as a board combination to enable ethernet and then enough pins to run the sensors I described.

I’ve done several commercial chicken houses (tens of thousands of birds), and the change/data rates are very slow.
Counting chooks will be your biggest challenge - possibly a second ‘later’ project connected to your first controller.
In our systems we used MEGA 1284’s and 3G data and/or SMS for command and control. The shed management (fans, feeders, water, vents, humidity etc)is run by a completely separate commercial Fancom system.

Unless your farm is quite small, wired or wireless. LAN is going to let you down. Look at more robust technologies or RS485 etc for fixed linecommunications.

I very much appreciate the input from someone who has had to deal with the scale you have experienced.

I fear that I must have given the wrong impression. The bird project is very small. Today we have 11 birds, we will max out at 20. The load on a LAN is limited to 4 lines to cameras and a single line to the controller. That is all currently running from a gigabit PoE+ switch which is linked by Cat6 to my ubuntu server. The server and IP cameras all connect to a router in which I have added rules to block outbound (internet) traffic from the cameras -in case of buried Chinese call-home activity. The Ubuntu server may ultimately connect to a secure Youtube channel for friends/family to use to see the birds.

Despite this small size I have approached this as a kind of challenge. Our birds are somewhere between pure egg producers and actual pets. They have individual 'personalities' and characteristics. We also don't have just one breed. In fact we have deliberately explored a number based on characteristics of cold tolerance, temperament, reliable egg production, egg color, and importantly heritage breeds.

As such I have hopes that some combination of image recognition and directional control will make the counting tractable. By directional control I mean having a door that is not big enough for two birds and having two IR sensor sets. That way I hope to base the counting on the sequencing of detection in one followed by the second. I have a camera pointed at the planned location of the door from the run to the open space. I am thinking about using that sequence as a trigger to grab a frame from the cameras. If that all works I would then feed the images to a neural net to train for recognition.

II do take your point about staging tasks though. The image recognition etc. will be one of the last items I tackle but the software side of that is likely going to take more work than the hardware. I can't imagine doing this on hundreds let alone thousands of birds that would likely all be the same breed as in a commercial operation.

No income depends on this project. If I can learn enough about putting together the microcontroller approach I have a chance of learning some more electronics than I last saw as an undergrad 45 years ago. Perhaps I can generate some interesting analysis of bird behavior, who knows.

In the mean time I am trying to get my head around the right combination of parts to address these goals. Ethernet only connection to a microcontroller that can read data from two IR sensors, a temperature sensor, two ultrasonic sensors (for water depth) and possibly a strain gauge to weigh how much food is left in the hanging bins. I will also drive a stepper or DC motor to close a horizontal door (therefore not needing a high torque) and a servo to drive a locking pin into the door when closed. I'd like to be power efficient where possible. For example, instead of having a stepper with a constant low power draw and a holding torque when a vertical door is open, I'd like to drive something that will require no power once set.

With those guidelines I hope that I can use the PoE+ line to split off the net from power and use the available 36W to handle the controller, motors and sensors.

This is all an amateur engineering challenge for the fun of it. I am fairly confident that I can pull together the code side. I have been coding as part of my job for more than 30 years even though I am not a professional coder. I have had to learn Fortran, C, Perl, Python and other languages. My last electricity and magnetism and electronics courses as undergrad feel like they were when transistors had just been discovered!

I hope this long background doesn't turn off too many people. I value any input I can learn from.

Is this over-engineering for 20 birds? Almost certainly yes.

As someone mentioned, I too would see if all this can fit in a MEGA2560- with the extra memory, serial and I/O pins.

When you want to expand, simply nominate one of the hardware serial ports to handle the comms.
Otherwise it exactly the same as a UNO to program.

The number of sensors isn’t an issue, even if they are checked every 50mS, the chooks won’t be able to get past that !

Just keep it cool and dry.
It sounds like a fun project.
Counting is going to take several learning attempts, keeping in mind the birds often cluster together.
Maybe a combination of light beam to determine presence and direction (they could go in and reverse out) and weight. Other than tiny chicks, you should be able to identify one or more birds on the weighbridge (say 100mm square) at a time.

Hmm, I had not thought about weighing them, interesting idea!

I'd have to add a small platform with that transducer. You are right about the changing directions, the young ones especially change their mind a lot but in the morning and at night they tend to be pretty focussed on getting in or out of the coop initially. The run door may have more variability.

With all I have going on right now this project will take some time to get it all going. I have to prioritize the simple door motor first and then work out the rest.

When I do eventually get to the machine learning for bird ID I would first try unsupervised learning to just distinguish one bird from another. Adding weight as an independent descriptor should really help a lot.

I think I'm sold on the Mega for the reasons mentioned. I suppose that also answers the question about the smaller Adafruit boards which means sticking with the ethernet shield an an actual Arduino Mega.