Project Journal for Matt Dailey

=============== Week 15: =================

Summary: -----------------------------------------------------------------

Hours this week: 30.25 hours
Cumulative Semester Hours: 154 hours
Description of this week:

This week we had a final sprint for the finalization of all of hydrawise. Everything that could've went wrong went wrong, but somehow it all still worked.

Entry 5: -----------------------------------------------------------------

Date: April 25
Start Time: 8 AM
Duration: 10 hours

FINAL COUNTDOWN

Entry 4: -----------------------------------------------------------------

Date: April 24
Start Time: 11:30 AM
Duration: 9 hours

Today was a long day, to start I was in the ece shop non stop trying to solder on my power components on the final board. After using the solder paste from the lab and bringing it up to the shop, the chip kept on falling off after the oven, finally on the third try i used the paste they had in the shop, to see if it would work better. and it worked, however the micro got cooked. so probably shouldnt have put it in the oven...
went back to lab and worked with xiang to pull off the previous chip with the hot air gun and a heating pad. after we got the chip off we were able to get a new one on and start flashing code. After

Entry 3: -----------------------------------------------------------------

Date: April 22
Start Time: 11:30 AM
Duration: 3 hours

Today I got into lab to work with xiang on how we can attack the bluetooth issue, i came in because nobody else was available.
I discussed with him the issues we were having, that on the dev board it was working fine, and on the real product there was nothing being discovered, we discussed that it wasn't anything hardware related, because the microcontroller works other than the bluetooth. and he also thought that there could have been interference with the flashing pins, but then he took it back.
I found a technical reference manual online: https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf
From this i found out there are some registers that whether enabled or disabled could be effecting the bluetooth. So i sent the info to the team and then started soldering on the final board the power network.
I added an led and soldered the buttons better, and then soldered on the regulator so that they could test it when they get into lab. I finished there to ensure it works properly before continuing. I am confident it will work so im prepared to continue on. The next steps from here are going to be that we're all going to meet tomorrow in lab to finish up the bluetooth and everything else, then crossing our fingers the issues are minimal to that point.
Here is an updated picture of the final pcb:

Update: voltage regulator didn't work :( I think it is a solder issue because the chip is not drawing any current, and the output node is reading 0V. asked the team to ask a ta to solder it because i had to leave lab. I tried re-soldering it twice and had no luck. I think i ran out of all my soldering luck that was used up from the first multiple times i soldered that chip on.


Entry 2: -----------------------------------------------------------------

Date: April 21
Start Time: 10:30 PM
Duration: 2.25 hours

Today I finished up the conductivity breakout board. Nothing went wrong since i realized my mistakes from the last attempt. Looked over the notes of what the board is supposed to look like and I just followed. The following are the schematic, screenshots of the drawing of the board, and then what the final board looked like. Next thing to move to will be to get the rest of the components on the final pcb, which I will be doing later tonight hopefully. After that and when the bluetooth gets working, we should have everything assembled and integrated. note about bluetooth: talked to shivam and jonathon in lab and they said to reach out to xiang because he had an idea of what was wrong. i relayed the message to the group to make sure we're all on the same page.

Hand Drawings of what the board needs to look like:


Schematic of what the board is doing:


Final breakout pcb (thanks jonathon for the help):



Entry 1: -----------------------------------------------------------------

Date: April 19
Start Time: 1 PM
Duration: 6 hours

Today I was going to finish up the soldering for the conductivity sensor, then halfway through I realized that I messed it all up and i couldn't use my capacitor configuration to create 1.5n because there wouldn't be enough holes for the op amp chip to fit in. I started desoldering the capacitors and during I believe I pulled a pad off of the pcb, and ruining that row. I emailed jonathon to get an extra board. I'm not too worried as i ofund a 1.5nf as soon as i looked again, because i didnt' think to convert 1500 pf to nf. going to get a new board and solder it all real quick so shouldn't be a big holdup.
current state of project is getting bluetooth working which is software and then this sensor so that it can all go together on baord.
Here is the board i was soldering:


I am not going to move to the user manual and finish it up and submit it.
Update - got another board from shivam to redo the soldering, and I also submitted the user manual.


=============== Week 14: =================

Summary: -----------------------------------------------------------------

Hours this week: 5 hours
Cumulative Semester Hours: 123.75 hours
Description of this week:

This week worked on fly-wiring of the conductivity. Didn't work full 8 hours because I had my third rounds of midterms for other classes

Entry 2: -----------------------------------------------------------------

Date: April 18
Start Time: 4 PM
Duration: 3 hours

Today I was soldering the conductivity circuit that jonathon gave us, first I looked over the diagram and tried to understand what all was happening. I then moved to collecting the parts. I was able to find anything except for the 1.5nF cap, which i said i would just use 3 1nf capacitors and then make 1.5n with the configuration of 2 in series and then those in parallel to the other. I started the soldering but had to leave before i could finish, will come back tomorrow to finish.

Entry 1: -----------------------------------------------------------------

Date: April 16
Start Time: 12 PM
Duration: 2 hours

Today we had our last man-lab. I caught up with the group and they were still debugging the bluetooth, althought they got the i2c to work.
I moved to the prototype casing with areej and discussed a couple things that we should do. Finally I began to research if we can match the footprint on the board for the switch to One that is on the market, or if we will just have to short the switch. As the footprint provided on the switch that we bought was incorrect.

=============== Week 13: =================

Summary: -----------------------------------------------------------------

Hours this week: 11 hours
Cumulative Semester Hours: 118.75 hours
Description of this week:

This week I assembled and tested the microcontroller piece by piece. So far we have gotten 2 check offs, so I am optimistic.

Entry 3: -----------------------------------------------------------------

Date: April 11
Start Time: 11 AM
Duration: 4 hours

