Madelyn T
Published © MIT

Crabmas in the Sand: A Techy Food Donation Box

A food drive box that weighs donations, tracks progress, and inspires people to give back—one item at a time.

IntermediateFull instructions provided12 hours54
Crabmas in the Sand: A Techy Food Donation Box

Things used in this project

Hardware components

PHYTEC phyCORE-AM62x
Board will come with Ethernet cable, serial to USB cable, micro SD card, 12V power supply and SD card reader. All of those will be needed. Here is a QuickStart guide: https://docs.phytec.com/projects/yocto-phycore-am62x/en/bsp-yocto-ampliphy-am62x-pd24.1.0/quickstart/index.html
×1
4pcs 50kg Load Cells w/HX711 Amplifier AD Module
Comes with 4x load cells therefore only 1x kit needed.
×1
Audio Jack Speaker
I used, iSymphony TSPKR1W Portable Mini Speaker. This is just what I had on hand.
×1
SPI LCD NHD-0420D3Z-NSW-BBW-V3
Datasheet: https://newhavendisplay.com/content/specs/NHD-0420D3Z-NSW-BBW-V3.pdf
×1
Texas Instruments TXS0104E Voltage Level Shifter
Used to boost SPI signals from X17 connector from 3V3 to 5V0 for LCD. Datasheet: https://www.ti.com/lit/ds/symlink/txs0104e.pdf?ts=1732637040751&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FTXS0104E
×1
Large Cardboard Box
Project uses a 3 layer corrugated 5x4x2 foot box.
×1
22 awg Wire
These are to extend the load cell wires around the housing. About 3ft will be needed. 4x Different colored wires would be helpful but not necessary.
×1
Screws & Nuts (Optional)
phyCORE-AM62x Connection: M3x12mm Screws(4), M3 Hex Nut(4) HX711 module Connection: M2.5x6mm Screw(2), M2.5 Hex Nut(2) SPI Display Connection: M2.5x6mm Screw(4), M2.5 Hex Nut(4) Backplate Connection: M2.5x12mm Screws(4) Load Cell Brackets Connection: M2.5x12mm Screws(8), M2.5 Hex Nuts(8) Plywood to Cardboard Box Connection: M10x30mm(4)
×1
Plywood (Optional)
12 x 18 inch to add stability to bottom of cardboard box housing
×1
2.0mm M/F Jumper Wires
20x M/F (2/2.54mm), 3x F/F (2.54mm) Optional if you prefer direct soldering wires.
×1
Heat Shrinkable Tubing
For 22AWG Wires
×1

Software apps and online services

Github Account
Linux Machine or VM
Used for building BSP and flashing SD card. Recommend: Ubuntu 22.04 LTS, 64-bit Host Machine If using a virtual machine, VMWare Workstation, VMWare Player, and VirtualBox are all viable solutions. At least 100GB disk space free At least 8GB of RAM At least 4x processing cores available to the Host Machine Active Internet connection

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering
Drill / Driver, Cordless
Drill / Driver, Cordless
3D Printer (generic)
3D Printer (generic)
1.75mm PLA Filament
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires

Story

Read more

Custom parts and enclosures

patrick3345's Load Cell Brackets

These are needed to secure the load cells to the bottom of the food drive box.

Schematics

phyCORE-AM62x X17 & X9 Schematic

This might be helpful for pin placement or making slight adjustments on the phyCORR-AM62x carrier board. If you want the full carrier board schematic please contact PHYTEC support. https://support.phytec.com/

Code

hx711_reading.sh

Plain text
Help DIY calibrate your load cell scales to calculate voltage to lbs equation.
#!/bin/bash

# Function to calculate the average of an array
calculate_average() {
    local sum=0
    local count=0

    for value in "${@}"; do
        ((sum += value))
        ((count++))
    done

    if ((count > 0)); then
        echo $((sum / count))
    else
        echo 0
    fi
}

# Main loop
values=()
duration=60  # 1 minute
interval=3    # 3 seconds
end_time=$((SECONDS + duration))

while ((SECONDS < end_time)); do
    # Read values
    value0=$(cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw)
    value1=$(cat /sys/bus/iio/devices/iio:device0/in_voltage1_raw)

    # Print current values
    echo "Voltage 0: $value0, Voltage 1: $value1"

    # Store values in the array
    values+=("$value0" "$value1")

    # Sleep for the specified interval
    sleep $interval
done

# Calculate and print the average value
average=$(calculate_average "${values[@]}")
echo "Average value after $duration seconds: $average"

Pre-Built SD Card Image with Demo

Plain text
This image has all the changes needed for the demo to start automatically on the phyCORE-AM62x development kit. Follow the instructions for SW Method #1 for this file.
No preview (download only).

Meta-phyharvest Repo

This is the repo that contains the meta-layer for the crabmas demo. This is meant to be used with instructions following SW Method #2. This method is great for those who would like to customize the code for their system.

Credits

Madelyn T
7 projects • 8 followers
Thanks to John M. .

Comments