Final Project

Final Project WOOOOOOO

In starting to plan for the final project, the project that I am leaning towards is heated clothing, specifically a thin, wearable vest that has heating elements on it. This would be built such that I could wear it underneath any of my existing jackets, and it would be easily washable if need be. With that in mind, here is the bill of materials that I came up with:
  1. Arguably the most crucial aspect of the heated vest is the heating element. I think that the best and cheapest way to make this happen would be to use positive temperature coefficient (PTC) heating pads. They are quick to warm up and they are able to self regulate their own temperatures to avoid overheating and causing a fire under my jacket. I also want them to cover a decent amount of area. I was thinking about using 4 or 6 (see battery discussion) of these heating pads
  2. I also will need a battery to power these heating elements, which seems like it will be the most challenging and expensive item. I would like to get at least 4-5 hours of battery life from this vest, and ideally I would like something closer to 6-8 hours of battery life for the full days that I will spend working outside in the cold. The easiest voltage to work with is 5V, as that is what both the microcontroller and the heating pads run on, but other voltages are viable with step-up/step-down converters. If I have 4 pads, each of which are drawing 600mA, I need the battery to be rated to at least 2.4A, but I would prefer if I had some more headroom, so I looked for 5V 3A batteries. Based on my (potentially incorrect) math, just powering the 4 heating pads wired in parallel and assuming no loss due to the rest of the electronics, a 10,000mAh battery gives me ~4 hours of battery life. Realistically, this would be less, so I want a higher capacity battery. A 20,000mAh battery would likely give me 6-7 hours of real battery life, so that is what I was looking at. I saw some batteries like this one that fit these requirements, but seem a little sketchy. However, I could pull some clever wiring shenanigans and get 6 heating pads, which would provide more warmth, and potentially use a less sketchy battery. If I wired 3 pairs of heating pads in parallel, with each pair wired in series, I would draw 10V and 1.8A of current, which is a (somewhat) compatible demand for lots of power banks that exist already for phones and laptops. I found this one, which is capable of outputting either 9V or 12V with USB PD and can handle 1.8A. It is a little big, but I think that this is the best way of handling power for this project, and it will be able to use 6 heating pads to keep me even warmer. It also is nice because with multiple ports, I can plug the microcontroller into a 5V port directly while also having 9V going to the pads.
  3. USB PD Trigger/Decoder board to get 9V out of the power bank (pads will run at 4.5V instead of 5V, but with more pads this should be fine) like this one
  4. JST connectors for modular pad connections for easy washing
  5. ESP32 or Xiao for the brains of the operation
  6. Power switch (rocker switch) and indicator LED
  7. Rotary encoder for temperature control
  8. Small screen to display battery level and temperature
  9. Temperature sensor (NTC thermistor maybe?)
  10. 22-24 AWG wire
  11. USB A to microUSB cable
  12. Polyester or neoprene to make the vest itself
  13. Waterproof material to make a pouch to house the microcontroller
  14. Velcro or snaps to make things easily removable for washing

Once all is said and done, I hope for the project to look something like this. In this model, the red patches are the heat pads (to scale), the silver box is the battery (to scale), the blue box is the control box that will house the microcontroller, temperature controls, and the display (approximate scale), and the grey dot is the thermistor (approximate scale).

My timeline for this project is going to really start in full swing after my thesis is done, which is on April 8th. I promise that I will not slack on this project but my thesis is gonna be kicking my behind until I have to turn it in. After my thesis is done, I'm gonna have more time than I know what to do with and I will grind in the maker space and make so much progress on this. I really care about this project, and I want to make it the best product possible, but it won't look that way until I am done with my thesis. All I ask is that you believe me when I say I will put the time in after the thesis is done. That being said, here is my general proposed timeline:
  • 3/27 - MVP: get ESP32 to turn the heating elements on and off
  • 4/15 - Ramping it up: integrate temperature control into ESP32
  • 4/29 - Learning to sew: make the vest itself
  • 5/6 - Putting it all together: putting all the electronics onto the vest and buttoning it all up

Integrated Project

