KUWTP Ep. 26 | 14th November 2024 | Finalising our prototype – food dispenser + website
Where’d All the Time Go? In the blink of an eye, we were in Week 13 of the academic year and T-1 day away from our presentation for this project! We have been radio silent for the past month as we were juggling our never-ending number of midterms and MnT, but still always managed to squeeze time out to dedicate to MnT. To provide a short refresher, our prototype consists of 4 main components – impedance analyser, weighing scale, food dispenser and lastly a website to link all 3 up. The first 2 components have been finalised and what was left to do was designing and 3D printing the parts for our food dispenser as we innovated our prototype from a cereal dispenser and when installing a motor onto the dispenser, we needed to 3D print parts such as a shaft to attach the motor to, as well as parts for the weighing scale. On the software side of things, we needed to finalise the code to send data wirelessly via bluetooth between our ESP32 module and mobile phone. A goal of our project was to ensure user friendliness, which is achieved here as we make it easy for pet owners to dispense the food through a tap of a button on the phone. We also needed to finalise the formula to calculate a dog’s body fat percentage and update our website code.
The day started with a bang as configuring the bluetooth connectivity between the ESP32 module and our mobile phone went smoothly, and we were able to communicate to the ESP32 module through the phone. We streamlined the user interface such that there were only 3 functions – calibrate, tare and measure. The tare function is integrated into the calibrate function, but we added a separate tare function to call as we considered that pet owners would want to put their pet’s food bowl on the scale to collect the dispensed food and thus require a taring function.
Next, we designed parts of the weighing scale on Fusion360 and sent them to print! We went through multiple iterations of the designs to ensure the screw holes we created were accurate and the dimensions of the components of our 3D printed parts for the weighing scale in the food dispenser were precise.
Lastly, we worked on the derivation for the formula to calculate dog body fat percentage using impedance values. However, before we dive into the equation for a dog, we must first understand the derivation for a human. The human body can be represented as a simple circuit with a resistor representing the effective resistance of TBW in series with a capacitor representing cell membranes, and its shape is taken to be cylindrical.
Hence, we get a rough equation to relate fat free mass (FFM) to impedance where FFM = CH²/Z, where C is a constant. To find appropriate fitting factors, the study surveyed 32 volunteers who provided their height, age, and gender. Now, we can move on to finding the formula for a dog.
Similar to the derivation for humans, dogs’ body are modelled as a cylindrical object, thus obtaining a general formulas of ρL² / Z, where ρ is the specific resistivity of extracellular or intracellular water, since total body water is the sum of extracellular or intracellular water as mentioned previously. Calculated TBW value is then converted to FFM using an hydration fraction of 0.732 for healthy animals. From the study, the obtained values of ρ are 444.8 ohm cm and 1477.8 ohm cm for extracellular and intracellular water respectively.
To test the validity of the proposed equation, we assume the impedance of Odie to be 102 ohms, that of a healthy dog. From his recent vet check-up in June, his weight is 21.5kg with a body condition score of ⅗. Using the following equation, BF = 0.84 + 8.36(BCS), the percentage obtained is 25.92%. There is only a slight difference of 0.28%, thus showing the equation is valid. The second equation is obtained from another study done in Thailand on 340 dogs where they derived the equation using a linear regression model of BCS against body fat percentage of a dog. We also tested the formula on Asta, with an assumed impedance of 102 ohms, body weight of 4.4kg and length of 36cm. The body fat percentage obtained from the equations is 24.77%, also very similar to 25.92%.
We also updated the code of our website to include more features, such as an informational section and a kibble nutrition section. See the below video for a quick demonstration on how to use our website!
Refer to the following documents for our revised code!
food dispenser – food dispenser code
weighing scale – weighing scale code
website – website code