This session I broke out a new pcb and started soldering again since the other one got ruined. I started with teh buck boost converter. After we confirmed it I added in the battery connector port and the usbc receptacle. AFter this I went on tothe microcontroller, because today herb was going to move to try and flash it in order to get another checkoff. I soldered it together, and then I soldered on the reset buttons and surrounding circuitry along with a testing led to see when he does flash it so we can confirm it works.
AFter i finished the soldering herb was having issues trying to get the usb to uart bridge to work, so I helped him debug for a little bit, with not much success. We were confused what changed as to why it wasn't working anymore. after we get the micro flashed we can move to the analog part of the assembly.

Entry 2: -----------------------------------------------------------------

Date: April 10
Start Time: 3 PM
Duration: 5 hours

This session I worked on soldering most of the time, which was extremely tedious because our chips are so small.
After soldering the small chips on, we tested our buck boost, but it wasn't being consistent, so we tested different points and found that there was a short somewhere. I thought the issue may have been that the coulomb counter was shorting somewhere because the circuitry around the chip was not installed yet, so I tore off the coulomb counter and messed up the board. After we were still getting the issue, so pulling off the cooulomb counter was meaningless. Shivam came over and we troubleshooted with him and found that when our switch was closed and we power cycled we would have the issue. but when we opened and re closed the switch the buck boost would ouput correcfly. after realizing this we found that the issue was probably to do with some residual capacitance coming from the power supply because the battery also worked fine with this. My next steps are to rebuild the pcb and add in the microcontroller to start flashing it with code.

image:



Entry 1: -----------------------------------------------------------------

Date: April 9
Start Time: 12 PM
Duration: 2 hours

Lab Session
During this session we went over the gameplan to continue to debug and figure out the assembly and the integration of the rest of the components for HydraWise. In this session me and herb had to debug why the dac was not working properly, even though nothing had changed from past implementations. After ensuring the filters are correctly rated, we looked into the dac code and tested the scope around to see what the value is at different points. Also, Herb was programming it in to adjust the amplitude to .4 Vpp in the code, but I told him to change that as it could be causing. We had planned to use the potentiometer to set hte voltage we want. so to try and avoid mistakes on the progamming side I told him to let it go at 3.3V.
Next, the issue we came across was that the wave was clipping, we couldn't find out why this was occuring but after looking at the datasheet of the sensor and the report of a past use by students, we concluded that it would probably be okay as long as the wave was still not a constant voltage, as the company explains that a constant voltage can mess up the signal reading. We tested again and got certain outputs that correlate to what we expect so I think it should work.
I plan to create our own lookup table, so by basing different outputs off what we are inputting, we should be able to do it.

=============== Week 12: =================

Summary: -----------------------------------------------------------------

Hours this week: 8 hours
Cumulative Semester Hours: 107.75 hours
Description of this week:

This week I helped troubleshoot the dac and adjust the filters, and then also began the process to solder the pcb. I already pulled a pad off one of our boards so going to use that as a tester.

Entry 2: -----------------------------------------------------------------

Date: April 4
Start Time: 3 PM
Duration: 5 hours

During this session I received the pcb in stock and practiced soldering. I used an old PCB that I had in order to recall how to solder correctly and prepare for the final project. After messing with this for a couple hours I went onto the actual board, and I tried to install the buck boost converter, and I pulled a pad off the board. So this board I will still use to practice as a couple of our chips are extremely small and going to be hard to solder, as seen in the pictures below:

With this board I went around and soldered all the pads, and the next steps will be to drop the resistors and caps and resolder the pads that have the solder on them already. I need to sort out the parts to buy and the ones in the lab to make it easy and quick to solder.
That will be the next steps on sunday.

Also in this session I went through our list of parts and submitted the order form for the reamining parts. I ensured it was the same parts that were on the footprints for the pcb so that they would fit on the pcb correctly. I submitted the form to the procurement. See below:



Entry 1: -----------------------------------------------------------------

Date: April 2
Start Time: 12 PM
Duration: 3 hours

During this session I worked with herb on the dac. He did the software and I worked on the hardware portion, specifically figuring out what the amplitude needs to be and what the frequency. When he got the cosine wave to generate (which is fine for our case) it was not working with the filters that we had used with the arduino, after looking at the filters and confirming it wasn't a hardware problem I told him to look at the code to make sure there wasn't anything wrong on that end. We found that the freq was at 1k hz, which is not what the filters are rated for, which makes sense why they weren't able to correctly work. We lowered the frequency down to 150 hz, as the sensor wants between 100-300 hz, so I picked 150 hz. After this, I ajdusted the values of the capacitor that we had as it was rated a little too high for our case. I used a 1uF cap with a 1k ohm resistor to get rid of the dc bias. How this works is that the -3db is just under 100hz, which means that the filter will respond for everything under 100hz, but then over 100 hz, it won't be able to contain and that gets "sent through." In order to get these values we used the digikey online calculator, https://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-low-pass-and-high-pass-filter.
Here is a screenshot of the website with values:


Resulting wave from the microcontroller:

*note* this screenshot was taken before the low pass filter was installed, so the wave will be smoothed more in final implementation.

=============== Week 11: =================

Summary: -----------------------------------------------------------------

Hours this week: 5 hours
Cumulative Semester Hours: 99.75 hours
Description of this week:

This week I worked on the iterations for the pcb, with direction from professor.
Couldn't contribute this week much, as I had a death in the family. Last few weeks have been rough for school.

Entry 1: -----------------------------------------------------------------

Date: March 26th
Start Time: 8:30 AM
Duration: 5 hours

- Looked at the notes from professor
- main things were:
trace widths
layout of the chips
adding in another LED for debug
ensuring correlation from schematic and layout