My working on the integrated project consisted of two parts - designing a PCB and learning to sew. The first part, designing a PCB was a slow-going process, but EasyEDA made the process relatively straightforward. The biggest challenge in this part was designing electronics without ever being able to actually test them - just hoping that they work. I did some preliminary breadboard testing to make sure that all of my theories were correct, but in the end it was essentially just scaling up my MVP to have three heat pads and work on two different power circuits. I have designed one other PCB before, but that one came with a mostly made gerber file already and just required some tweaks, so starting totally from scratch was tough. It took many hours of staring at datasheets from random websites and using the worst search function known to mankind on the LCSC website to find the parts that I was looking for, but once I did, I was able to plop them into the schematic. I connected the heat pads to a circuit that will use 12V input power, though I later realized that I could've streamlined this process since the PD trigger boards are female connectors and not male ones, so it would be board-side and not battery-side, so there is a space for a JST input connector on the board, but I will have to mount the trigger board separately. The LED and rotary encoder work on 5V power, and I added a small OLED screen mount so that I can easily display statistics like temperature and goal temperature. The rotary encoder will be harvested from a board that we already have in the lab, and the transistors are parts that we already have, so I only had the resistors surface mounted.

After I finished the schematic, I moved to PCB design, with the goal of getting it to be as small as possible. I also wanted it to be narrow to minimize the footprint and weight distribution effects that this would have on the vest. The Autoroute option in EasyEDA was completely useless, so I went at it myself and manually routed wires. I also needed multiple thicknesses of wire because some wires would carry 12V, 2A and some would carry 5V, 1A. This process almost felt like a puzzle game to me, trying to ensure that everything goes to where I wanted it to without crossing any other wires, so that part was pretty fun I guess. I also added pin holes for the last available analog pin on the Xiao that wasn't occupied, and added multiple additional busses for I2C connectors, as I realized that I did not have any remaining pins if I wanted more than one temperature sensor. With the I2C option, I can hook up multiple compatible sensors to the same 4 pins that are already being used by the OLED screen. I haven't figured out exactly how I'm going to do this yet, so I just gave myself the option with some additional pin holes. I also added generic through holes for ease of mounting. Finally, I went crazy with the silkscreen labelling to make my life as easy as possible determining what goes where to minimize future multimeter guess and check work. After I was happy with my design, I went through the ordering steps and sent all of my preferences and files to Nathan for ordering. No particular options were selected - I wanted to have a purple PCB, but it would've taken longer, and no one is going to see this PCB ever, so it didn't matter.

After the PCB was done, I got to actually working on the packaging of this project. The main target that I wanted to tackle for this week was making some semblance of the vest and learning how to sew in the process. I have used a sewing machine once or twice before, but it was always just super basic straight stitches by pressing the pedal down and letting it do its thing. This time, I would need to do a bit more than that. The freecycle in my house is always literally overflowing, so my plan was to go rifle through those bins and find a very oversized shirt or something that would work for the midlayer goal of my vest - I want it to be able to fit over top of a sweater or bulky shirt but not be too baggy. I was out of town over the weekend and spent all of the time allotted to PS70 the week before on the cinnabot, so that meant that I left this process until Monday. Of course, the one and only time the freecycle has LITERALLY EVER THIS ENTIRE YEAR been cleaned out was over the weekend, leaving my original plan high and dry. I went back to the drawing board and pulled out these black undershirts that I have, which I think could work well since they are thin, easily washable, and stretchy, allowing them to fit comfortably over various thicknesses. Unfortunately, since they are undershirts, they were way too tight. Because of this, I got to tackling my first large sewing project - combining the two tight undershirts into one, looser and baggier undershirt. I cut the sides off of one to the desired thickness, split the sides of the other that would eventually form the midlayer, and much like Dr. Frankenstein did to his monster, sewed the pieces all together into a larger version of what once was.

