17 Aug 2024, Sat

Breadboard Can Eat One Ah?

KUWTP Ep. 20 | 16th August 2024 | Attempting to connect both the HX711 and ESP8266 ESP-01 module to Arduino

Where did my summer break go? In the blink of an eye, summer has ended and on 12th August, we officially started a new semester. Time truly flies. As we slowly get used to and adjusted to our new timetables, we hope to free up more time to dedicate to doing MnT on top of our other commitments, so do pardon us if the frequency of our posts decrease! However, a week without MnT left our hearts and souls feeling too empty, so we made a trip to lab on Friday of the first week of school.

Our main agenda today was to figure out the connections between Arduino, ESP8266 ESP-01 module and HX711 module. The connection for all 3 has not been done before, however they have been individually connected to Arduino before in other projects. Firstly, we mainly referred to this project done by Ruzell Ramirez, to learn to connect an ESP8266 ESP-01 module to Arduino. An important takeaway we got was that the maximum voltage input of ESP8266-01 is 3.6V, and connecting it to the 5V supply risks destroying the module. Since our HX711 is powered at a voltage input of 5V, we will make use of a breadboard and use a voltage divider when connecting the Arduino 5V pin to the ESP8266 ESP-01 to ensure that the voltage supplied to the module is 3.6V. The HX711 pin will be connected before the voltage divider so as to be at 5V.

We studied a literature written by Sarah Santos on random nerd tutorials in connecting the HX711 to ESP8266 ESP-01. We referred to a table given in the tutorial in connecting the 2 modules together, and adapted from there to produce our very own connections shown in the figure above. We have yet to test our connections yet but will update again soon!

For our next task, it would be to print the components of our automated pet food dispenser, and tinker with our servo motor. A random update on our budget will reflect that we have merely spent a quarter of our total budget, showing our good financial control! Also, unfortunately there is no digikey haul timelapse as the items arrived earlier this week and we forgot to film our unboxing. Stay tuned for our next step in our project.

8 Aug 2024, Thu

Happy (early) Birthday Singapore.

KUWTP Ep. 19 | 8th August 2024 | Purchasing more electrical components

When in doubt, break the bank. Just kidding! Today, we stayed in hall and did not head down to the MnT lab since we have completed the hardware tasks for our project. We only started work in the afternoon since the morning was spent frantically trying to match indexes for our Interdisciplinary Collaborative Core (ICC) modules – today marks the first day of add-drop period. ICC modules are riddled with group work, thus attempting to be in the same class as our friends is imperative!

In this round’s Digikey haul, we spent a grant total of a stunning $211.10. Let us bring you through our cart! We bought 4 additional 50kg load cells for our weighing scale as we observed other groups’ load cell wires becoming damaged or separating from the load cell itself and we would like to safeguard ourself against this situation and have a replacement on hand. The load cell wires are flimsy and thin in nature, thus the frequency of such an incident happening is not low. We also bought a 5kg load cell for our weighing scale that will be incorporated into our pet food dispenser. We decided to splurge and purchase the more expensive servo motor after taking advice from a blogger who built his own pet food dispenser and recommends buying a better quality motor as the cheaper motor would be be as effective not accurate in dispensing a specific mass of food. We also bought another arduino, this time one with bluetooth and wifi connectivity so we would not need to buy an additional wifi module (ESP8266). This arduino will be use to control both the weighing scale and the motor.

Stay tuned for pet food dispenser updates!

8 Aug 2024, Thu

Bob The Builder!

KUWTP Ep. 18 | 7th August 2024 | Reinforcing our weighing scale + Brainstorming our pet food dispenser

Big Back, Big Back. According to the Urban Dictionary and our limited knowledge of Gen Alpha’s unique slangs, “Big Back” is commonly used to describe someone who eats a lot. Hence, today’s slang of the day is “Big Back” as if you scrutinise our lunch closely, you can observe how we ordered the Yew Kee Speciality Duck Rice (not sponsored but truly a bussin’ stall) and still added shaorou and charsiew respectively LOL. Now, back to our usual broadcast of MnT and no more lunch talk.

