{"id":14460,"date":"2021-11-02T09:47:34","date_gmt":"2021-11-02T13:47:34","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/?p=14460"},"modified":"2021-11-02T09:50:21","modified_gmt":"2021-11-02T13:50:21","slug":"electric-tape-measure","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/electric-tape-measure\/","title":{"rendered":"Electric Tape Measure"},"content":{"rendered":"<p>For this project I made a device that will record the measurements you take on an lcd screen using a string wound around a rotary encoder.<\/p>\n<p><strong>Overview:<\/strong><\/p>\n<div id=\"attachment_14484\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14484\" loading=\"lazy\" class=\"size-full wp-image-14484\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0012-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0012-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0012-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0012-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0012-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0012-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0012-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0012-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0012-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-14484\" class=\"wp-caption-text\">Top view on welcome screen<\/p><\/div>\n<div id=\"attachment_14485\" style=\"width: 1717px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14485\" loading=\"lazy\" class=\"size-full wp-image-14485\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0016-scaled.jpg\" alt=\"\" width=\"1707\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0016-scaled.jpg 1707w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0016-200x300.jpg 200w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0016-683x1024.jpg 683w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0016-768x1152.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0016-1024x1536.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0016-1365x2048.jpg 1365w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0016-973x1460.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0016-508x762.jpg 508w\" sizes=\"(max-width: 1707px) 100vw, 1707px\" \/><p id=\"caption-attachment-14485\" class=\"wp-caption-text\">View of the bottom with laser engraving of which measurements to take. The glue I used to keep the Arduino in place took its toll on the acrylic<\/p><\/div>\n<div id=\"attachment_14486\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14486\" loading=\"lazy\" class=\"size-full wp-image-14486\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0023-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0023-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0023-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0023-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0023-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0023-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0023-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0023-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0023-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-14486\" class=\"wp-caption-text\">You can see the nut which is attached to the string used for measuring<\/p><\/div>\n<div id=\"attachment_14487\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14487\" loading=\"lazy\" class=\"wp-image-14487 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0026-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0026-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0026-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0026-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0026-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0026-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0026-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0026-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0026-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-14487\" class=\"wp-caption-text\">From this angle you can see all the circuits and the spool on different layers<\/p><\/div>\n<div id=\"attachment_14507\" style=\"width: 2570px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14507\" loading=\"lazy\" class=\"size-full wp-image-14507\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0009-scaled.jpg\" alt=\"\" width=\"2560\" height=\"1707\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0009-scaled.jpg 2560w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0009-300x200.jpg 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0009-1024x683.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0009-768x512.jpg 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0009-1536x1024.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0009-2048x1365.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0009-973x649.jpg 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/DSC_0009-508x339.jpg 508w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><p id=\"caption-attachment-14507\" class=\"wp-caption-text\">testing the device against a ruler, though the device is a little off here<\/p><\/div>\n<div style=\"width: 620px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-14460-1\" width=\"620\" height=\"349\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/Project-2.mp4?_=1\" \/><a href=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/Project-2.mp4\">https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/Project-2.mp4<\/a><\/video><\/div>\n<p>This is a video of me testing the device against a ruler, after some calibrating the device works with results within a range of 5mm from the expected result. Featuring a small guest.<\/p>\n<p><strong>Process Images:<\/strong><\/p>\n<div id=\"attachment_14505\" style=\"width: 1138px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14505\" loading=\"lazy\" class=\"size-full wp-image-14505\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-10-22-at-4.33.19-PM.png\" alt=\"\" width=\"1128\" height=\"1056\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-10-22-at-4.33.19-PM.png 1128w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-10-22-at-4.33.19-PM-300x281.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-10-22-at-4.33.19-PM-1024x959.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-10-22-at-4.33.19-PM-768x719.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-10-22-at-4.33.19-PM-973x911.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-10-22-at-4.33.19-PM-508x476.png 508w\" sizes=\"(max-width: 1128px) 100vw, 1128px\" \/><p id=\"caption-attachment-14505\" class=\"wp-caption-text\">a screenshot of the measurements for the spool I 3D printed<\/p><\/div>\n<p>At first I was a little more ambitious about the design and wanted to use a spring to rewind the string, but that turned out to be too much of a mechanical puzzle for me. My next thought was to use a crank, and I actually included holes in the spool for one to attach, but after the design was printed, cut, and put together, it became clear that the best method was the easiest one, just using my finger to rewind the string.<\/p>\n<div id=\"attachment_14504\" style=\"width: 4042px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14504\" loading=\"lazy\" class=\"size-full wp-image-14504\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress3.png\" alt=\"\" width=\"4032\" height=\"3024\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress3.png 4032w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress3-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress3-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress3-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress3-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress3-2048x1536.png 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress3-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress3-508x381.png 508w\" sizes=\"(max-width: 4032px) 100vw, 4032px\" \/><p id=\"caption-attachment-14504\" class=\"wp-caption-text\">freshly laser cut, seeing what it looks like put together and figuring out which spacers work best<\/p><\/div>\n<p>After I put my project together I realized that I needed to plan out the design better so that everything would fit. I went back afterwards and got rid of the excess wires and used glue instead of electrical tape to keep it all together, I was super happy with the 2nd version as compared to the bulkiness of the first (which had the buttons outside of the case). I was also able to switch out the yarn I was using with a more sturdy string and that made the results way more consistent, which made the project a lot more enjoyable.<\/p>\n<div id=\"attachment_14500\" style=\"width: 4042px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14500\" loading=\"lazy\" class=\"size-full wp-image-14500\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress2.png\" alt=\"\" width=\"4032\" height=\"3024\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress2.png 4032w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress2-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress2-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress2-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress2-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress2-2048x1536.png 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress2-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress2-508x381.png 508w\" sizes=\"(max-width: 4032px) 100vw, 4032px\" \/><p id=\"caption-attachment-14500\" class=\"wp-caption-text\">First version of the project put together, I was having trouble using the wires with pins and couldn&#8217;t fit everything inside. I was also using yarn instead of the sturdy thread now being used.<\/p><\/div>\n<div id=\"attachment_14503\" style=\"width: 4042px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14503\" loading=\"lazy\" class=\"size-full wp-image-14503\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress1.png\" alt=\"\" width=\"4032\" height=\"3024\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress1.png 4032w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress1-300x225.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress1-1024x768.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress1-768x576.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress1-1536x1152.png 1536w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress1-2048x1536.png 2048w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress1-973x730.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/progress1-508x381.png 508w\" sizes=\"(max-width: 4032px) 100vw, 4032px\" \/><p id=\"caption-attachment-14503\" class=\"wp-caption-text\">soldering a tiny protoboard so I can get rid of the breadboard and get everything to fit<\/p><\/div>\n<div id=\"attachment_14488\" style=\"width: 624px\" class=\"wp-caption alignnone\"><img aria-describedby=\"caption-attachment-14488\" loading=\"lazy\" class=\"wp-image-14488 size-full\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/shirt_engraving.png\" alt=\"\" width=\"614\" height=\"532\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/shirt_engraving.png 614w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/shirt_engraving-300x260.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/shirt_engraving-508x440.png 508w\" sizes=\"(max-width: 614px) 100vw, 614px\" \/><p id=\"caption-attachment-14488\" class=\"wp-caption-text\">Shirt made in Illustrator for engraving<\/p><\/div>\n<p>&nbsp;<\/p>\n<p><strong>Discussion:<\/strong><\/p>\n<p>&#8220;With more time try having it be battery powered to be completely portable &#8221;<\/p>\n<p>I totally agree. I&#8217;m not sure in the current design where I would place a battery, but I&#8217;m sure there&#8217;s room for something. I think the wires had a little too much space to spread out, in a future iteration I would like to set up a path for the wires rather than the open design so that I can better place other parts of the project.<\/p>\n<p>&#8220;A closed design might be better for something like this&#8221;<\/p>\n<p>I think I agree, especially with the wires adding to the bulk. In the first version, pre soldering, the wires were sticking out the sides and it was pretty messy, though I think after cleaning it up the open design isn&#8217;t so bad to look at. I think the project looks cooler having the layers open like they are, but I think it also makes the project a lot more fragile.<\/p>\n<p>&#8220;Millimeters is probably not the most useful unit for measurement?&#8221;<\/p>\n<p>I agree. Since mm are such a small unit though, for the purpose of testing I thought they would be better to use. If I had more time and also more room on the LCD it would be useful to convert the measurement into inches or cm.<\/p>\n<p>I really liked my final product. At first I was disappointed by the bulkiness of it, and the difficulty in getting an accurate reading, but after some soldering and a change of string, I was happy with the results. There are a lot of mistakes I made, and I feel that I could have gone farther with the case, but for a first laser cutting experience I thought it turned out well.<\/p>\n<p>I feel that I learned a lot through this project. I struggled just to get the rotary encoder working, and if it wasn&#8217;t for Zach explaining the math, I&#8217;m sure it would have been a nightmare for me to figure out how to turn those measurements into distance. Though now looking back, I&#8217;m surprised that I struggled so much. I feel more prepared than I was before in starting what I&#8217;d consider a &#8216;technical&#8217; project. I&#8217;m a big fan of motors and lights, but translating an input to an accurate reading is something I would usually avoid. After seeing the project work though, I feel a lot more confident. Something I would do differently next time is prepare the structure a little more. I like the design I used, but while putting it together I realized how much easier it would have been if I had taken every wire into consideration, not just the parts they attach to. I also ended up using glue to put the pieces in place, but in hindsight I would have preferred to use screws as much as possible.<\/p>\n<p>I also learned how to laser cut (at least with the help of the IDeATe staff) and I want to try it out again soon!<\/p>\n<p>If I were to iterate on this project I would definitely change the screen to an OLED, theres just not enough room on the LCD to show the readings. Also I&#8217;d like to add a battery so that the device is portable. One thing I wasn&#8217;t able to get to that I originally thought would be cool is to use a spring. This way the string would automatically rewind itself after being pulled out. I opted instead for a crank, but it became clear it was faster just to wind the spool itself. I also would rework the case and add holes for the Arduino and LCD to attach with screws. I might also add markings to the string just for clarities sake, and maybe figure out a way to make the engraving more visible, or less obstructed. I could add a receipt printer using bluetooth that could print out the measurements taken. Lastly I&#8217;d like to add a button that could convert the units into different measurements.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Technical Information:<\/strong><\/p>\n<p>Schematic and Block Diagram:<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-14481\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/block-1.png\" alt=\"\" width=\"773\" height=\"271\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/block-1.png 773w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/block-1-300x105.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/block-1-768x269.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/block-1-508x178.png 508w\" sizes=\"(max-width: 773px) 100vw, 773px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-14480\" src=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/schematic.png\" alt=\"\" width=\"1095\" height=\"851\" srcset=\"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/schematic.png 1095w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/schematic-300x233.png 300w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/schematic-1024x796.png 1024w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/schematic-768x597.png 768w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/schematic-973x756.png 973w, https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-content\/uploads\/2021\/11\/schematic-508x395.png 508w\" sizes=\"(max-width: 1095px) 100vw, 1095px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/* \r\nElectronic Tape Measurer\r\nJohn Hewitt\r\nThis project uses a rotary encoder to take clothing measurements in mm\r\n\r\nThe buttons map to pins 6 and 8, while the rotary encoder is mapped to pins A2 and A3\r\n\r\nI used this setup to get the rotary encoder working\r\nhttps:\/\/forum.arduino.cc\/t\/getting-input-from-rotary-encoders\/620026\r\n\r\n*\/\r\n\r\n#include &lt;Wire.h&gt;\r\n#include &lt;LiquidCrystal_I2C.h&gt;\r\n\r\n \r\nLiquidCrystal_I2C screen(0x27, 16, 2);\r\n\r\n\r\n \/\/ used to draw a lil heart :] https:\/\/maxpromer.github.io\/LCD-Character-Creator\/ \r\nbyte heart[] = {\r\n  B00000,\r\n  B01010,\r\n  B10101,\r\n  B10001,\r\n  B01010,\r\n  B00100,\r\n  B00000,\r\n  B00000\r\n};\r\n\r\nint clockP = A3;\r\nint data = A2;\r\nint count = 0;\r\nint c = HIGH;\r\nint cLast = HIGH;\r\nint d = HIGH;\r\n\r\n\r\nint collar = 0;\r\nint sleeve = 0;\r\nint chest = 0;\r\nint waist = 0;\r\n\r\nfloat current = 0;\r\n\r\nint enter_button = 6;\r\nint zero_button = 8;\r\n\r\nfloat measurement;\r\nfloat measurement_last;\r\n\r\nbool no_change_on_screen = true;\r\n\r\nbool measurement_mode = false;\r\n\r\nbool start_screen = true;\r\nbool start_display_up = false;\r\n\r\nbool still_measuring = false;\r\n\r\nint on_step = 1;\r\n\r\nvoid setup() {\r\n  \r\n  pinMode (enter_button, INPUT);\r\n  pinMode (zero_button, INPUT);\r\n\r\n  pinMode (clockP, INPUT_PULLUP);\r\n  pinMode (data, INPUT_PULLUP);\r\n  \r\n  \r\n  screen.init();\r\n  screen.backlight();\r\n  screen.home();\r\n  screen.display();\r\n  screen.createChar(0, heart); \/\/initialiaze heart to zero screen.write(0);\r\n  screen.clear();\r\n}\r\n\r\n\r\n\r\n\r\nvoid loop() {\r\n\r\n\r\n  \/\/rotary encoder code \r\n  c = digitalRead(clockP); \/\/ read pin A as clock\r\n  d = digitalRead(data);  \/\/ read pin B as data\r\n  \r\n  \r\n  if (c != cLast) {       \/\/ clock pin has changed value\r\n    d = c^d;              \/\/ work out direction using an XOR\r\n    if ( d ) {\r\n      count++;\r\n    } else {\r\n      count--;\r\n    }\r\n    cLast = c;\r\n  }\r\n\r\n\r\n  if (digitalRead(zero_button) == HIGH) {\r\n    \/\/set current value to zero\r\n    count = 0;\r\n  }\r\n\r\n\/\/43.9823\r\n  measurement = ((((float)count\/ (float) 16)) *30);\r\n  \r\n\r\n\r\n  if (start_screen == true) {\r\n    if (!start_display_up) {\r\n      screen.setCursor(2, 0);\r\n      screen.write(0);\r\n      screen.print(\" WELCOME \");\r\n      screen.write(0);\r\n      start_display_up = true;\r\n    }\r\n    if (digitalRead(enter_button) == HIGH) {\r\n      start_screen = false;\r\n      start_display_up = false;\r\n      measurement_mode = true;\r\n      no_change_on_screen = false;\r\n      still_measuring = true;\r\n      on_step = 1;\r\n      delay(200);\r\n    }\r\n  }\r\n\r\n\r\n  \r\n  if (measurement_mode == true) {\r\n\r\n    if (measurement_last != measurement) {\r\n      measurement_last = measurement;\r\n      no_change_on_screen = false;\r\n    }\r\n\r\n    if (still_measuring == true) {\r\n      \r\n      if (digitalRead(enter_button) == HIGH) {\r\n        \r\n        if (on_step == 1) {\r\n          collar = measurement;\r\n          on_step = 2;\r\n          \r\n          no_change_on_screen = false;\r\n          \r\n        } else if (on_step == 2) {\r\n          sleeve = measurement;\r\n          on_step = 3;\r\n          \r\n          no_change_on_screen = false;\r\n          \r\n        } else if (on_step == 3) {\r\n          chest = measurement;\r\n          on_step = 4;\r\n          \r\n          no_change_on_screen = false;\r\n          \r\n        } else if (on_step == 4) {\r\n          waist = measurement;\r\n          still_measuring = false;\r\n\r\n          no_change_on_screen = false;\r\n          \r\n          still_measuring = false;\r\n        }\r\n        delay(200);\r\n      }\r\n    }\r\n\r\n    if (!no_change_on_screen) {\r\n      screen.clear();\r\n    \r\n      screen.setCursor(0, 0);\r\n      if (on_step == 1) {\r\n         screen.print(\"collar:\");\r\n         screen.print(measurement);\r\n      } else if (on_step == 2) {\r\n         screen.print(\"sleeve:\");\r\n         screen.print(measurement);\r\n      } else if (on_step == 3) {\r\n         screen.print(\"chest:\");\r\n         screen.print(measurement);\r\n      } else if (on_step == 4) {\r\n         screen.print(\"waist:\");\r\n         screen.print(measurement);\r\n      }\r\n\r\n      \r\n      screen.setCursor(11, 0);\r\n      screen.print(\"a)\");\r\n      screen.print(collar);\r\n\r\n      screen.setCursor(0, 1);\r\n      \r\n      screen.print(\"b)\");\r\n      screen.print(sleeve);\r\n      screen.print(\" \");\r\n  \r\n      \r\n      screen.print(\"c)\");\r\n      screen.print(chest);\r\n      screen.print(\" \");\r\n\r\n      \r\n      screen.print(\"d)\");\r\n      screen.print(waist);\r\n\r\n      no_change_on_screen = true;\r\n    }\r\n\r\n    if (!still_measuring) {\r\n      if (digitalRead(enter_button) == HIGH) {\r\n        screen.clear();\r\n        measurement_mode = false;\r\n        collar = 0;\r\n        sleeve = 0;\r\n        chest = 0;\r\n        waist = 0;\r\n        start_screen = true;\r\n        on_step = 1;\r\n        delay(200);\r\n      }\r\n    }\r\n    \r\n  }\r\n  \r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For this project I made a device that will record the measurements you take on an lcd screen using a string wound around a rotary encoder. Overview: This&#8230;<\/p>\n","protected":false},"author":195,"featured_media":14493,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[89],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/posts\/14460"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/users\/195"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/comments?post=14460"}],"version-history":[{"count":8,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/posts\/14460\/revisions"}],"predecessor-version":[{"id":14531,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/posts\/14460\/revisions\/14531"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/media\/14493"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/media?parent=14460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/categories?post=14460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/60-223\/f2021\/work\/wp-json\/wp\/v2\/tags?post=14460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}