Considering this was my first time doing anything even remotely similar to this, I was pretty happy with how it turned out - it's amazing what you can learn from YouTube. I had expanded the midlayer to be a pretty ideal width. The width was way too tight and now it fits overtop of bulky shirts and sweaters well. Unfortunately, it still looks a little dumb because the armpits are the portmanteau of two sweaters, and the length is way too long. I tried to address these issues last night, but I was way too tired from my weekend and was butchering it. I also realized that I needed some more precision, so I went back to my dorm and asked for some help pinning the midlayer to better dimensions. Now, the midlayer is all pinned to the right dimensions including the armpits and the length, so the next steps will be sewing those dimensions into place, sewing the pockets on, and sewing the zipper on!

The Final Final Push

I genuinely think that I spent around 70-80 hours on this between Thursday of last week and Monday, so I am just going to go through the highlights here and not every single trial and tribulation. This was extremely fun and extremely frustrating all wrapped into one Diet Coke-fueled bender, but in the end I am proud of what I made, so I count that as a huge win. I will be breaking it down into smaller chunks of the project below for organizational purposes.

The Vest

I think that if I was doing this project all over again, the first thing that I would change would be to use a different, less stretchy, and thicker material. The undershirts were very convenient for what I had on hand, but it was really frustrating and unforgiving to sew as it bunched, scrunched, and tore where other materials wouldn't have. At the end of my integrated project, I had made the barest of bones vest - it was the correct width and that was about it. The first thing that I did was get to hemming it and making it look less ridiculous. This again was the product of YouTube and Kassia Academy, and while it's not perfect, I was able to tailor it to my size pretty well. The length is perfect almost everywhere, except for one spot on my back where I accidentally hemmed it a bit too short, but it's only aesthetic and this is meant to be worn underneath things anyways. I also fixed the armpits in perhaps not the most elegant way, but I just folded the material over itself and stitched it, which brought the elephant ears in a bit.

After that, I got to making the pockets. There wasn't enough material leftover from the shirt that was cut to sacrifice its sides, so I had to butcher a third shirt, this one I did actually get from the freecycle. It was a slightly less stretchy black t-shirt, which blends in nicely but is much easier to work with. I made the pockets by cutting a rectangle of fabric out of the shirt, pressing it with an iron, folding the sides over and sewing them to create nicer-looking edges that wouldn't fray, and then sewing 3/4 sides onto the vest. The fourth side I sewed mostly shut from the top and bottom, but left a wide enough hole that I could take the heating pads in and out without too much effort, but small enough so that they wouldn't come out on their own. I sewed six heating pad pockets in this way. I then sewed the zipper on, and it took me three different zippers to get one that even somewhat worked for my project. The first was a non-separating zipper which defeats the purpose for this project, the second was way too small, and the third, while it is a left handed zipper (which is super dumb), fit perfectly. This was another instance where the stretchy material really worked against me and made sewing the zipper on much more difficult. But, with the help of Dr. Pincushion, I got it sewed on and working and looking great. The final sewing tasks that I had after the pockets and zipper were on was to figure out cable management and make a place for the PCB to sit. For cable management, I made little loops that were just wide enough for the pads, with some folding, to squeeze through, therefore routing their wires through them. I made three of them spaced around the vest to keep the wires relatively detangled and out of the way so that I can move freely while wearing the vest. It also makes it look much more aesthetically pleasing without them dangling everywhere. For the PCB housing, I decided to make a pocket that was perfectly sized to fit the PCB case (more on that later) and was high enough so the case could rest in there without pulling on any wires. This was the same process as the heat pad pockets, but a different size. This way, I can pull out the case and adjust the temperature when I want to, and I can leave it to be snug in the pocket once its set.

Once all of this was sewed up, the physical vest was complete.

Heat Pads

This was relatively straightforward. I soldered three sets of 2 heat pads each. Each pair of each pads was wired in series and the 3 sets were wired in parallel. This allows for some customization if I don't want to use all the heat pads every time. For example, the side pads are attached to each other, so I could take those out and just wear the front and back pads if I wanted to. This also was optimal for my circuitry. This way, they requested 10V (9V supplied - more on that later - but close enough) at 1.5A, which is within the rating of the battery. There was some long wires that I had to run because I didn't want any wires going across the zipper, so instead of routing wires from the front right pad across to the PCB, I had to route them all the way around my body, but I think this made it a much better product. I used ribbon cable for all of this, which is nice because it's stranded and therefore more flexible, but also annoying because it's not as solid as solid core wire is. It was necessary for mobility though. I connected the heat pads to JST connectors that could fit into the sockets on the PCB.