Before lunch, we lugged a second sturdier and denser wooden board from hall to SPMS (okay slight exaggeration we sat on campus rider). While testing out our weighing scale during the coding process, we noticed that our current wooden board was too soft and had started bending under the weight. This led to inaccurate and fluctuating results as the load distribution is not uniform across the load cells on the base of the board. Hence, there was a dire need to reinforce the current board. Luckily for us, we had a spare board on hand and by screwing the 2 boards together, we would easily solve our problem. Special shout out to the lab staff once again for helping us with the drilling process #justagirl and we apologise for stressing y’all out – we did not mark out where the holes should be drilled and based it simply on eye power!

After lunch, we brainstormed on the specifications of our pet food dispenser. A quick recap of our project which consists of 2 parts – a BIA scale and a pet feeder. Having completed the hardware tasks for our BIA scale, we decided to move on and get started on our pet food dispenser. As of now, we have decided to make yet another weighing scale to measure the mass of food dispensed and use a continuous servo motor to dispense food by controlling a rotating paddle. We will then hook up both the weighing scale and the motor to the arduino and program it such that an accurate mass of food will be dispensed. The mass of food to be dispensed will be determined after taking into considerations the following:

  • Resting Energy Requirement (RER)
  • lifestyle of dog (activity and neuter status)
  • current body composition of the dog (obtained using our BIA scale)

A study published by Wilson Veterinary Hospital came up with modifications to the established RER formula = (70 x mass of dog)0.75, taking into account other considerations such as activity and neuter status to obtain a more accurate total energy requirement (TER) for the dog. The amount of food dispensed will then correspond to the caloric intake specified for the dog.

6 Aug 2024, Tue

Do We Qualify For A 2nd Major in CS?

6 Aug 2024, Tue

Are You Fatter Or Is The Calibration Off?

KUWTP Ep. 16 | 19th July 2024 | Constructing our weighing scale

Weight is just a number. Thankfully, we live in the day and age where information is readily available online – a huge saviour for the construction of our weighing scale. We meticulously followed the instructions of Indrek and spent an entire day in the lab soldering wires together to build our weighing scale.

Spoiler: We actually had to tear down and re-construct the weighing scale as the first construction possessed fatal electrical connection flaws that hindered our weight measurement and did not produce correct results when we tested the voltage diagonally across the board (which is supposed to be ~2000 ohms).

Some key learning points to note during the video is identifying the 3 different wires. Each load cell consists of 3 wires coming out of it, with either a positive or negative strain between each wire (Fig. 1). Correctly verifying the centre wire is crucial as it allows us to successfully get a resistance of 2000 ohms across the board when connected in a circuit (Fig. 2). The resistance between electrical components can be easily verified using a multimeter, to which one must be cautious when measuring and ensure the multimeter is in contact with the circuit only – otherwise the resistance obtained might be that of the human body (basically don’t use your hands to press against the test leads of the multimeter).

Another point where we strayed from the video are the connections between the HX711 module to arduino. The recommended connections are as follows:

  • VCC to arduino 5V
  • GND to arduino ground
  • amplifier to arduino digital pin 4
  • clock pin to arduino digital pin 5

However, this connection lead to us getting a NaN (not a number) reading on arduino. Upon switching the VDD to be connected to arduino 5V instead, it magically worked! #slay

Doing some research, VCC is the supply voltage of the circuit, and VDD is the working voltage of the chip: where C = circuit and D = device. Both are essentially power supply terminals.

16 Jul 2024, Tue

A Successful Birth.

KUWTP Ep. 15 | 16th July 2024 | Results of our 1st 3D Print

Dude, we’re getting the band back together! In the early morning, we eagerly went to check on our 3D prints. To our delight, it came out to be a success and all 4 babies were there on the 3D printing machine basking in the glory of their success. However, this was only half the battle won – we still had to ensure that they fit our load cells! After all, we made some slight adjustments to the models and were uncertain of their fit.

Fingers crossed, we carefully tested the fit of the load cells into our holders. Alas, the load cells fit into the holders like a match made in heaven! A mega achievement for us!!

16 Jul 2024, Tue

Giving Birth To 4 Load Cell Holders

KUWTP Ep. 14 | 15th July 2024 | Our first ever 3D Print

