Automated Cattle Movement Tracking with RFID and Odoo
Managing livestock efficiently requires reliable and affordable digital solutions. One effective approach is to use RFID tags combined with Odoo to automatically record cattle movements on pasture. With a Raspberry Pi, a simple RFID reader, and Odoo’s API, farmers can build a straightforward system that improves visibility and reduces manual work.
Required Hardware
- Raspberry Pi (model 3 or 4)
- RFID reader (such as MFRC522 with SPI interface)
- Odoo v16+ with REST or XML-RPC API enabled
- Optional: a second reader to detect entry and exit directions
How the System Works
Each animal carries an RFID tag. When the tag is detected by the reader, the Raspberry Pi records the UID together with a timestamp. A Python script then sends the data to Odoo via its API, where each detection is stored as a movement log. This makes it possible to track when and how often animals enter or leave a monitored area.
A simplified Python example:
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
import requests
from datetime import datetime
reader = SimpleMFRC522()
ODOO_URL = "http://your-odoo-server.com/api/rfid_log"
AUTH_TOKEN = "your_api_token"
try:
while True:
print("Waiting for tag...")
id, text = reader.read()
print(f"Detected: {id} - {text}")
data = {
"rfid_uid": str(id),
"timestamp": datetime.utcnow().isoformat(),
"event_type": "entry" # or "exit" depending on reader position
}
headers = {
"Authorization": f"Bearer {AUTH_TOKEN}",
"Content-Type": "application/json"
}
response = requests.post(ODOO_URL, json=data, headers=headers)
print(f"Odoo response: {response.status_code}")
finally:
GPIO.cleanup()
Pin Mapping Raspberry Pi to MFRC522
- Pin 1 (3.3V) → VCC
- Pin 6 (GND) → GND
- Pin 24 (GPIO8) → SDA (SS)
- Pin 23 (GPIO11) → SCK
- Pin 19 (GPIO10) → MOSI
- Pin 21 (GPIO9) → MISO
- Pin 22 (GPIO25) → RST
Security and Recommendations
For accurate direction detection, it is best to install two readers at gate points. A stable power supply and reliable Wi-Fi connection are also essential. On the Odoo side, a custom model such as rfid.log should be created to store and display movement records. This setup can be expanded with dashboards and notifications for real-time monitoring.
Conclusion
By combining simple RFID hardware with Odoo’s flexibility, farmers gain a practical tool for monitoring cattle movements automatically. This not only saves time but also enables better data-driven decisions in smart farming operations.
Keywords
RFID cattle tracking, automated livestock monitoring, Odoo integration, Raspberry Pi RFID project, smart farming solution, pasture management with IoT, cattle movement detection, agricultural automation system, livestock data logging

