-
Get the code
- Clone this repository.
- Open the Arduino IDE and load portable_rfid_and_scale.ino.
-
Choose your LCD variant There are two hardware variants:
- One uses the LiquidCrystal_I2C library (I²C display).
- The other uses the LiquidCrystal library (parallel display). In the code, set:
- USE_I2C = 1 for I²C displays (with LiquidCrystal_I2C)
- USE_I2C = 0 for parallel displays (with LiquidCrystal) If the screen stays blank or shows garbage, flip the value and try again.
-
Match your RFID reader output Our systems use two RFID reader types:
- Raspberry-based systems return the last 10 digits of the tag.
- Arduino/Ecohab systems return the first 10 digits. In the code, set:
- LAST_10 = 1 if your reader returns the last 10 digits.
- LAST_10 = 0 if it returns the first 10 digits. After uploading, scan a tag and confirm the value shown matches what your system reports.
-
(Optional) Show animal names instead of numeric tags If you prefer names rather than 10-digit codes, edit the dictionaries/arrays:
- tags_array and subjects_array Map each tag ID to the corresponding animal name so the display shows the name.
-
Install required libraries Open Library Manager (Arduino IDE → Sketch → Include Library → Manage Libraries…) and install:
- HX711 by Rob Tillaart, version 0.6.0 Note: newer versions are not supported—pin it to 0.6.0.
- LiquidCrystal
- LiquidCrystal_I2C After installing, click Verify (✓) to make sure the code compiles.
-
Select board and port
- Connect the device via USB.
- Go to Tools → Board → Arduino AVR Boards → Arduino Mega or Mega 2560. If “Arduino Mega or Mega 2560” doesn’t appear, open Tools → Board → Boards Manager… and install Arduino AVR Boards.
- Go to Tools → Port and select the correct serial port.
-
Build and upload
- Click Verify (✓). If compilation fails due to missing libraries, install/fix them as above.
- Click Upload (→) to flash the device.
- Blank or garbled LCD → Toggle USE_I2C (0 ↔ 1) and re-upload.
- Tag value doesn’t match your system → Toggle LAST_10 (0 ↔ 1) and re-test with a known tag.
- “HX711” version errors → Ensure the library is exactly 0.6.0 in Library Manager.
- Board not listed → Install Arduino AVR Boards via Boards Manager.
- Wrong port → Unplug/re-plug the USB cable and reselect Tools → Port.
That’s it—once configured, the device should display either the 10-digit tag or the mapped animal name when you scan a tag.