Don’t be caught lacking. On this fine Monday, we unlocked a new achievement – 3D Printing! Unfortunately the Chemist was still caught lacking overseas hence the workload and responsibility of ensuring the success of our 3D print fell on the Biologist and Electrician. Needless to say, they did a fantastic job and currently our load cell holders are in the process of being printed. The estimated duration came out to be approximately 6 hours, finishing after the MnT lab has closed hence we would only be able to check on our prints the next day. Stay tuned to see how our 4 babies turn out ◡̈

A small hiccup faced was perhaps the fact that the dimensions of these load cell holder models we found online did not perfectly fit our load cell dimensions. For example, one model had a width of 60cm when the width of our load cell was only approximately 3.5cm. However, with some tinkering, we successfully scaled down these models in Autodesk Fusion 360 and went ahead with printing the scaled down version.

13 Jul 2024, Sat

Biology is NOT a humanities!

KUWTP Ep. 13 | 11th July 2024 | 2nd Digikey Haul

Biology is the superior science (for now). Fortunately for us, our resident Biologist is extremely accommodating and understanding, going the extra mile to do work for our MnT project while the Chemist and Electrician are enjoying themselves overseas!

As mentioned in the previous episode (apologies for the long break as we are overseas but we will be back in full force soon!), we concluded we required more components to build our weighing scale either due to insufficient components or wrong type of purchase made, and hence placed an order on our favourite website – Digikey (NOT SPONSORED). Our shopping haul finally arrived and hence another unboxing timelapse is due #justagirl #thismydigikeyhaul

Our Biologist researched on the steps involved in building our very own weighing scale and summarised her learning points neatly for us (GOAT fr)! Our next step would be back to the MnT lab armed with our newly acquired materials and MacBook in hand (to refer to the YouTube video HAHAHAHA) as we require materials in the lab to building our weighing scale such as jumper wires and the soldering tools. We will also hopefully be starting on our first 3D print – a holder for our load cell brackets!

3 Jul 2024, Wed

Work From Hall.

KUWTP Ep. 12 | 3rd July 2024 | Exploring the world of load cells

Another day, another slay. We decided to work from the comfort of hall today instead of heading down to the MnT lab since we figured we did not need any materials in the lab. Our task for the day was to figure out how to use the load cells and connect them to Arduino (a microcontroller) to obtain results. To our dismay, the load cells we purchased were 4-wire load cells and they are conventionally used singularly instead of as a set of 4, like 3-wire load cells. After scouring the internet for a few hours, we came to a conclusion to simply buy 4 more 3-wire load cells. Let us walk you through our decision making process!

Firstly, it is not impossible to connect the 4 4-wire load cells together, however it would prove to be an arduous task. A 3-wire load cell, also known as a half-bridge load cell, is very versatile and can be used singularly, doubly or as a quadruple. A 4-wire load cells already consists of a Wheatstone Bridge, and is usually used singularly, although we have seen possible circuit diagrams using a pair of 4-wire load cells in a circuit. Since using 4-wire load cells in a multi-cell weighing scale is not common, we decided to purchase 3-wire load cells instead.

Secondly, it would incur more cost for us to use 4 4-wire load cells. A load cell junction box would be required to trim the signals from the 4 load cells, and the box itself is very expensive – prices ranging in the hundreds! Furthermore, more work would be required to figure out how a load cell junction box functions too. However, with 3-wire load cells, we would be able to purchase a combinator and make our lives simpler since a combinator is only compatible with 3-wire load cells.

Lastly, and possibly the most practical reason, is the fact that building weighing scales with 4 3-wire load cells has been done before by others and we would be able to obtain more help in building our first ever weighing scale. Venturing into a less explored area and building a 4 4-wired weighing scale might be too steep a challenge for beginners like us with no experience HAHAHAHA. The image below summarises our internet search history for the day! Enjoy the screenshots from Arduino Forums and other tech websites we read to figure how to build a weighing scale!

3 Jul 2024, Wed

Can I Zap You, Please?

KUWTP Ep. 11 | 2nd July 2024 | Making sense of our results

