ajb974 / Kibble-Kounter1

Apache License 2.0
1 stars 0 forks source link

Load Cell -Write Up New Part Assignment #20

Closed mlivai closed 1 year ago

ajb974 commented 1 year ago

Basic Instructions for Operation First, connect the red, black, white, and green wires of the load cell to the red, black, white, and green inputs of the HX711 load cell breakout board, as seen in Figure 1. Then, on the HX711 breakout board, connect VDD to 3.3 V, VCC to 5V, DAT to GPIO 23 on your pi, CLK to GPIO 24 on your pi, and GND to ground, as seen in Figure 2. Finally, install the HX711 library with the command “pip install hx711”, as seen in Figure 3. The schematic of the load cell can be seen in Figure 4. The schematic of the HX711 breakout board can be seen in Figure 5. Infrastructure layer functions In demo.py, the first function called is zeroScale(), after the user clears the scale of any weight. zeroScale() stores the current value returned by the HX711. Then, the user places the 100 gram test weight onto the scale, and TestScale() is called. Similar to zeroScale(), TestScale() stores the current value returned by the HX711. From here, demo.py enters a loop where readScale_grams() is repeatedly called. The relevant snippet of demo.py can be seen in Figure 6. The relevant snippet of KibbleKounter.py can be seen in Figure 7. The library used to control the HX711 breakout board can be found in (3).

Expert Usage The load cell has a 20 kg weight limit (5). Internally, the load cell contains a Wheatstone bridge, with a variable resistance that can be measured with an ADC, like the HX711 (5). Before the load cell can be use to measure weight, it must first be calibrated (5). The load cell is first zeroed, with the reading from the HX711 saved. Then, a known weight must be placed on the HX711, with the reading from the HX711 saved. Now, when the HX711 reads an unknown weight, first, the difference between the unknown and zero HX711 values are found. Then, this difference is divided by the HX711 value for the test weight. Finally, that quotient is multiplied by the test weight in grams, returning the unknown weight in grams. This process can be seen in Figure 7. The HX711 used on the breakout board is an ADC with 24 bits of precision (5). Application-specific evaluation The load cell was compared to a force sensitive resistor to determine which part is more suitable for our application. The force sensitive resistor was connected in series to a 43 kiloohm resistor, with a MCP3004 ADC used to read the values. As seen in Figure 8 and Figure 9, the MCP3004 returns a moderate value when pushed. According to Little Chompers Pet Food, a adult dog that weighs between 6-20 kg needs between 110-320 grams of food (6). As a result, a 200 gram weight was used to test the sensors, as seen in Figure 10. The resulting output of this test can be seen in Figure 11. Even when the orientation of the weights were changed, as seen in Figure 12, the ADC reading remained 0. Because the force sensitive resistor is unable to detect the change in weights, the load cell is the part more suitable for our application.