Sheep Counter with LoRa / Meshtastic

Count sheep moving through a gate and send live IN / OUT / INSIDE totals over LoRa — all the way to your phone and a Home Assistant dashboard, no WiFi needed in the field.

SenseCraftIntermediate30minOff-Grid CommunicationAI Agent ReadySource Code

Rendered scene — reCamera above a gate lane, with the count dashboard on a tablet and a Meshtastic radio in hand

reCamera 2002 HQ PoE — runs the sheep detector and the gate-line counter

Reusable Site Templates

A paddock gate with no WiFi or mobile signal, where sheep are still counted by hand.

  • Daily mustering — know how many sheep went in or out of the paddock without counting them.
  • Night watch — get a phone notification whenever sheep cross the gate after hours.
  • Remote farms — check the totals on the Home Assistant dashboard from town, without driving out.
  • Several gates — add a camera and radio node per gate; all of them report to one dashboard.

Not a fit: tagging or identifying individual animals, or a wide gate where sheep cross in a dense crowd. The count relies on each animal crossing a line in view of the camera.

How it works

Two ends joined by radio. At the gate, a reCamera counts sheep and a XIAO radio node sends each count over LoRa. At the gateway, a matching XIAO radio accessory plugged into the reComputer R1100 over USB passes the counts to Home Assistant. Only the gateway needs a local network; the gate needs power and nothing else.

Gate Camera

DeviceRole
reCamera 2002 series (HQ PoE)Runs the sheep detector and counts crossings of a virtual line
XIAO ESP32S3 + Wio-SX1262 with Meshtastic firmwareReceives counts from the camera over UART and broadcasts them over LoRa

Mount the camera beside the gate at an angle, so each sheep clearly crosses the line. The camera and the XIAO share a ground and connect TX to RX. The counter starts automatically at every boot.

How well it works

Scope: capabilities and limits of the full system on reCamera 2002 series, XIAO ESP32S3 with Wio-SX1262, and reComputer R1100.

What it does: counts sheep crossing a line at the gate in both directions and keeps IN, OUT and INSIDE totals. Totals and the latest crossing time appear on a Home Assistant dashboard with a 24-hour history, and each crossing can also notify the Meshtastic phone app.

Limits: counts are only as good as the camera's view of the line; sheep crossing in a tight bunch or out of view can be missed. Radio range varies with terrain. The counter line position and a count reset can be changed from Home Assistant.

What you get out of it

The gateway publishes plain MQTT topics that any system can read, not just Home Assistant.

TopicContentRetained
sheep/ha/inTotal IN count, integerYes
sheep/ha/outTotal OUT count, integerYes
sheep/ha/insideSheep currently inside, integerYes
sheep/ha/eventLatest crossing as JSON: direction, time, counts—

The counter line and count reset are also controlled over MQTT, which is what the dashboard buttons use. A ready-made dashboard file is included for import into Home Assistant.

How to deploy

Check the setup and its product list, then follow the deployment guide.

Hardware Sizing & Deployment Setup

Select site conditions to generate recommended bundles and guides, or let an AI assistant estimate hardware and deploy for you.

Self-service Consult & Deploy
Deployment Options

LoRa Gateway (Full System)

Full system: reCamera counter, LoRa node, gateway bridge, Home Assistant dashboard.

4 steps · ~30min

AI Camera
recamera_2002
LoRa Node
xiao_meshtastic_kit
Gateway Computer
recomputer_r11

FAQ

No. Counts leave the gate over LoRa radio. Only the gateway computer at the farmhouse needs a local network to reach Home Assistant, and none of it depends on a cloud service.

Didn't find your answer?
Contact Us
We Are Glad to Be Your Hardware Partner !
Next