{"id":622,"date":"2026-03-16T15:33:59","date_gmt":"2026-03-16T13:33:59","guid":{"rendered":"https:\/\/www.hh3dlab.fi\/blog\/?p=622"},"modified":"2026-03-16T15:34:43","modified_gmt":"2026-03-16T13:34:43","slug":"building-a-team-fortress-2-sentry-gun","status":"publish","type":"post","link":"https:\/\/www.hh3dlab.fi\/blog\/3d-robo-lab\/building-a-team-fortress-2-sentry-gun\/","title":{"rendered":"Building a Team Fortress 2 Sentry Gun"},"content":{"rendered":"<h1>Introduction<\/h1>\n<p>I\u2019m a little artistic (autistic) nerd who aspires to express my creativity through my creations. I barely have any experience in robotics, I hate coding with a passion, but I\u2019m familiar with 3D modelling because I have been using Blender, Source Film Maker, and also Roblox Studio in the past.<\/p>\n<h1>Ideas<\/h1>\n<p>Throughout the course, I only had a single idea that I committed to turning into reality because I wasn\u2019t able to do this in my previous IoT course: a level 1 sentry gun from the hit game Team Fortress 2 that will track targets and then fire (play sounds and flash LEDs).<\/p>\n<h1>What did you need to learn<\/h1>\n<p>The goal of this project is to create a radar-like machine that will detect targets with a distance sensor and then play sounds and flash LEDs to simulate firing. For this project, I needed to learn a bit about the audio system of the ESP-32 and also how to use the distance sensor alongside a rotor.<\/p>\n<h1>The building phase<\/h1>\n<p>I started by testing the sensor and the motor. I tried making the motor work like a radar by rotating side to side, then retracting to the central position when the sensor detected something. With the help of ChatGPT for coding, a simple contraption like this could have worked perfectly. For the actual tracking, I had an idea about using the AI Thinker module to detect and track faces, then the distance sensor would be used for firing. However, this concept required me to use two different sets of code uploaded separately to two different modules, which I had zero idea about how to do. Thus, I spent weeks procrastinating and trying to make this work, only to ditch it when the deadline came close.<\/p>\n<p>During the week before the deadline, I turned to testing the audio system by using an amplifier, a loudspeaker, and an SD adapter. This time, I turned to using Claude AI because ChatGPT was just too much of a dimwit when it comes to consistent and reliable code. At first, the audio files uploaded to the SD card did play, but they stuttered throughout the whole duration. Hence, someone suggested that I should reduce the size of the files and upload them directly to the ESP-32.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"592\" height=\"404\" class=\"wp-image-623 aligncenter\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-1.png?resize=592%2C404&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-1.png?w=592&amp;ssl=1 592w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-1.png?resize=300%2C205&amp;ssl=1 300w\" sizes=\"auto, (max-width: 592px) 100vw, 592px\" \/><\/p>\n<p>I tried doing that and then immediately gave up after one hour. At home, I asked Claude to fix the code a bit, and by some miracle, it worked wonders for me. The audio was playing perfectly without any stuttering, and the quality was extremely close to the original, albeit a little subtle. After that, I connected the LEDs and the motor to my contraption to simulate the finished product. However, it only worked with the USB cable connected to the ESP-32 and not the power cable I used.<\/p>\n<p>In class, I tried a different adapter, but the capacity was still too weak, so I just ditched it and turned to using the ESP-32 to power everything (could be a fatal mistake, but if it works, it works). And then a sudden thought came crashing in like a truck, sending me to a parallel world.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-624 size-large aligncenter\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-2.jpeg?resize=640%2C480&#038;ssl=1\" alt=\"\" width=\"640\" height=\"480\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-2-scaled.jpeg?resize=1024%2C768&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-2-scaled.jpeg?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-2-scaled.jpeg?resize=768%2C576&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-2-scaled.jpeg?resize=1536%2C1152&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-2-scaled.jpeg?resize=2048%2C1536&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-2-scaled.jpeg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-2-scaled.jpeg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>I forgot that I had to work on the 3D case from this whole contraption. I intended to print a 3D model of the sentry gun, which I could find online while making the core to work, but my birdbrain just said \u201cscrew it\u201d and decided to ignore the whole thing entirely. Thus, I turned to one of my most primitive skills, papercraft making.<\/p>\n<p>I went online and found a papercraft template of the sentry gun for printing from over a decade ago, so I went with that. With hindsight, this was a better solution for a couple of reasons: I was too lazy to go to the lab and wait for hours to print a 3D case; making papercraft models takes way less time and is actually really fun; I hadn\u2019t done anything creative in a while because I was so busy with classes and also hooked on games.<\/p>\n<p>\u2026<\/p>\n<p>Well, darn it, did I just go and burn the sensor and probably some other components by foolishly plugging the amplifier\u2019s GND to the 5V rail?<\/p>\n<p>Monday finally came, so I went to class. I spent the whole day trying to get the contraption working again by replacing some parts and then assembling the remaining parts of my frame. The result was acceptable. I had to remove the piece of cloth to make the sensor work better, but overall everything else worked just fine EXCEPT for the motor. One fatal mistake I made was ditching the big motor and just going with the small one to save more space.<\/p>\n<p>Consequently, the turret only rotated ever so slightly and barely made it over 30 degrees. I also had to use a metal wire to pull the barrel down because the rear was too heavy, so the whole thing was only aiming upward. And yes, there\u2019s a secret button at the bottom that will activate Square Dance Mode when clicked.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-625 size-large\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-3.jpeg?resize=640%2C480&#038;ssl=1\" alt=\"\" width=\"640\" height=\"480\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-3-scaled.jpeg?resize=1024%2C768&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-3-scaled.jpeg?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-3-scaled.jpeg?resize=768%2C576&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-3-scaled.jpeg?resize=1536%2C1152&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-3-scaled.jpeg?resize=2048%2C1536&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-3-scaled.jpeg?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-3-scaled.jpeg?w=1920&amp;ssl=1 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-626 size-large\" src=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-4.jpeg?resize=640%2C853&#038;ssl=1\" alt=\"\" width=\"640\" height=\"853\" srcset=\"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-4-scaled.jpeg?resize=768%2C1024&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-4-scaled.jpeg?resize=225%2C300&amp;ssl=1 225w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-4-scaled.jpeg?resize=1152%2C1536&amp;ssl=1 1152w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-4-scaled.jpeg?resize=1536%2C2048&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-4-scaled.jpeg?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-622-4-scaled.jpeg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h1>The outcome<\/h1>\n<p>After this project, I learned that I should reserve more time for designing the frame and also choose the correct component. But all in all, I did learn a lot more about sensors, motors, and audio systems. I haven\u2019t had a clear goal of what to build next, but I\u2019m sure it will be silly and funky. Besides that, I still have that Kasane Teto robot in mind as my ultimate goal.<\/p>\n<p>Github link: <a href=\"https:\/\/github.com\/Tonkcode69\/Level-1-Sentry-Gun\/tree\/main\">https:\/\/github.com\/Tonkcode69\/Level-1-Sentry-Gun\/tree\/main<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction I\u2019m a little artistic (autistic) nerd who aspires to express my creativity through my creations. I barely have any experience in robotics, I hate coding with a passion, but I\u2019m familiar with 3D modelling because I have been using Blender, Source Film Maker, and also Roblox Studio in the past. Ideas Throughout the course, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,64,20,66,61],"tags":[],"class_list":["post-622","post","type-post","status-publish","format-standard","hentry","category-3d-robo-lab","category-3d-robotics-course","category-esp32","category-esp32-camera","category-gaming"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":658,"url":"https:\/\/www.hh3dlab.fi\/blog\/3d-robo-lab\/the-weatherslayeaer-project\/","url_meta":{"origin":622,"position":0},"title":"The Weatherslayeaer project","author":"Heikki Hietala, lab admin","date":"25.3.2026","format":false,"excerpt":"Introduction We are a team of three second\u2011year students from different areas of digital and technical studies, each bringing our own strengths into this 3D and Robotics course. Hey there! I\u2019m Saana, and I\u2019m currently in my second year of studying digital services. When I started the IoT course, I\u2026","rel":"","context":"In &quot;3D&quot;","block_context":{"text":"3D","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/3d\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-658-6.jpeg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-658-6.jpeg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-658-6.jpeg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2026\/03\/word-image-658-6.jpeg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":396,"url":"https:\/\/www.hh3dlab.fi\/blog\/blog\/moon-phases-matrix\/","url_meta":{"origin":622,"position":1},"title":"Moon Phases Matrix","author":"Heikki Hietala, lab admin","date":"12.12.2022","format":false,"excerpt":"by Aliisa Myllym\u00e4ki Introduction Hello, I\u2019m a second-year student at Haaga-Helia, named Aliisa. I have no previous experience with robotics, so I started this course as a blank canvas, open to learn anything and everything. I took this course to see if robotics were something I would feel drawn to,\u2026","rel":"","context":"In &quot;blog&quot;","block_context":{"text":"blog","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/blog\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/12\/image.png?fit=639%2C922&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/12\/image.png?fit=639%2C922&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/12\/image.png?fit=639%2C922&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":508,"url":"https:\/\/www.hh3dlab.fi\/blog\/innovation-course\/508\/","url_meta":{"origin":622,"position":2},"title":"The Data duelist project","author":"Heikki Hietala, lab admin","date":"19.12.2023","format":false,"excerpt":"Introduction Our group members are Jonas Lemstr\u00f6m and Aku Liski. Aku has some experience with blender and 3d printing, and both of us like gaming. Jonas has some experience with game development with Unity. Our prototype is auto-battler that uses Esp32 as platform, Waveshare 7.5 inch E-Paper as screen, few\u2026","rel":"","context":"In &quot;Innovation course&quot;","block_context":{"text":"Innovation course","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/innovation-course\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":524,"url":"https:\/\/www.hh3dlab.fi\/blog\/3d-robo-lab\/524\/","url_meta":{"origin":622,"position":3},"title":"Person counter for the 3D + Robo Lab","author":"Heikki Hietala, lab admin","date":"16.4.2024","format":false,"excerpt":"Introduction Hello! Our team consists of four students who worked together on a project for our 3D and Robotics course at Haaga-Helia. Although the four of us come from different backgrounds, we managed to combine our strengths to work together to get this project done. In our team we have\u2026","rel":"","context":"In &quot;3D&quot;","block_context":{"text":"3D","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/3d\/"},"img":{"alt_text":"First test device","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2024\/04\/upload1-225x300.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":491,"url":"https:\/\/www.hh3dlab.fi\/blog\/innovation-course\/medication-dispenser-project\/","url_meta":{"origin":622,"position":4},"title":"Medication dispenser project","author":"Heikki Hietala, lab admin","date":"1.6.2023","format":false,"excerpt":"Introduction\u00a0 I have only taken Introduction of Programming course before and basically have no background of coding, neither in 3D printing. This course is a total new experience for me to combine the 3D printing and programming together and the first time to get to know about ESP32 and Arduino.\u00a0\u2026","rel":"","context":"In &quot;Innovation course&quot;","block_context":{"text":"Innovation course","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/innovation-course\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2023\/06\/image-25.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2023\/06\/image-25.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2023\/06\/image-25.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":268,"url":"https:\/\/www.hh3dlab.fi\/blog\/madrid-2022\/team-5-introduction\/","url_meta":{"origin":622,"position":5},"title":"Team 5 &#8211; Introduction","author":"Madrid Team 5","date":"30.3.2022","format":false,"excerpt":"Hello all, this is an introduction post to Team 5 for Madrid seminar 2022. Our group of students from Haaga-Helia UAS will go to Madrid seminar to teach other students how to build an IoT device that sends GPS, temperature etc. data to the server and displays the information on\u2026","rel":"","context":"In &quot;ESP32&quot;","block_context":{"text":"ESP32","link":"https:\/\/www.hh3dlab.fi\/blog\/category\/esp32\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.hh3dlab.fi\/blog\/wp-content\/uploads\/2022\/03\/IMG_20220328_161500-2-scaled.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/posts\/622","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/comments?post=622"}],"version-history":[{"count":3,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/posts\/622\/revisions"}],"predecessor-version":[{"id":629,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/posts\/622\/revisions\/629"}],"wp:attachment":[{"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/media?parent=622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/categories?post=622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hh3dlab.fi\/blog\/wp-json\/wp\/v2\/tags?post=622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}