Impedance? Simi Lai Eh!? In a nutshell, impedance (Z) is a measure of the opposition to electrical flow, with units in ohms. For DC systems, impedance and resistance (R) are the same. In AC systems, impedance is dependent on reactance (X), which in turn is affected by the frequency-dependent contributions of capacitance (C) and inductance (L). Kindly refer to Figs. 1 and 2 for a brief explanation on the relation between impedance and reactance – slides credited to Dr. Koh Teck Seng, course coordinator for our Physics Module CY1308! It should be noted that the formula changes depending on the circuit set up (Fig. 3 – image credited to Analog Devices).

Now, back to our usual broadcast after the quick physics lesson! Today, our main goal was to make sense of our results – namely validating the impedance values obtained and obtaining the Body Fat (BF) percentage from our impedance value. We first had an inkling that our impedance value obtained was not entirely accurate as the range obtained was oddly similar for everyone (Fig. 4).

Referring to an established equation developed by E. Mylott (Mylott et al., 2014) where impedance (Z) is related to Fat Free Mass (FFM) using the equation below. Fat Mass (FM) is then obtained by taking Weight-FFM, and lastly BF is obtained by taking 100(FM/W).

Z = 0.360(Height2/R) + 0.162(Height) + 0.289(Weight) – 0.134(Age) + 4.83(Gender) – 6:83
where gender is allocated as male = 1 and female = 0

Using the calibration settings provided by the default software settings, we obtained impedance values for frequency values within 30kHz and 30.2kHz. Observing that the impedance values were approximately the same, we took the average impedance value and used it to calculate BF. This calculation allowed us to confirm that the impedance value was not right as the BF calculated out for Human Toast #1 and Human Toast #4 amounted to about 40% (we might be fat but not THAT FAT! T_T). Here on, we will only discuss the results obtained for Human Toast #1 and #4 as only they currently have an accurate baseline to compare with the results obtained from our machine. The baseline for Human Toast #1 is set at 21.8% as obtained from an OMRON HBF-702T and the baseline for Human Toast #4 is set at roughly 21% as per his last NS health checkup.

After some intensive research, we had a breakthrough and referring to a paper researching the use of BIA analysis on biceps, we made some changes to the sweeping frequency range of our AD5933EBZ board. Mainly, changes to the start frequency, delta frequency, number of increments and lowered the R1 resistor value from 200kΩ to 510Ω.

Re-testing on Human Toast #1 and #4, we were able to confirm that the results obtained after this re-calibration was correct. We confirmed the truth of our data in 2 ways – matching the graph obtained to that of the one in the research paper and by calculating out the BF (Figs. 5 and 6). With this new graph, we needed to decide on a frequency value to obtain our impedance value as we could no longer take the average since the impedance values clearly differed for the frequency range between 10kHz to 100kHz. We settled on using the most common operating frequency in most research papers – 50kHz as it allows impedance measurements with the best signal-to-noise ratio (Samoni & Luis, 2019). We deem the BF values obtained as accurate based on the margin of error established for AD5933 devices, where it is stated to have a maximum absolute error of 6.5%  (Harder et al., 2016). The new BF obtained for Human Toast #1 is now 25.0% while Human Toast #4 is 20.6%.

Fig. 5 Human Toast #1


Fig. 6 Human Toast #4

As a side-quest, we also decided to calculate out the total body water (TBW) percentage using the following formula, TBW=0.732(FFM). A point to note is that TBW calculation is invalid for impedance value obtained at 50kHz as “TBW contains both intracellular water (ICW) and extracellular water (ECW), a 50kHz frequency may not account for all ICW because it may not cross cell membranes, a 100kHz frequency, so higher frequencies are preferred” (El Dimassi et al., 2024). For TBW values, it is more valid for Human Toast #4 (51.7%) than Human Toast #1 (29.1%) as his is closer to the male average of 59% while the female average is 50%.

All work no play makes Jack a dull boy. Our Biologist clearly lives by this quote religiously as after we clocked out of the MnT lab, she decided to entertain the Chemist and Electrician with the side quest of the day!

Special appreciation for Dylan/Human Toast #4 (owner of the famous ending quote in KUWTP Ep. 4) for willingly letting us tase you multiple times in the name of science! Do enjoy the below video of Human Toast #3 being toasted too ◡̈