This session I updated our pcb from the professors comments. He gave us a lot to look over, which most was a quick edit or change, I had to remove the power input from the programming chip as we wanted to make sure there wasnt going to be an issue where the chip would give power to the micro that wasn't the same as the micro was getting from the battery. This could've been an issue that could've caused our chip to burnout, so I made the decision to get rid of that line, and just have the programming chip send the data to the micro when we're in programming mode. On top of this, professor asked about why our chip layout was different than the schematic that's on the datasheet. This is because of the tiwebench design that was given to us. See picture below. Also, I had to ensure that our switch location was in the right spot, and that the switch was actually going to stop power, so I added another net after the switch to make sure that the switch is in series with everything. Finally, professor told us to increase our trace widths, but after a researching, I found that we would be able to get away with .254mm traces because we aren't drawing that much current. See picture below.





=============== Week 10: =================

Summary: -----------------------------------------------------------------

Hours this week: 6 hours
Cumulative Semester Hours: 94.75 hours
Description of this week:

This week I worked on the iterations for the pcb based on what the TA's told us to do. Wasn't able to finish as did not hear back from them after Monday.


Entry 1: -----------------------------------------------------------------

Date: March 17th
Start Time: 11:30 AM
Duration: 6 hours

This week I looked over what the TA's have given as feedback and kept iterating. I redid a lot of the PCB to make the layout simplified.
I'm hoping this week doesn't take into account for the grade because I did not write in the moment.

=============== Week 9: =================

Summary: -----------------------------------------------------------------

Hours this week: 3 hours
Cumulative Semester Hours: 88.75 hours
Description of this week:

This week I started the iterations for the pcb layout, and also explained to the other team members how to make updates. I did this because I was not able to for the majority of the week.
I was not able to work much this week as I had 3 exams on Wednesday, Thursday, and Friday.

Entry 1: -----------------------------------------------------------------

Date: March 12th
Start Time: 12:30 PM
Duration: 3 hours

Lab session
Got a list of edits from shivam, started to update the pcb for that.
List of edits:
1. Remove acute angles (Pin 25 on microcontroller, pin 10 of the regulator).
2. Put big via under the microcontroller pad.
3. Put battery connector on schematic.
4. Isolate Analog power by using Ferrite Bead.
5. Figure out the software - App/Website.
6. Have a ground plane on the back side of the microcontroller to dissipate heat.
7. Make sure you prototype with Bluetooth.

=============== Week 8: =================

Summary: -----------------------------------------------------------------

Hours this week: 17 hours
Cumulative Semester Hours: 85.75 hours
Description of this week:

This week I completed everything to do with the pcb layout, as this is also our presentation week. I finished up the board layout so that it is ready for review/order.

Entry 3: -----------------------------------------------------------------

Date: March 5th
Start Time: 2:15 PM
Duration: 12 hours

- pcb layout
- mounting holes, using 4
- power, ground planes, for boot and reset circuits? seems like that’s all they need
- coulomb counter lowered trace length because page 6 of datasheet says only takes 93 uA typical
- jlcpcb says .2mm is within their limits too
- https://jlcpcb.com/help/article/BGA-Design-Guidelines---PCB-Layout-Recommendations-for-BGA-packages
- noise: taking a constant time average

In this session, I worked on refining the PCB layout, ensuring proper placement of mounting holes and incorporating power and ground planes to support the boot and reset circuits. For the coulomb counter, I minimized the trace length since the datasheet indicates it typically consumes only 93 µA, ensuring low-power operation and reducing unnecessary resistance. Additionally, I confirmed that JLCPCB's manufacturing limits allow for 0.2mm trace width, keeping the design within feasible fabrication constraints. I also considered noise reduction by taking a constant time average, which helps smooth out the noise. After finalizing these details, I completed the board layout, verifying that all footprints, routing, and component placements were correctly aligned with the schematic. This session emphasized the importance of balancing component placement, trace optimization, and manufacturability. My next steps will involve reviewing the design for potential improvements before sending it for fabrication.
Screenshots:




Completed Board ^

Entry 2: -----------------------------------------------------------------

Date: March 4th
Start Time: 7 PM
Duration: 2 hours

In this session, I focused on assigning footprints for all the components in my schematic. This required going to vendor websites to download the appropriate footprint files and organizing them into a dedicated folder for easy access. Ensuring each component had the correct footprint was crucial to avoid errors during PCB layout. Once the footprints were assigned, I was able to start working on the PCB layout, positioning components to optimize space and routing efficiency. This step is essential for ensuring a compact and functional board design. This process reinforced the importance of proper footprint management in PCB design. My next step is to refine the component placement and begin routing the traces.

Entry 1: -----------------------------------------------------------------

Date: March 3rd
Start Time: 5 PM
Duration: 3 hours

In this session, I worked on finalizing the schematic for our buck-boost regulator, ensuring it correctly outputs 3.3V. This required carefully reviewing the design and assigning the correct component values to achieve stable voltage regulation. I also focused on the coulomb counter and the battery charging IC, verifying their circuit connections and selecting appropriate components. These elements are essential for monitoring energy consumption and managing the 3.7V LiPo battery effectively. This session helped reinforce my understanding of power regulation and circuit design. My next steps will be to validate the schematic through simulation before proceeding to PCB layout.

=============== Week 7: =================

Summary: -----------------------------------------------------------------

Hours this week: 18.5 hours
Cumulative Semester Hours: 68.75 hours
Description of this week:

This week, got the conductivity sensor to output meaningful data, and schematic is all but complete, needing the programming connector, after we decided to move away from using the usbc. Show me a thing this week was the schematic, and the conducivity sensor circuit.

Entry 6: -----------------------------------------------------------------

Date: Feb 27th
Start Time: 2 PM
Duration: 1.5 hours

