A Tropical Twist on Giving Back! Let’s bring holiday cheer to the beach and fill hearts (and bellies) this season.
Introducing the phyHarvester: crabmas edition food drive box, a playful and interactive donation box that makes giving fun and engaging. Decked out with a crabby mascot, beach vibes, and iconic pantry staples like Spam and ramen, this box doesn’t just hold food—it weighs and tracks every donation to inspire friendly challenges and goal-setting.
Each time someone adds to the box, a cheerful message and weight update appear, creating instant feedback and encouragement. Whether it’s a competition between groups or a solo mission to meet donation goals, the phyHarvester brings joy and a sense of purpose to supporting local food banks.
Fun Fact: Last year, we shredded hunger with a yeti themed box. This year, we’re making waves on the sand!
The food drive box sits idle most of the time, waiting for its moment of magic—when a supporter places a donation inside.
As soon as an item is placed in the box, load cells paired with an HX711 module detect the weight change and send a voltage reading to the phyCORE-AM62x. This reading is then converted into weight (in pounds) using a simple formula and displayed in real time on the SPI display.
To add a fun twist, whenever the weight increases (minimum 2 lbs, maximum 440 lbs), a random tune plays to celebrate the donation and encourage more contributions! There are also special tunes that play to indicate how close to the goal the weight is. Goal is set to 300lbs.
The phyCORE-AM62x is the embedded device controlling the program. For working with the phyCORE-AM62x here are some resources to get the board booted and how to work with various peripherals. Don't worry, this tutorial will walk through everything you need to know to get this system working.
That last link has lots of resources available (guide links, component placements, pin muxing, ect).
For the HX711 the mounting pins should be facing the front side of the module PCB. The HX711 connects to expansion header x17 pins 18 DT, 20 SCK, 26 GND and header x9 pin 8 VCC. Check out the table below:
The voltage-to-weight formula used is: y = (229μ * x) - 1995.8
Where:
- y = weight in pounds
- x = voltage reading
The values here were calculated from calibration example from the Arduino "HX711_ADC" library.
Optional Steps for DIY Calibration
Or you can utilize some algebra to calculate "m", m= (y2-y1)/(x2-x1)
- y2, y1 = weight in pounds of known item weight
- x2, x2 = ADC reading when known item weight is read
You can read the ADC values by running the "hx711_reading.sh" code after booting the phyCORE-AM62x development kit.
1. Boot phyCORE-AM62x development kit from SD card with HX711 and Load Cells connected.
2. Connect an ethernet cable to either ethernet port.
3. Grab the "hx711_reading.sh" file
$ wget https://www.hackster.io/code_files/664690/download
3. Enable the script to be executable
$ mv hx711_reading.sh.txt hx711_reading.sh
$ chmod +x hx711_reading.sh
$ ./hx711_reading.sh
The average ADC calculated from value0 and value1 will be x1 from item y1. Then repeat for value x2 when weighing item y2.
Load Cell Assembly1. Download and 3D print the load cell brackets designed by Indrek Luuk.
2. Wire strip and tin all the wire on each of the load cells.
Tip: It is recommended to label each load cell (A, B, C, D) to help reduce assembly confusion.
3. Solder the load cells white and black wires together into a Wheatstone bridge formation. See images below. Be sure to place heatsink tubing over each junctions to help prevent damage or shorting.
4. Cut in half, wire strip, tin and label the F/F jumper wires (E-, E+, A-, E+).
5. Measure and cut approximately 3-4ft of jumper wire for each of the load cells. There should be 4x 3-4ft wires (aka extension wires) when finished.
6. Wire stripe and tin each end of the extension wires.
7. Solder one end of each extension wire to one of the red load cell wires.
8. Then solder the F/F cables to the appropriate extension wire. See image below.
9. Connect the connector end of the F/F jumper wires to the HX711 once assembled.
On the back of the display set the mode to SPI by populating a 0Ohm 0603 SMD resistor at R2.
For the display the mounting pins should be facing towards the back of the screen. The display connects to expansion header X17 pins 4 (VDD), 6 (GND), 34 (SPI0_CS0), 38 (SPI0_CLK), 40 (SPI0_D0) on the phyCORE-AM62x carrier board. The boost converter is there to boost the 3V3 SPI0 signals to 5V0. Check out the table below:
What you’ll need
- SD Card Reader
- 4GB micro-SD Card or larger (Included in development kit)
1. Download the SD card flasher app BalenaEtcher
2. Download the prebuilt SD card image from the Code section below.
3. Now that your system is setup, use the BalenaEtcher SD card flasher to create a bootable SD card.
- Open BalenaEthcher and select “Flash from file”.
- Select the
phytec-headless-image-phyboard-lyra-am62xx-3.rootfs.wic.xz
SD card image file from your Downloads folder. - Then insert the micro-SD card into the SD card reader.
- Click on “Select Target” and select the SD card.
- Begin flashing the SD card by pressing “Flash!”
- Once BalenaEtcher is done flashing the SD card image, eject the SD card from the Host PC and insert the SD card into the development kit.
See the section “Booting from SD Card” for more information.
SW Method #2 Build the BSPThis method is for those who want to customize their system.
Tip: Watch the Cafe Yocto Video on "Build the BSP" to see how to run through this section of the guide.
PHYTEC’s Linux BSPs are built using The Yocto Project, which is a powerful tool that allows OEMs to create production ready software images for custom hardware built around the phyCORE-AM62x System on Module (SOM). Depending on the needs of your end application and the design of your system, you will require custom modifications to the Linux kernel and/or the packages included in the root filesystem. The Yocto Project is one way to manage those changes.
This section will walk through the setup and build process of the Yocto BSP in order to generate default software images for the phyCORE-AM62x development kit. Once the BSP is built, it can serve as a starting point for product development.
Requirements
The following system requirements are necessary to successfully follow this BSP Development Guide. Deviations from these requirements may or may not have other workarounds:
- Ubuntu 22.04 LTS, 64-bit Host Machine with root permission.
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
The above minimum build resources (RAM/CPUs) should result in a build time of ~3.5 hours.
Host Setup
Yocto development requires certain packages to be installed on the host machine to satisfy various dependencies. Run the following commands to ensure these are installed:
Host (Ubuntu)
sudo apt-get update
sudo apt-get install build-essential autoconf automake bison flex libssl-dev bc u-boot-tools python diffstat texinfo gawk chrpath dos2unix wget unzip socat doxygen libc6:i386 libncurses5:i386 libstdc++6:i386 libz1:i386 g++-multilib git python3-distutils
Git Setup
If you have not yet configured your git environment on the Host Machine, please execute the following commands to set your user name and email address:
Host (Ubuntu)
git config --global user.email "your@email.com"
git config --global user.name "Your Name"
git config --global http.sslcainfo /etc/ssl/certs/ca-certificates.crt
Yocto Build Steps
Firstly, dedicate a directory on your Host Machine for housing the BSP and navigate there:
Host (Ubuntu)
mkdir ~/BSP-Yocto-Ampliphy-AM62x-PD24.1.0
cd ~/BSP-Yocto-Ampliphy-AM62x-PD24.1.0
Yocto based Linux BSPs are comprised of many meta-layers, each containing recipes for fetching, building and packaging various components destined for the bootable software image you intend to build. Some meta-layers are provided by the Linux community, such as meta-python for example. Other meta-layers are more platform specific and are made available by PHYTEC or the silicon vendor (in the case of the phyCORE-AM62x, the silicon vendor is Texas Instruments). All the meta-layers required for this PHYTEC Linux BSP can be setup using the phyLinux tool:
Host (Ubuntu)
wget https://download.phytec.de/Software/Linux/Yocto/Tools/phyLinux
chmod +x phyLinux
./phyLinux init
The above will launch an interactive session that walks you through the BSP setup. Use the following guide to help you navigate through the interactive prompts:
phyLinux Interactive session:
# SoC Platform : am62x
# Release : BSP-Yocto-Ampliphy-AM64x-PD24.1.0
# MACHINE : phyboard-electra-am62xx-3
Initialize the BSP Environment
Source the build environment (a build directory and the $BUILDDIR environment variable will be automatically setup):
Host (Ubuntu)
source sources/poky/oe-init-build-env
Download the BSP Meta Layers
Navigate to your BSP's sources directory:
Host (Ubuntu)
cd $BUILDDIR/../sources
Clone this repo and branch:
Host (Ubuntu)
git clone https://github.com/phytec-labs/meta-phyharvest.git -b main
Enable the layer in your build:
Host (Ubuntu)
cd $BUILDDIR
bitbake-layers add-layer ../sources/meta-phyharvest
Build the image:
Host (Ubuntu)
bitbake phytec-headless-image
This command instructs bitbake to run all the tasks associated with the phytec-headless-image build target, which is an image used by PHYTEC to validate the BSP-Yocto-Ampliphy-AM62x-PD24.1.0 release.
Troubleshooting Tip:
Verify that the meta-example layer was built into the image by searching for the displaylbs.py in the tmp directory.
Host (Ubuntu)
find ./tmp-ampliphy-xwayland/work -name "displaylbs.py"
If nothing pops up then run this command followed but the bitbake phytec-headless-image command.
Host (Ubuntu)
bitbake demo
Flashing SD Card1. On your VM, run the following command without the SD card connected to the host machine.
Host (Ubuntu)
ls /dev/sd*
2. Connect the SD card to the Ubuntu host machine.
3. Run the following command again with the SD card connected to the host machine.
Host (Ubuntu)
ls /dev/sd*
4. Unmount the SD card from the host machine. Do not remove the card from the machine.
Host (Ubuntu)
umount /dev/sdX*
5. Navigate to the directory containing the SD card image we want to flash. This will be in the deployment directory of your local BSP build at $BUILDDIR/deploy/images/phyboard-lyra-am62xx-3/
Host (Ubuntu)
cd $BUILDDIR/deploy/images/phyboard-lyra-am62xx-3/
6. Flash the.wic.xz image to the SD card:
Host (Ubuntu)
sudo xz -dc phytec-headless-image-phyboard-lyra-am62xx-3.rootfs.wic.xz | sudo dd of=/dev/sdX bs=8192 conv=fsync
Note: Note that you have to flash the SD Card image to the entirety of the SD Card. This is done by specify the output location of the flashing command without a numbered partition specified. For example, if you try to flash the SD Card image to /dev/sda1 this will result in a improperly formatted SD Card.
7. Unmount the SD card from your Linux machine.
Host (Ubuntu)
umount /media/<user>/boot /media/<user>/root
Booting from SD Card1. Insert the micro-SD card into the powered off development kit.
2. The phyCORE-AM62x development kit is configured to boot from an SD card slot by default. But it doesn't hurt to verify this!
- S7 should be ON to override default boot settings.
- See the images below for boot switch placement and settings
Housing can vary significantly, as our team utilized readily available resources during the assembly of this project.
When using cardboard, our team recommends incorporating a sturdy surface at the bottom of the box, positioned between the load cells and the box itself. This practice helps reduce inaccuracies in weight readings that may arise from potential bowing of cardboard boxes.
Tip: If you plan to wrap your housing in wrapping paper, as we did, do so before mounting the hardware.
Making & Mounting Backplate
The backplate was crafted from a 12x18-inch single-wall piece of cardboard, firmly affixed to the interior back wall of the phyHarvest donation box. It was secured in place using four screws fastened to the donation box.
Backplate to Donation Box
- 12x18 inch
- 4x M2.5x12mm Screws
phyCORE-AM62x development kit
- 159.3x77.9mm
- 2x M3x12mm Screws
- 2x M3 Hex Nuts
SPI Display
- 98.00mm x 60.00mm
- 2x M2x12mm Screws
- 2x M2 Hex Nuts
HX711 Module
- 50.8x31.75mm
- 2x M2.5x12mm Screws
- 2x M2.5 Hex Nuts
Speaker
The speaker is connected to the development kit via audio jack port.
Mounting Load Cells & Plywood
The load cells and brackets should be loosely attached, allowing them to move when pushed. If the load cell brackets are secured too tightly to the plywood, the tongue in the load cell may bend, resulting in an inaccurate weight reading.
Ensure that the bottom side of the plywood is in direct contact with the load cells, while the top side makes contact with the cardboard. Drill holes and insert screws into the inside bottom wall of the cardboard box, securing them into the top surface of the plywood.
Plywood to Cardboard Box
- 12x18 inch
- 4x M10x30mm
The load cells should be in contact with the floor, ensuring that the tung of the load cell makes direct contact with the plywood or a hard surface. Position the load cells at each corner of the plywood at an angle. Drill holes and drive screws from the bottom side of the plywood to secure the load cells in place.
Load Cell Brackets
- 8x M2.5x12mm Screws
- 8x M2.5 Hex Nuts
Now find a spot that the phyCORE-AM62x development kit can have it's 5V USB-C power supply plugged into and you should be ready to go.
Note: The food box has a weight limit of 440 lbs.
Future Improvements1. Create and print a 3D printed backplate or enclosed housing for whole system
2. Include a "calibration button" that tares the weight to accommodate various sized boxes.
Comments