Circuitry

This was very, very far from straightforward. My original design was to have two separate circuits, each powered by their own cable - one for the heat pads at 9V, 1.5A and one for the Xiao and all the smaller components at 5V. First, I tried to get the 9V circuit working, but problems began when I realized the USB-C breakout board was a female connector and not a male connector, meaning it would be best if it was on the board. I desoldered the JST connector that I had on the board and replaced it with a hotwired breakout board that had flipped polarity that I needed to deal with. After soldering some pads together, I got it to always be requesting 9V, or so I thought. When I plugged the battery into both the 9V breakout board and the Xiao, it only supplied 5V to both of them. Upon further research and testing, I learned that this battery (and like 99% of all batteries) can't output the different voltages simultaneously, especially not at the amperage that I needed it to. It's rated for 20W regardless of how its broken out, so I couldn't request 9V 2A and 5V 1A simultaneously, in addition to the different voltages being weird. This meant that I couldn't use the one battery to power two different circuits with two different cables. However, I was then able to siphon power from the 9V, step it down to 5V, and supply it to the Xiao. I originally tried a buck converter we had in the lab, but it was fried, so I had to make my own. I used a 5V regulator that was a tiny chip that was able to step voltage down to 5V, and I hooked up some little tiny capacitors to it to help with consistent voltage flow to the Xiao, even when the heat pads are rapidly turning on and off. I hooked this up in parallel to the USB-C breakout board, allowing me to siphon power from the 9V supply, step it down to 5V, and provide it to the Xiao through a diode to prevent backflow issues and issues with competing voltages if it was also plugged into a computer.

This whole process of understanding the issue and figuring out a way to fix it took so long, but felt so satisfying once it was done and worked the way that I wanted it to. At this point, I thought that I was cruising, but due to an issue that I will discuss later, I thought that I had designed my PCB improperly, so I had to cut a trace relating to pin A on my encoder and bridge the connection using a jumper wire. It turns out, the way that I originally had it was fine and it was an issue with the code, but the way that I jumped it also worked, so it wasn't that big of a deal. I then connected two BME280 modules to the two temperature sensor I2C busses that I incorporated into my PCB (sometimes I'm so smart oh my gosh) using ribbon cable to make it look pretty (although I later learned that this may have been at the expense of some integrity) with one wide wire going to the sensor instead of four separate ones. They had the same I2C address initially, so I had to bridge some connection on one of them to manually change its address. Finally, I also connected a small OLED screen to the screen I2C bus that I added on the PCB again using ribbon cable. This one was short though because I wanted it to sit inside the case. Essentially, my time spent on the electronics of this project involved an absurd amount of really small soldering, and I didn't even mention soldering the Xiao onto the board because that looks like child's play compared to some of the other stuff that I did.

Code

