dairy barn

How can I choose a sensor to detect if there are cows inside a barn? (that´s not the barn in question. It´s just for having an idea of the problem).

We were told to install an active RFID system, but they are very expensive. the first idea was to install PIR sensors along the barn, but We think the sensor wouldn´t work properly, because the environment conditions( sun rays, fans inside) and the cows remain stopped. Is there another sensor or a smart way of detecting cows with all that problems involved?

A very similar question comes up all the time on this forum, but for detecting people in a room.

So far, no one has reported a successful solution.

How about a laser & detector?
Point one down each pathway where you expect cows to be, with a light detector on the far end.
If the beam is blocked, cows or something are there.

There was another Thread about cows in a barn (for milking) in the last week or two. But I think that involved RFID tags to identify the animals. It may be useful to search for it. I contributed to it so it may help to include my name in the Google search.

...R

CrossRoads:
How about a laser & detector?
Point one down each pathway where you expect cows to be, with a light detector on the far end.
If the beam is blocked, cows or something are there.

Tomorrow I will be receiving a laser module and a receiver module. I intend doing it first. The second idea is using laser in a gate to work as a paw counter.

Robin2:
There was another Thread about cows in a barn (for milking) in the last week or two. But I think that involved RFID tags to identify the animals. It may be useful to search for it. I contributed to it so it may help to include my name in the Google search.

...R

I found your post! I am reading it!

Rafaelmec2013:
I found your post! I am reading it!

I can't recall that I contributed much to that Thread - I just thought the overall thing would be of interest.

...R

I don't know the details of your situation, or how the cows enter and leave the barn. But if you used some RF transceivers, say 415 Mhz., you could build a little transceiver for each cow, for I would guess (because of scale) you could make 'em for under $5/cow. Their range, line of sight, is probably 100 ft. Solar cell charging would avoid battery changes.

Now my idea is that each cow has one of the units, and each unit listens for a call, addressed to it's unique node. When it gets the call, it transmits an ACK, and the central unit, located somewhere in good line of sight to the whole barn, now logs that cow as present, and quits calling for it. The central unit can step through all the nodes expected, retiring those that are found, then repeating the calls for those that aren't.

I use a lot of RFM22B's and so I ginned up a ready-made Nano+RFM22B board, which costs me less then $5 per, in small quantities. The Radiohead library for these radios is excellent, and their reliability across the extent of my home is excellent.

Keeping a solar cell and a battery hung on a cow's ear seems like it's destined for failure. RFID is self-powered so it doesn't need the cell or the battery.

I don't know why PIR wouldn't work. If the cows were absolutely motionless they might not show up but they do have to breathe, don't they?

Rafaelmec2013:
How can I choose a sensor to detect if there are cows inside a barn?

You need to specify more exactly what you want to detect.
The words I have quoted could be interpreted to mean "is there at least one cow in the barn" or the inverse of "is the barn empty"?

Do you want to know how many cows are in a barn?

Do you want to know if there is a cow in a specific stall?

Do you want to know if a specific cow is in the barn?

I would not expect electonics attached to a cow to remain attached after the first time the cow bumps into the next cow.

...R

jremington:
A very similar question comes up all the time on this forum, but for detecting people in a room.

So far, no one has reported a successful solution.

on of may favorite to read answers to 'how do I measure" is to put a load cell and weigh the thing.

the quality of completness of the question helps to reveal the answer.

Are you looking to see if there is one cow in the barn ?

an rfid or some technology like the SensorMatic can detect things near the sensor. the SensorMatic is found at the entrance of many stores.

an RFID in each stall would offer other benefits, but could not allow for a cow just walking down the isle.

putting a laser on the isle would not detect a cow in a stall.

simple motion sensors might be an easy way to get broad area coverage.

the present work is about a system to relieve dairy cows heat stress. Water is sprinkled over the cows back and after that, fans pump air to provide evaporation. That happens in intervals, according to environment temperature. If we know when to turn the system on and off, we prevent the equipment working when there is no need.

Robin2:
You need to specify more exactly what you want to detect.
The words I have quoted could be interpreted to mean "is there at least one cow in the barn" or the inverse of "is the barn empty"?

Do you want to know how many cows are in a barn?

Yes. that should be important because we don´t need the equipments turned on while few cows are in the barn (few I mean 10% of total). the barn can admit 120 cows and that number varies according to day hour.

Do you want to know if there is a cow in a specific stall?

Yes, that way we can manage water usage only when a minimum numbers of cows are present. That avoids wasting water and some diseases related to wet ambients like mastitis. it saves money too.

Do you want to know if a specific cow is in the barn?

No, it´s not important.

I would not expect electonics attached to a cow to remain attached after the first time the cow bumps into the next cow.

...R

dave-in-nj:
the quality of completness of the question helps to reveal the answer.

Are you looking to see if there is one cow in the barn ?

an rfid or some technology like the SensorMatic can detect things near the sensor. the SensorMatic is found at the entrance of many stores.

an RFID in each stall would offer other benefits, but could not allow for a cow just walking down the isle.

putting a laser on the isle would not detect a cow in a stall.

simple motion sensors might be an easy way to get broad area coverage.

there is no need to see if there is one cow in the barn.

I suspect PIR motion sensor would activate by breeze due to suddenly changes in radiation. the barn has no wals. but It just a thought. I didn´t test it.

Maybe detect them another way.

https://www.parallax.com/product/605-00008

justone:
Maybe detect them another way.

https://www.parallax.com/product/605-00008

It sounds interesting. I will read the datasheet

Rafaelmec2013:
there is no need to see if there is one cow in the barn.

That is a very uninformative answer - in the context of this project it could imply several things.

Did you read my questions in Reply #9 ?

...R

If it is the barn, there are only a few entrances and exits.

I'd put lasers there and count them as they enter or exit...

There are lots of examples of using a camera, computer, and OpenCV to detect differences within images. That would set you back about $50 if you use a Raspberry Pi to do it.

Robin2:
That is a very uninformative answer - in the context of this project it could imply several things.

Did you read my questions in Reply #9 ?

...R

I did Robin. I tried to answer reply #9 inside your quote in reply#12. I will paste here below:

Do you want to know how many cows are in a barn?

Yes. that should be important because we don´t need the equipments turned on while few cows are in the barn (few I mean 10% of total). the barn can admit 120 cows and that number varies according to day hour.

Do you want to know if there is a cow in a specific stall?

Yes, that way we can manage water usage only when a minimum numbers of cows are present. That avoids wasting water and some diseases related to wet ambients like mastitis. it saves money too.

Do you want to know if a specific cow is in the barn?

No, it´s not important.