{"id":114,"date":"2025-11-01T02:41:02","date_gmt":"2025-11-01T06:41:02","guid":{"rendered":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/?p=114"},"modified":"2025-11-01T02:41:02","modified_gmt":"2025-11-01T06:41:02","slug":"fusion-robotics-assignment-kitchen-timer","status":"publish","type":"post","link":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/2025\/11\/01\/fusion-robotics-assignment-kitchen-timer\/","title":{"rendered":"Fusion Robotics Assignment\u2014 Kitchen Timer"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This assignment is the last of 3 intro assignments to Fusion, making sure we somewhat know how to make a robot that will move things. The requirements for this project aren\u2019t that complex:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Circuit Building &#8211; planning and building a circuit that allows an arduino board to interact with other components<\/li>\n\n\n\n<li>Arduino Programming &#8211; writing code that will make our device&nbsp;<strong>move<\/strong>&nbsp;something.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Now I originally had in mind to make a \u201ctrumpet\u201d robot where I could adjust the harmonic series and the valves but I realised it didn\u2019t move anything so I had to scrap it. I also cook very regularly but I mostly use my phone to set timers for things like pasta, baking, etc, which can be a little slow to take my phone out of my pocket while I\u2019m cooking and fiddle around with the app, so I thought this would be something useful to make that also happened to meet the requirements.<\/p>\n\n\n\n<div class=\"wp-block-media-text is-stacked-on-mobile\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"679\" height=\"747\" src=\"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2764.jpeg\" alt=\"\" class=\"wp-image-115 size-full\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2764.jpeg 679w, https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2764-273x300.jpeg 273w\" sizes=\"auto, (max-width: 679px) 100vw, 679px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p class=\"wp-block-paragraph\">Here\u2019s the image of what I\u2019m more or less going for. I knew a tiny bit about robotics so I knew which parts I had to use. I would use a push button to start the timer, a potentiometer to act as a dial, a piezo buzzer to act as the alarm, and a servo to display the time. I ended up asking ChatGPT to tell me where to hook everything up to, because that was something I wasn\u2019t completely sure about.<\/p>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a circuit schematic of the project. I briefly went through the parts of the circuit earlier but for ease of view the whole schematic is here. Before I click the button to start the timer, I adjust the potentiometer that will set the duration of the timer, and after that I will push the button. While the timer is ticking the servo will adjust its rotation to display the time. Once the time is over the piezo buzzer will sound for a brief moment and we can start another timer. Looking in hindsight this schematic is a little bit different from the prototype but I can\u2019t really predict that so this will have to do.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"487\" src=\"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2769-1-1024x487.jpeg\" alt=\"\" class=\"wp-image-119\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2769-1-1024x487.jpeg 1024w, https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2769-1-300x143.jpeg 300w, https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2769-1-768x365.jpeg 768w, https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2769-1-1536x730.jpeg 1536w, https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2769-1-2048x974.jpeg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Circuit Schematic<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"547\" src=\"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2768-1-1024x547.jpeg\" alt=\"\" class=\"wp-image-121\" srcset=\"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2768-1-1024x547.jpeg 1024w, https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2768-1-300x160.jpeg 300w, https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2768-1-768x410.jpeg 768w, https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-content\/uploads\/sites\/36\/2025\/10\/IMG_2768-1.jpeg 1146w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">BOM for reference<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Code Explanation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I don\u2019t have much experience with C++ so I had ChatGPT help me generate some code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;Servo.h&gt;\n\nServo timerServo;\n\nint buttonPin = 2;\nint potPin = A0;\nint piezoPin = 10;\nint servoPin = 9;\n\nbool running = false;\nunsigned long startTime = 0;\nunsigned long timerDuration = 0;\n\nvoid setup() {\n  timerServo.attach(servoPin);\n  pinMode(buttonPin, INPUT);\n  pinMode(piezoPin, OUTPUT);\n  Serial.begin(9600);\n}\n\nvoid loop() {\n  int buttonState = digitalRead(buttonPin);\n\n  \/\/ Set timer using potentiometer\n  if (!running) {\n    int potValue = analogRead(potPin);\n    timerDuration = map(potValue, 0, 1023, 1000, 30000); \/\/ 1-10m timer\n    int servoAngle = map(potValue, 0, 1023, 0, 180);\n    timerServo.write(servoAngle);\n  }\n\n  \/\/ Start timer when button is pressed\n  if (buttonState == HIGH &amp;&amp; !running) {\n    running = true;\n    startTime = millis();\n  }\n\n  \/\/ Run timer\n  if (running) {\n    unsigned long elapsed = millis() - startTime;\n\n    if (elapsed &lt; timerDuration) {\n      int angle = map(elapsed, 0, timerDuration, 180, 0);\n      timerServo.write(angle);\n    } else {\n      running = false;\n      tone(piezoPin, 1000, 1000); \/\/ Beep at end\n    }\n  }\n}  <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I later looked at the code myself just so I could understand what it was doing for my own interest but it worked fine. I\u2019ll briefly go over it here; the first section lets me control the servo and declares where all the parts are. The next part sets up the hardware and variables for the timer, and then the <strong>void loop<\/strong> part is the main loop of the code, and if the timer isn\u2019t running currently it just maps the value of the potentiometer(0-1023) to somewhere between 1-30s(adjustable but chose a smaller window for demonstration) and tells the servo to move according to the time. Once the button is pressed the the <strong>running<\/strong> variable is set to true and the timer starts. While it is running it calculated the passed time and adjusts the servo, and once the time is over <strong>running<\/strong> is set to false which lets the timer run again and the buzzer sounds an alarm telling me the timer\u2019s over. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">AI related stuff<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I decided to use ChatGPT for most of my AI work just because it was the most accessible to me. I don\u2019t think it would\u2019ve made much of a difference if I used some other AI but it\u2019s just preference. I mostly used it for the coding and figuring out the physical prototype. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Links(prototypes &amp; AI transcript)<\/h2>\n\n\n<nav class=\"is-responsive wp-block-navigation is-layout-flex wp-block-navigation-is-layout-flex\" aria-label=\"Footer menu 3\" \n\t\t data-wp-interactive=\"core\/navigation\" data-wp-context='{\"overlayOpenedBy\":{\"click\":false,\"hover\":false,\"focus\":false},\"type\":\"overlay\",\"roleAttribute\":\"\",\"ariaLabel\":\"Menu\"}'><button aria-haspopup=\"dialog\" aria-label=\"Open menu\" class=\"wp-block-navigation__responsive-container-open\" \n\t\t\t\tdata-wp-on--click=\"actions.openMenuOnClick\"\n\t\t\t\tdata-wp-on--keydown=\"actions.handleMenuKeydown\"\n\t\t\t><svg width=\"24\" height=\"24\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M4 7.5h16v1.5H4z\"><\/path><path d=\"M4 15h16v1.5H4z\"><\/path><\/svg><\/button>\n\t\t\t\t<div class=\"wp-block-navigation__responsive-container\"  id=\"modal-1\" \n\t\t\t\tdata-wp-class--has-modal-open=\"state.isMenuOpen\"\n\t\t\t\tdata-wp-class--is-menu-open=\"state.isMenuOpen\"\n\t\t\t\tdata-wp-watch=\"callbacks.initMenu\"\n\t\t\t\tdata-wp-on--keydown=\"actions.handleMenuKeydown\"\n\t\t\t\tdata-wp-on--focusout=\"actions.handleMenuFocusout\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t>\n\t\t\t\t\t<div class=\"wp-block-navigation__responsive-close\" tabindex=\"-1\">\n\t\t\t\t\t\t<div class=\"wp-block-navigation__responsive-dialog\" \n\t\t\t\tdata-wp-bind--aria-modal=\"state.ariaModal\"\n\t\t\t\tdata-wp-bind--aria-label=\"state.ariaLabel\"\n\t\t\t\tdata-wp-bind--role=\"state.roleAttribute\"\n\t\t\t>\n\t\t\t\t\t\t\t<button aria-label=\"Close menu\" class=\"wp-block-navigation__responsive-container-close\" \n\t\t\t\tdata-wp-on--click=\"actions.closeMenuOnClick\"\n\t\t\t><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" aria-hidden=\"true\" focusable=\"false\"><path d=\"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z\"><\/path><\/svg><\/button>\n\t\t\t\t\t\t\t<div class=\"wp-block-navigation__responsive-container-content\" \n\t\t\t\tdata-wp-watch=\"callbacks.focusFirstElement\"\n\t\t\t id=\"modal-1-content\">\n\t\t\t\t\t\t\t\t<ul class=\"wp-block-navigation__container is-responsive wp-block-navigation\"><li class=\"wp-block-navigation-item wp-block-navigation-link\"><a class=\"wp-block-navigation-item__content\"  href=\"https:\/\/wp.stgeorges.bc.ca\/trisonc\/fusion-personal-projectnotion-dashboard\/\"><span class=\"wp-block-navigation-item__label\">Personal Project Notion Dashboard<\/span><\/a><\/li><\/ul>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div><\/nav>","protected":false},"excerpt":{"rendered":"<p>This assignment is the last of 3 intro assignments to Fusion, making sure we somewhat know how to make a robot that will move things. The requirements for this project aren\u2019t that complex: Now I originally had in mind to make a \u201ctrumpet\u201d robot where I could adjust the harmonic series and the valves but [&hellip;]<\/p>\n","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-json\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":6,"href":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":125,"href":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-json\/wp\/v2\/posts\/114\/revisions\/125"}],"wp:attachment":[{"href":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.stgeorges.bc.ca\/trisonc\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}