Finally when I felt like I had made so much progress on the hardware, I could start in on the software. Luckily, I had a lot of this logic already written for the MVP, I just had to change it up a bit. First, I integrated all three heat pads into the code and had them turn on and off together. In retrospect, I could have just hooked these up to one Xiao pin, but if I ever want to do zonal heating, this will be nice to have. I also tried to get some LEDs to work, but was having issues - more on that soon. I then wanted to get my encoder working and being able to set a target temperature. Despite following many online tutorials of getting a rotary encoder to work with an ESP 32, I could not for the life of me get mine to read. I troubleshot for hours, trying literally everything to get this stupid encoder to work. I even thought it might have been a PCB issue, which is why I cut the trace and bridged a connection, but even that didn't work. Following the triumphant return of Bobby and some additional troubleshooting with him, he hacked into the mainframe of my computer and pulled up some obscure file that showed that the pin numbers did not even come close to matching up with the actual pins used by the Xiao. Like pin 6 is actually 21 unless you put D6 in front of it. Armed with that knowledge, I put D in front of the numbers in my code and it worked perfectly. I then had to figure out I2C, which was honestly much more straightforward than I thought it would be. I feel like it's rare for me to find a protocol or really any package on the internet that I think is elegantly designed, but I liked I2C. I used that to connect my two temperature sensors and screen to the SCL and SDA pins and control them each individually. I was able to get the temperature readings from the BME printed onto the OLED. From there, I started to incorporate the encoder into setting the target temperature and logic around the code to make it so that the heat pads respected the target temperature. In the end, the code did a couple main things: Allowed me to set a temperature that the pads would heat up to until they reached it, at which point they would turn off and let the temperature cool down until it reached a set threshold (2 degrees in my case) below the target temperature, at which point it would heat back up again; locked the encoder from adjusting the temperature by default to prevent accidental changes, but unlocking it with a click of the encoder and relocking with either another click or 5 seconds of inactivity; lit up the red LED when it was heating and the green LED when it was in range; and displayed the temperature, target, and heating status on the screen

PCB Case

The final step was to make a housing for the PCB. I was originally planning on 3D printing a box for this, but I decided that it would a) take too much time and b) be easier and more straightforward to fabricate the box another way. Our first assignment in this class was to make a finger joint box, so it only felt right to make a finger joint box as the last part of my final project for the class. I took all the necessary measurements, cut a few iterations out of cardboard to test fit, sizing, and port placement, before eventually cutting it out of clear acrylic. I ended up really liking this approach because the clear acrylic showcasing the PCB that I designed is really just the cherry on top of this whole project. The acrylic is so clear it makes the PCB look like a museum piece behind glass, and I just absolutely am in love with it. It also allowed me to place the screen under the acrylic, protecting it from scratches and other stuff that could screw it up. Despite some hiccups along the way with installing the PCB and hot gluing it all shut, it turned out pretty cool, and it serves its purpose of protecting the PCB, while allowing access to the knob for temperature control, all of the pad ports, and both the power and code ports, all while also being able to see the screen and everything inside.

Post Mortem Analysis

I am now writing this post fair, and I wanted to break down both my favorite and least favorite parts of this project, as well as what I will be keeping and what I will be changing when I make V2 of the heated vest, which will be coming at some point before next winter.

Pros:

  1. The vest itself is awesome - I think that I really did a good job with constructing the vest, sewing and frankensteining it all together, and putting the pockets on. Especially for my first time sewing, I am super happy with how this turned out physically
  2. The washability - making all of the electronics very easily removable is so cool because it will allow me to wash just the vest and keep it nice and clean without damaging the electronics
  3. The battery usage - having this be USB-C PD compliant is just so cool and allows for so much flexibility. I always carry around a portable battery, and the vest will accept any of the ones that I have and use it to power the vest. Also, if I am ever wearing the vest and need to charge my phone, I have the battery and the cord needed to do that.
  4. The PCB itself - while there are some tweaks that I will make that are talked more about below, custom designing the PCB was awesome and for 95% of the necessary functionality, it worked great. It was a really elegant solution to my circuitry requirements that, while it did need some adjustments, worked really well overall, was super cool, and was rewarding to design.

Cons:

  1. Durability - right now, a lot of the connections are really flimsy and shift and change with a slight shake or tap. In V2, I want to make this really wearable, so I need to make it so that those connections can stand the test of time
  2. Cable management - I feel like right now it's good but not great. Maybe tightening the channels or some other way of funneling those better would significantly improve the project both functionally and aesthetically
  3. The case - while it is gorgeous, it could be more so and more elegant. It is currently all hotglued together, which makes it a little uglier than it has to be, and it makes it really difficult to open up if/when stuff goes wrong. Even having the laser cut box with 3D printed brackets or something would greatly improve aesthetics and usability.

Overall, I am really proud of this project. It definitely had its ups and downs, but I accomplished what I set out to do with flying colors. It was hard, but I persevered and learned a ton, much like the rest of this class. And at the end of the day, I freaking did it and made an awesome product that I can and will hold my head high about.