Afroman Teaches Intro To Servos, Builds Laser Turret

After a longish hiatus, we were pleased to see a new video from [Afroman], one of the most accessible and well-spoken teachers the internet has to offer. If you’re new to electronics, see the previous sentence and resolve to check out his excellent videos. The new one is all about servos, and it culminates in a simple build that provides a foundation for exploring robotics.

[Afroman] leaves no gear unturned in his tour de servo, which is embedded after the break. He explains the differences between open vs. closed loop motor systems, discusses the different sizes and types of servos available, and walks through the horns and pigtails of using them in projects. Finally, he puts this knowledge to use by building a laser turret based on a pan-tilt platform.

The Arduino-driven turret uses two micro servos controlled with pots to move by degrees in X/Y space. Interestingly, [Afroman] doesn’t program the board in the Arduino IDE using wiring. Instead, he uses an open-source microcontroller language/IDE called XOD that lets you code by building a smart sort of schematic from drag-and-drop components and logic nodes. Draw the connections, assign your I/O pin numbers, and XOD will compile the code and upload it directly to the board.

XOD seems like a good tool for beginners to do rapid prototyping. On the other hand, a look into the generated code reveals a whole lot of wrappers that obfuscate the bits of code that actually do stuff. There doesn’t seem to be a way to shed them, either, so once you design something in XOD, you’re kind of stuck using it to iterate. That said, the generated code is well documented, and someone who knows what they’re looking at could find, for instance, the I/O pin assigned to the blink sketch LED.

Once the novelty of the double laser cat tormentor has subsided, use the other servos in that 5-pack you bought to flip a light switch, control a knob, or play the glockenspiel.

10 thoughts on “Afroman Teaches Intro To Servos, Builds Laser Turret

  1. I think it is faster and simpler to do it in C than XOD.. I don’t know what there is about ‘visual’ languages that make some people thing they are simpler, but if you are older than 10 (or so) and want to do anything more than ‘blink’ then it’s easier to write the code…

    1. I agree!
      While visual languages are great for people with zero experience it is not really something you want to use besides exploring programming for the first time or very special cases such as programming statemachines for game AI.

    2. XOD would be a pretty fast intro for someone with no experience of microcontroller coding. Also, it looks like XOD would be great at the elementary school level.

      But you know there’s more of this coming. With bigger device memory and better compilers, there’s less of a penalty for the generated code.

  2. Just watched the video and checked out [Afroman] video’s and bought the $.99 US “Why electrolytic capacitors are actually kinda of shitty. ” I thought was worth the investment since I’m going to replace the TDS-520 capacitors finally after researching too much. I just bought some 33uF 16V tantalum’s that are 880mOhm ESR on eBay at a price I couldn’t pass up that I think are high enough ESR as I was reading too low an ESR might cause issues even though I don’t really comprehend fully why. I wanted higher voltage rating polymer tantalums, though the ESR values are so low I’m not sure if there will be issues depending on the function of the capacitor.

    This is about as detailed as I could get as to why:
    https://www.eevblog.com/forum/repair/another-tds-5xx6xx-restorerepair/
    https://www.eevblog.com/forum/repair/need-help-repair-tektronix-tds520b/

    I have to read through the schematics more and do the Ohm’s and power law calculations I’m thinking with LRC frequency calculations throughout the circuits traces. [Afroman]’s other video did answer what I was thinking from reading specifications. Interestingly, answered another question I had regarding the hacked debug cable [DrForbin] made too where I was wondering why the 100nF caps are all over the place.

    Thanks for sharing.

  3. Alright I’m not sure if anyone else knows, but Afrotechmods.com used to be a goldmine of early internet electrical shitposting. I stumbled upon it by finding his DOOM monitor mod (printed some sprites from the game and glued them inside of a CRT monitor with some LEDs, which was pretty neat for ~2004
    There were a lot of projects, but one which stuck out was using a CPU cooler and a galvanized bolt to keep a cup of Snapple cool. Or the watercooling setup which used bendy straws and tape instead of hoses.

    No archive of it exists, but I’d love to reminisce with anyone else who remembers this gem

Leave a Reply to ianCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.