Shredding Hunger, One Donation at a Time! Together, let's carve a path towards a better, brighter future for those in need.
Introducing the phyHarvest project, a unique food drive box that encourages communities to support their local food bank by donating nonperishable items. What sets this box apart is its ability to weigh the items inside, allowing groups to challenge each other to reach specific weight goals for their donations.
Donators instantly know the weight of their box through the I2C display reading. Plus, our jolly shredding yeti adds a touch of fun by singing a song every time the weight changes.
Fun Fact: This project's old predecessor was a Turkey. Read about the here!
The food drive box remains idle for the majority of the time. However, the magic happens when a supporter places a donation inside the box.
As the item is placed into the box, the load cells and HX711 module alert the phyCORE-AM64x that the weight has changed with a voltage reading. The voltage reading is convertered to a weight (in pounds) and displayed on the i2c display. In addition, when there is a weight change of great than 2lbs a random holiday tune is played.
The voltage to weight formula being used is:
y = (229μ * x) -1987.8
Where y is equal to weight in lbs and x is equal to the voltage reading.
The phyCORE-AM64x is the embedded device controlling the program. For working with the phyCORE-AM64x 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).
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.
For the display the mounting pins should be facing towards the back of the screen. The display connects to pins 1, 9, 11 and 13 on the phyCORE-AM64x carrier board header.
For the HX711 the mounting pins should be facing the front side of the module PCB. The HX711 connects to pins 2, 4, 6 and 8 on the phyCORE-AM64x carrier board header.
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-AM64x 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-AM64x 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 20.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-AM64x-PD23.2.0
cd ~/BSP-Yocto-Ampliphy-AM64x-PD23.2.0
Download the BSP Meta Layers
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-AM64x, 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 : am64x
# Release : BSP-Yocto-Ampliphy-AM64x-PD23.2.0
# MACHINE : phyboard-electra-am64xx-2
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
Start the Build
Use the following commands to navigate to the build directory (you should have been automatically placed there when you sourced the build environment) and start the build process for the phyCORE-AM64x Linux BSP:
Host (Ubuntu)
cd $BUILDDIR
bitbake phytec-headless-image
This command instructs bitbake to run all the tasks associated with the phytec-headless-image build target, which is the default image used by PHYTEC to validate the BSP-Yocto-Ampliphy-AM64x-PD23.2.0 release.
Adding Meta LayerThis Meta Layer provides:
- Dependencies for AWS GreenGrass, however this was setup on the target.
- Systemd service to poll the weight scale, display the weight on the I2C display and sound.
1. Grab meta layer repo.
Host (Ubuntu)
cd $BUILDDIR/../sources
git clone https://github.com/phytec-labs/meta-HolidayFoodDrive.git
cd $BUILDDIR
2. Enable the layer
Host (Ubuntu)
bitbake-layers add-layer $BUILDDIR/../sources/meta-HolidayFoodDrive
3. Then simply rebuild the BSP image.
Host (Ubuntu)
MACHINE=phyboard-electra-am64xx-2 phytec-headless-image
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-electra-am64xx-2/
Host (Ubuntu)
cd $BUILDDIR/deploy/images/phyboard-electra-am64xx-2/
6. Flash the.wic.xz image to the SD card:
Host (Ubuntu)
sudo xz -dc phytec-headless-image-phyboard-electra-am64xx-2.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
8. Insert the micro-SD card into the powered off development kit.
9. The phyCORE-AM64x development kit is configured to boot from an SD Card slot by default. But it doesn't hurt to verify this!
- S10 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-AM64x development kit
- 159.3x77.9mm
- 2x M3x12mm Screws
- 2x M3 Hex Nuts
I2C Display
- 27.78x39.22x9.9mm
- 2x M2x12mm Screws
- 2x M2 Hex Nuts
HX711 Module
- 50.8x31.75mm
- 2x M2.5x12mm Screws
- 2x M2.5 Hex Nuts
Speaker
The speaker we selected lacked mounting holes or brackets. To overcome this obstacle, we cut a smaller hole in the shape of the speaker, incorporating support flaps. The idea was to secure the speaker by leveraging the squeezing pressure of these flaps. To reinforce the cardboard flaps, we added a larger rubber band, used tape, and positioned the speaker on the back of the backplate for additional support.
The speaker is connected to the development kit via USB A ports.
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 tung 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-AM64x development kit can have it's 12V power supply plugged into and you should be ready to go.
Note: The food box has a weight limit of 440 lbs.
As a bonus refer to our AWS integration guide to push weight to the cloud. We did this at our office, checkout the Graphana dashboard for a morning of donations collected at PHYTEC.
1. Create a ready to go SD card that can be flashed.
2. Create and print a 3D printed backplate
3. Include a "calibration button" that tares the weight to accommodate various sized boxes.
Comments