kicad schematic
added in circuitry for the conductivity sensor we made yesterday, and also added in headers for the heart rate sensor, this simplified and will make the pcb smaller as both of these things will be off board, and will just connect at a certain location. I still need to add the programming circuitry, we are going to use a connector that you will hook up the programming chip to when the micro is in programming mode. that will be the next steps, but handing off to herb or neff because they need to find out what pins on the micro it connects to.
For now, here is generally what the schem looks like:

Here is the updated conductivity sensor heriarchy page:

I'm gone for the weekend so i will be on standby, but told them i would help. I am going to ask for them to ensure all the pins are correctly located and to add the headers for the programming chip for the pcb.


Entry 5: -----------------------------------------------------------------

Date: Feb 26th
Start Time: 4 PM
Duration: 4 hours

  • got the arduino with the dac
  • setup the dac, 150 hz so calculated a low pass filter to smooth and a high pass to get rid of dc
  • set up cond circuit using the lm324 using page 19 on this pdf: https://www.diva-portal.org/smash/get/diva2:1436882/FULLTEXT01.pdf
  • used the following pinout as a reference to match and build the circuit correctly
  • after circuit was built, tested it. here is what the breadboard looked like:
  • sent a waveform through, ensured that the filters were working, used a potentiometer to lower it to .5Vpp
  • output of the sensor, read by ad2 waveforms:
  • based on the pdf, data that we were outputting correlated with what they got:

  • Today got the new arduino out and set up the sine wave. I explained how it works to herb and neff so that they had the understanding, as i was going out of town this weekend. I told them how each part works, we also made the decision to simplify the circuit that was in the pdf, and see if it outputs something similar. based on the pictures above, the data is correlating to what they had, in terms of the shape of the wave. Based on this, I would say that it is okay to use this circuitry, as the sensor will also not be running nonstop, only on user input. As for the noise, we can do a rolling time average, and since we want a general threshold to tell the user they need to change hydration, the average will be ample enough to get an idea of the users current hydration state. I handed the thigs off to herb and neff and told them the next steps are going to be to test with another sample to see how the results change, then start creating a lookup table to correlate voltage readings to hydration.

    Entry 4: -----------------------------------------------------------------

    Date: Feb 25th
    Start Time: 6:30 PM
    Duration: 4.75 hours

    Continuing with kicad
    Finished the schematics completely, going to build pcb tomorrow morning.
    Screenshot of Root page:

    This page doesn't show much, but it shows the heirarchical sheets that contain the sensors and the power distribution/charging. Now that this is done I will be able to start doing the pcb layout and traces which will be a challenge to minimize size. One thing that I need to note before i forget is that the micro has an area in the datasheet that it recommends we put it in order for the antenna to work best, here it is:

    Found this picture from this link: https://docs.espressif.com/projects/esp-hardware-design-guidelines/en/latest/esp32/pcb-layout-design.html

    I will use this reference when laying out the pcb, as the manufacturer probably knows the best way to put it.
    One last thing I also need to do is get info from team about what pins on the micro the usb data needs to connect to when we're in program mode, this needs to be done before pcb is completely finalized, however for now I will put them on a gpio and then move later if i need to.

    Entry 3: -----------------------------------------------------------------

    Date: Feb 25th
    Start Time: 11 AM
    Duration: 1 hour

    Continuing with kicad
    Jonathon sent us a pdf of a group that used the conductivity sensor before, so going to copy that design, because i was trying to figure out best way to get the sourcing current.
    Link to article: https://www.diva-portal.org/smash/get/diva2:1436882/FULLTEXT01.pdf
    On the conductivity sensor sheet I added a connector layout because that will probably be easier since our sensor is not going to live completely on board, will only connect to board through it's leads.
    I changed to the connector because technically our sensor won't be living on board, it will only be connected through leads, so from this I updated the schematic to account for this. From here I will also be able to take up less space on the pcb because it will be detached, minimizing the footprint. After this I need to continue on after class and complete the schematic completely to get back on track.

    Entry 2: -----------------------------------------------------------------

    Date: Feb 24th
    Start Time: 11 PM
    Duration: 1 hour

    Working on KiCAD for system
    Designed custom footprint and schematic for the conductivity sensor. Attached to project.
    After spending time on this I learned how to create or import my own components. From here I can also upload one of the power components as it is not standard in the kicad library.

    Entry 1: -----------------------------------------------------------------

    Date: Feb 22nd
    Start Time: 1 PM
    Duration: 6.25 hours

    Continue conductivity calcs
  • link to help with conversion: https://www.openhacks.com/uploadsproductos/pt1000-temp-probe.pdf
  • drew circuit for better understanding, voltage divider solving for unknown resistance (thermistor)
  • updated code to correctly calc the voltage divider, new code:
    • float R_pt1000 = ((1/Vout) * 5000) - 1000;
      this calculates the resistance value of the thermistor, then sends that value into the rtd equation found here: https://en.wikipedia.org/wiki/Callendar%E2%80%93Van_Dusen_equation
  • realized sensor needs ac signal. .5Vpp @ 150 hz
  • pwm will output a ac signal from 0 to 3V, so need a high pass filter to stop the dc
  • using this website to calc the filter values: https://www.omnicalculator.com/physics/high-pass-filter
  • trying to make ac pwm signal with arduino, having issues with making it, found a sample to base it off of
  • gave up on the pwm sine wave. realized the esp has a DAC so i requested an arduino with a dac to do the same. will be a lot easier and can directly output a sine wave.
  • Today I went into the lab with herb and got a lot of dev and hardware breadboarding done. we started with the power circuitry, the coulomb counter and the buck boost. these had to be soldered and configured for our desired outputs, then went onto the board and plugged the battery in and confirmed 3.3V output constantly. After i moved back to the conductivity sensor, and fixed the temperature reading to be accurate, as shown here:


    I then shifted to the conductivity part, but i had issues trying to generate a pwm sine wave from the arduino, so I went online and couldn't find any good resources, so i'm going to go back and just waveform generator from the AD2 to get the wave, im dumb and wasted hours before realizing this. i also realized i need a current driver in order to output a constant current to the sensor, so going to request that as well. for now i will just put a resistor and then see if i am getting a meaningful output from the sensor, even though it will be slightly off from the internal resistance of the sensor too. from here the next thing i will do is come back to lab and then output the wave and record data.

    =============== Week 6: =================

    Summary: -----------------------------------------------------------------

    Hours this week: 13.25 hours
    Cumulative Semester Hours: 50.25 hours
    Description of this week:

    This week I showed my schematic in lab, and then finalized the power circuitry to accurately show the battery percentage, and charge, and regulate voltage. Along with the power circuitry finalization, I started to help with the calculations to translate the conductivity sensor reading at the ADC to the engineering units we want.

    Entry 5: -----------------------------------------------------------------

    Date: Feb 21st
    Start Time: 4 PM
    Duration: 3.25 hours

    Lab Dev
    I submitted procurement for all the power circuitry we need, and then requested dev boards to ensure they work as expected on a breadboard. I talked with herb about how the coulomb counter will interact via i2c. He is already setting up the heart rate sensor to use it so he thought it would be easy to translate once figured out. After I dug into the heart rate sensor a bit to help him troubleshoot why he wasn't getting correct data, as he wasn't sure if it was hardware or software causing the issue. I pulled up the datasheet and we changed the voltage to 5V to ensure the green led and sensor were getting enough voltage, but data was still incorrect, so he knew it was a software problem.
    Afterwards I shifted towards getting arduino back up to work on software dev of the conductivity sensor.

    Coding Conductivity Sensor
    I started working on the conductivity sensor on the arduino, because the calc's to turn from raw voltage to engineering units will be easy to copy and paste over to the esp code. So I started by looking at the datasheet and here is what it said you need to translate to resistivity:
    From this I was able to see that temperature was needed to be calculated first. This temp sensor was a pt1000 rtd, i knew exactly what this was as i'd worked with them before, but I never had to generate the equation to get the temperature in engineering units, so I had to research that.
    I went on multiple arduino forums and youtube videos (still have this link: https://www.youtube.com/watch?v=KHxap5HyLAY) to find out what equation and how to display temperature. Then from there I would then shift focus to the conductivity to calculate that as well. I was able to find and generate the following code:
    I started this code, and printed out the voltage it was reading with the temperature, and I received the correct voltage readings but messed up temperature. I am thinking it's a wrong number for the setup, so I have to go into it and rework those numbers. to troubleshoot this I went through and tested voltages to see if i got what i expected, and I also removed the temp sensor and measured the resistance while i held it (warm it up) and the resistance did increase so the sensor seems to be working fine. Next steps are going to be to go back in and find out what values i need to make the 'translation' correctly. then move towards the conductivity calculations. After all of this, I can hand off the calculations to herb and he will only have to worry about the esp setup.

    Entry 4: -----------------------------------------------------------------

    Date: Feb 20th
    Start Time: 10:30 AM
    Duration: 5 hours

    Power Circuitry
    Today going to go through all the power part of the pcb, finalize components to support areej with software overview, as she needs to know the component for the fuel gauge. I went through reddit pages, arduino blogs, and electrical engineering stack exchange to understand exactly how everything is going to interface with each other and how each component works. Need 3 major chips: the fuel gauge (already knew), charging IC, and the buck boost. TI has great resources for all of these to figure out exactly what you need. I know that we will also need a couple connectors for usbc and the lipo battery plug to connect both of those to the pcb, this will be easy to add, requested the usbc connector to use on a breadboard for now to dev.
    I though I would be able to find a chip that had all of the features from battery percentage to charging implemented, but that seemed to be hard to come by, I did however find better components than I was planning to use before, so here are them and how i will implement them.

  • Fuel gauge link: https://www.ti.com/lit/ds/symlink/bq27441-g1.pdf
    • schematic of the fuel gauge:
      This schematic shows that the fuel gauge will need to connect to micro in 3 parts, one for the gpio and 2 for the i2c. the i2c is for the constant battery percentage and the gpio is configured to send an interrupt to the microcontroller when the battery is low power. We have the option to incorporate this or not, going to brief everyone else and decide if that's what we want to do, or just use the percentage. As for everything else, it is pretty straight forward based on the schematic, this chip will work in parallel with the charger ic, and it will be able to tell when the cell is being charged and discharged, registers within it will talk to the microcontroller to then display the percentage to the user.

  • Battery Charging IC link: https://www.ti.com/lit/ds/symlink/bq21040.pdf
    • schematic of charger ic:
      this schematic and the datasheet explains that the chip can power the system and the battery at the same time, but it just cautioned that it has a 10 hour timer so if system draws too much power then the battery may not charge. i dont think this will be an issue for us because the system barely pulls any power, and we can also add in functionality to shut it off if needed. The only thing to note is that we need to be cautious about what is coming out of the Vout to make sure the voltages are not too high, this will dictate where the buck boost converter goes as well.
      Based on the detailed description of the datasheet, it seems that the chip takes care of voltage and current levels, so buck boost will go just after the battery, leading to the system so that it maintains a constant 3.3V

  • Buck boost converter ic link: https://www.ti.com/product/TPS63001
    This schematic is going to be simple to implement and the output of the charging chip will not matter as this has a wide range of 1.8V to 5.5V input, which it will keep a constant 3.3V. This also has a 96% efficiency rating which will minimize power loss for us. all of the values seem to be already set in stone so it will be as simple as copying into our schematic to implement into the system.
    I am putting in an order form and submitting to purchase these chips to be prepared for when they come in. I also put in a google form to request the usbc breakout so i can find which pin is needed for the Vbus. After this i will be prepped for the hardware and will focus on implementing the schematics by end of weekend.

    Entry 3: -----------------------------------------------------------------

    Date: Feb 19th
    Start Time: 10:45 AM
    Duration: 2.75 hours

    Researching Battery 'Fuel Gauge'
    stretch psdr finalized to add a gas gauge IC to track battery percentage. need to incorporate this into the pcb and the hardware, so even though it's a "stretch" it's going to happen no matter what. communication via i2c with the microcontroller. from there we will send it to the iphone to display the percentage of the device in the app. Adding this feature will allow the user to get an accurate representation of how much battery they actually have left.
    I requested this gas gauge, not sure if lab has it in stock but maybe something similar: https://www.ti.com/product/BQ27Z758
    Next, we're going to get the gas gauge in stock, and prototype with the battery to see how it actually works.

    ManLab6
    Went into lab, talked over what needed to do with the TA's. Need to refine PSDR 1, going to research exactly the power management side and finalize that. Know that the monitor will be attached with i2c, but need to confirm with a part number and finalize. In lab, helped herb troubleshoot the heart rate sensor. Explained that the sensor will run 3-5V, but 5V is how you get the green led to work. So he went in and changed the configuration to support green led. I went and added a separate power supply in order to get the 5V, and green led worked. Now the next steps are to hand off to him to figure out the rest of the data processing in order to get correct heart rate from the data packet. I started to finalize setup with arduino and conductivity sensor in order to completely get that part done. Steps to completion are going to be to connect to the arduino adc and then just make sure that we're receiving expected values based on test samples. Going to finish that up at my house and report results.

    Entry 2: -----------------------------------------------------------------

    Date: Feb 15th
    Start Time: 12:30 PM
    Duration: .75 hours

    Worked on A7
    Added in the parts I had on my computer with all the info for the bill of materials, I didn't have a couple of the parts so Herb is going to go in and do the rest.
    Worked on teammate evaluation

    Entry 1: -----------------------------------------------------------------

    Date: Feb 15th
    Start Time: 10 AM
    Duration: 1.5 hours

    Battery Charging Research
  • CC-CV, starts with current to charge, then lowers to maintain the 4.2V
  • Read into it with this link: https://www.digikey.com/en/maker/tutorials/2021/charging-lithium-ion-and-lipo-batteries-the-right-way
  • IC with built in control, here is the current and voltage chart
  • Need to integrate a USBC receptacle as well.
  • Datasheet says okay to put the system in parallel to the battery, refer to following schematic
  • Link to charging module: https://www.digikey.com/en/products/detail/texas-instruments/BQ21040DBVR/6036340
  • Link to USBC receptacle: https://www.digikey.com/en/products/detail/molex/2171750001/13913745?utm_source=oemsecrets&utm_medium=aggregator&utm_campaign=buynow
  • based on this can put the LDO right after battery then rest of system? or need diode? once charging ic not connected can pull from battery directly?
  • Researched how to charge the lipo battery, found the above information. Don't know if using that simplified schematic is going to be as easy as it looks, where we can just start pulling from battery whenever, plugged in or not, need to check with a ta or discuss how it will work. From here going to request those parts, then use it on the breadboard to prototype.

    =============== Week 5: =================

    Summary: -----------------------------------------------------------------

    Hours this week: 6 hours
    Cumulative Semester Hours: 37 hours
    Description of this week:

    This week I mostly just stayed afloat. I had two exams so I couldn't dedicate much time to the project. Started working on the KiCAD design for the system. Show me a thing was the hardware for the sensor was ready on the breadboard, just waiting on the micro to be done programmed.

    Entry 3: -----------------------------------------------------------------

    Date: Feb 12th
    Start Time: 12:30 PM
    Duration: 2 hours

    ManLab 5
    Started the PCB designing today, decided to not move further with the battery charging system because would rather focus on the existing stuff we have. Had to do a quick re-teach about how to use kiCad, but figured it out quick and started to design the system again. The next steps are going to be to complete the schematics so that we can move to setting up the actual PCB. Picture of the heart rate sensor schematic:


    Also, soldered and set up all the hardware on the breadboard for the prototyping. I left off the conductivity sensor because I took it home to prototype on the arduino. Planning that over the weekend after my exams. After prototyping on the arduino I can figure out the best way to implement on the device. It will read through the ADC so I also want to see how consistent the reading is, or if going to need to do some sort of processing. When the arduino is set up I'll be able to figure that out, so going to do that next.

    Entry 2: -----------------------------------------------------------------

    Date: Feb 10th
    Start Time: 4 PM
    Duration: 2 hours

    Battery Charging
    The battery datasheet says the charging needs to be at 4.2V. Normal charging is at 5V so we will have to include a converter to step down the voltage to charge at safe levels.
    Also, today I looked into a way that we would be able to prevent overcharging. A common issue with lipo batteries or lithium ion in general is that they can be overcharged. Therefore I thought what if there was a way to use the adc on the microcontroller to read the voltage of the battery, then when it gets to a certain voltage it can trigger the battery to stop allowing charge. A way I was thinking to do this is by using a P type mosfet. With this we can set up the gate to one of the gpio pins on the micro and then whenever it reads the max voltage it can flip the gate to then stop charge from going through. I used chatgpt to get ideas flowing, it suggested that the gpio might not be able to produce enough voltage for the transistor to completely turn off. As a result of this it said you can use a npn transistor to that's triggered by the gpio then the drain will output to the mosfet gate to stop that transistor. High level it seems like there could be something with this, but I won't have a lot of time to look it over this week with my exams but need to see if possible. The next steps are going to be to just re-enact this on a breadboard to see how we could use it with the microcontroller. This would also add complexity with the circuit so not too sure this is the best idea to focus on.

    Entry 1: -----------------------------------------------------------------

    Date: Feb 8th
    Start Time: 12 PM
    Duration: 2 hours

    Finished up the electrical overview. Final block diagram:


    Also as I was doing a4, had to calculate the frequencies that are to be used, made the following calcs to get the min freq for heart rate sensor: max heart rate at 20 y/o = 200 bpm = 3.3333… beats/second nyquist theory says sample @ double highest frequency, so technically only need like 10hz to get a great signal Worked on the battery and conductivity sensor part of a5

    =============== Week 4: =================

    Summary: -----------------------------------------------------------------

    Hours this week: 9 hours
    Cumulative Semester Hours: 31 hours
    Description of this week:

    Spent most time doing a4, learned a lot about how to regulate the battery voltage, and the process of supplying correct voltages to each component.
    Got sick at the back half of the week, planning to finish A4 on Saturday.

    Entry 3: -----------------------------------------------------------------

    Date: Feb 6th
    Start Time: 10 AM
    Duration: 6 hours

    Working on A4, electrical overview.

    Voltage regulation out of battery
  • Quick google search to see if there was a blog about what people had said they used with the ESP32 and voltage regulation out of a battery
  • Came across this blog: https://forum.arduino.cc/t/choosing-a-3-3v-voltage-regulator/68296 - they said to use the AMS1117 as many boards that use the esp32 use that one
  • Found the AMS1117 on digikey: https://www.digikey.com/en/products/detail/evvo/AMS1117-3-3/22482148
  • Going to check lab to see if it's available, and test it out with a battery.


  • Entry 2: -----------------------------------------------------------------

    Date: Feb 5th
    Start Time: 12:30 PM & 2:30 PM
    Duration: 2 hours

    Battery Monitoring
    Discussed different methods that we could use to measure the battery percentage. Need to get an IC that has the ability or need to get a battery that has it incorporated.
    Example IC that is a 'gas gauge': https://www.st.com/en/power-management/stc3100.html
    Need to establish connection via i2c. Another psdr.
    The following is the voltage to percentage relationship in a LiPo battery:

    Chart source: https://www.ufinebattery.com/blog/useful-overview-of-lipo-battery-voltage/
    The chart above shows why we can't just mark down voltage to percentage proportionally. I decided it might be easier to do 2 states instead of percentage. Either say charge is good in the app or tell user that it needs to be charged. Can make the alarm go off at ~3.25V to tell user the wristband is low power. Now need to get battery on hand, going to check to see if there is any in stock at the lab and see how feasible it would be to do this.

    Found/ordered max30101 on digikey As explained earlier, this heart rate sensor uses a red LED, a green LED, and an IR LED as photodetectors to see the light reflect. It uses all three of those in order to get the best measurement based on this source:
    https://edu.rsc.org/feature/the-science-of-smartwatches/4013008.article?
    This article explains that green is the opposite of red on the color wheel so it can take 2 measurements to ensure best meausre. Also, this sensor does all the processing on board so none of that will need to be done on our end. The next steps will be to simulate how it works and the best place to put it on a test heart rate sensor while we wait for this one to get shipped. I will use an arduino to hook up the sensor we have now in order to get an idea about how it will talk to the microcontroller, so that we can use it right away when we get the microcontroller on hand.

    As the article said, the sensor is measuring blood flow, therefore the best place to put it would be somewhere that it can easily se your veins in order to tell when blood is flowing through. Here is an initial mockup about how the wristband might work:

    The sweat sensor will be on top because I was thinking that the user would wipe their forehead or somewhere with a lot of sweat, so it needs to be exposed and the top seemed to be the easiest.

    Entry 1: -----------------------------------------------------------------

    Date: Feb 4th
    Start Time: 6 PM
    Duration: 1 hour

    Decided/ordered conductivity sensor
    • Link to digikey: Digikey link to conductivity sensor
    • According to the datasheet: - datasheet to conductivity sensor - this sensor is a lot smaller, with a footprint of 70mm in diameter, about 2.5"
    • Also the datasheet explains that there is also a pt1000 temp sensor, meaning that the resistance is 1k ohm @ 0C. With this, if needed we can go in and adjust the conductivity to compensate for the temperature.
    Here's a picture of the pinout of the conductivity sensor:
    Sensor Pinout
    After finding this sensor on digikey, i realized that this was one that was small enough for our sensor to start. Also, it didn't have a probe so it would be easy to use by wiping your sweat. Based on the pinout above, you can tell that there are sourcing pins and signal pins, based on the current that is sent in, we will be able to scale and offset the value to find the correlating conductivity. The scaling and offset will be done by the following values:
    Scale Offset
    Based on these values, I am pretty sure that we will be able to output the conductivity/resistance equivalence. Once the sensor is in stock we can test and ensure that's correct. This means that we can start to build around this sensor, specifically with our packaging. Initial plan will be to use some sort of waterproofing, while allowing the sensor to still show. Then you will ask the use to wipe the sensor with a shirt or cloth or something, then wipe their sweat to make sure nothing is effecting the measurement. The next steps from here will be to get the sensor on hand, and try to use the slope/offset with a sample to see what it outputs.

    =============== Week 3: =================

    Summary: -----------------------------------------------------------------

    Hours this week:8 hours
    Cumulative Semester Hours: 22 hours
    Description of this week:

    This week finalized the sensors we were to use on the micro, and then starting to layout the circuit.

    Entry 3: -----------------------------------------------------------------

    Date: January 30th
    Start Time: 5:30 PM
    Duration: 1 hour

    • looking into conductivity sensor
    • want to maybe buy a conductivity sensor
    • https://www.amazon.com/Conductivity-Hydroponics-Waterproof-Monitoring-Detection/dp/B08SQGL728/
    • with this we can just get an integrated circuit that does all the processing on board.
    • as for the sensor, it has a probe that you're supposed to put into the water sample. we would have to find a way to make it integrated so that it just can measure across two probes.
    • learned that there is conductivity sensors on the market that we can use. going to dive deeper into how we can manipulate them
    • next steps will be to figure out exact what sensor to use

    Entry 2: -----------------------------------------------------------------

    Date: January 28th
    Start Time: 11 AM
    Duration: 1 hour

    • thought of using a voltage divider to sense the sweat
    • by using the sweat as one of the resistors, and a known resistor value of the other resistor, we can back calculate the resistance of the sweat
    • with this we can make a lookup table to translate the resistance to conductivity then match it to salt content
    • with this data we can tell the user what hydration they need based off generic salt content sweat samples
    • downfall would be that if the user has obscure salt content it wouldn't work as well
    • next steps would be to recreate extremes to compare against to make our lookup table

    Entry 1: -----------------------------------------------------------------

    Date: January 25th
    Start Time: 1 PM
    Duration: 6 hours

    • Switched to the esp32 wroom micro, did this because that's what we checked out in class. The micro selection shouldn't matter too much as long as it has bluetooth because we aren't using any special funcionality
      • After looking into the functionality, we decided to keep the dev chip consistent with what we're going to use for the final product. We did this because we don't want to have to re-create the new code
      • The next steps are going to be to start actually creating dev code to communicate with the sensors to make sure they work how we expect.
    • Researched different battery options
      • link to battery: https://www.digikey.com/en/products/detail/sparkfun-electronics/PRT-13851/6605199?
      • After looking at the datasheet attached to the sell link, the battery seems to have an output of 3.7V
      • Going to need to add a voltage regulator, a buckboost converter to maintain a constant 3.3V
      • The rest of the sensors run on 3.3, including the micro, so just need one converter.
      • Learned that the voltage changes from anywhere from ~4V to ~3V, so the converter needs to keep a constant output of 3.3V for the components on the board
      • Now we can focus less on the battery and power side and more about how to move forward with the other hardware setup
      • Next steps are to figure out how and where to mount, most likely on the bottom board
    • Also did research into the content of salt in sweat
      • chat gpt outputted: Studies using whole-body collection systems indicate an average sodium concentration of 44.1 mmol/L, while localized collection systems report an average of 59.4 mmol/L. Sodium concentrations varies widely from individual to individual, ranging from as low as 20 mmol/L to as high as 80 mmol/L.
      • with this data we can use it to back calculate conductivity or compare resistance or voltage to salt content
      • next steps are to take test samples to build the lookup table that we need to use

    =============== Week 2: =================

    Summary: -----------------------------------------------------------------

    Hours this week:8 hours
    Cumulative Semester Hours: 14 hours
    Description of this week:

    This week started diving into microcontrollers and kept digging into how to sense sweat, came across a very interesting article that we could use for the future.

    Entry 4: -----------------------------------------------------------------

    Date: January 23rd
    Start Time: 2 PM and then again at 5:30 PM
    Duration: 3 hours

    • Met before class to choose a micro
      • The difference between the H2 and C6 functionally won't matter for our case, except barely a size difference, H2 is bigger
      • H2 will be so much easier to solder because of where pins are located, going to go with that one
    • Came across a paper about exactly what we're working on
      • link: https://www.nature.com/articles/s41378-022-00443-6/a>
      • very strong lead here
      • I had theories that we could use a voltage to measure, seems like we can even make the user not have to workout or be active too
      • Potential to expand in the future to a lot of different markets, for different health measures.

    Entry 3: -----------------------------------------------------------------

    Date: January 22nd
    Start Time: 10:50am
    Duration: 2 hours

    • ManLab
    • Kept on researching the different ways to measure
    • Realized that instead of measuring salt count, what if we measure water count, more sensors on the market potentially
    • A lot of sensors used for pools, too big for our case, need to keep researching
    • Looked at different types of heartrate monitors, easy picking, going to use green LED one, works the best

    Entry 2: -----------------------------------------------------------------

    Date: January 21st
    Start Time: 5:45pm
    Duration: 2 hours


    Entry 1: -----------------------------------------------------------------

    Date: January 20th
    Start Time: 11 AM
    Duration: 1 hour

    • Used chatgpt and other articles in order to try and get ideas on how to measure sweat content.
    • Need to make sure that the sweat is shorting both leads that are to be doing the measuring
    • Temperature of the device will also effect the voltage readings
      • Put sensor on outside, not always touching skin
      • When user wants to measure, then they wipe sweat with sensor
      • When run calc, need to subtract whatever voltage difference temp would give you


    =============== Week 1: =================

    Summary: -----------------------------------------------------------------

    Hours this week: 6 hours
    Cumulative Semester Hours: 6 hours
    Description of this week:

    First week of school, got back into the swing of things and started getting preliminary ideas.
    Didn't work 8 hours this week because was still trying to get stabilized with school and moving and everything that comes along with it.


    Entry 2: -----------------------------------------------------------------

    Date: January 17th
    Start Time: 1pm
    Duration: 2 hours

    • Met with team to finish A1 and turn in.
    • I am the hardware lead, need to start looking into different microcontrollers to use going to go over in class

    Entry 1: -----------------------------------------------------------------

    Date: January 15th
    Start Time: 12:30 PM
    Duration: 4 hours

    • Met with team for the first time in lab. Got a tour of the lab and an explanation of how it was going to work.
    • Discussed various ways that we could complete the work, hardest part will be electrolyte sensor to measure sweat.
    • Researched different ways to measure sweat and what was on the market that related.
    • Seems that you may be able to use conductivity to your favor, salt makes water more conductive
    • Can look into seeing if you can measure all types of electrolytes or just salt may be easiest and robust