Easy to build and program walking robot. Powerful 32bit microcontroller, 7 servos, touchscreen display, and 3D printed parts

Similar projects worth following
Learning to build and program robots is neither easy or cheap. TyroBot aims to change that. TyroBot is a fully functional humanoid robot built with inexpensive SG90 servos, 3D printed parts that can be printed on the smallest of beds, and a 100% open hardware controller board using the low cost ATSAMD21 32 bit processor and esp8266 WiFi module.

Interested with helping the development of TyroBot? Please fill out this six question survey ( to help me continue progress in the right direction! Plus, one lucky respondent will win a $50 3D Hubs gift card.

Project Goals

  • A robot that can walk in a straight line and not fall down
  • make accurate turns
  • Anyone can program it, from kids to Arduino users to pro C developers, maybe implement Scratch
  • If Arduino is used avoid using the IDE, either I'll make my own or write a plugin for Github Atom
  • Use a 32bit processor, the ATSAMD21G18A
  • Entire robot can be 3D printed on a 100mm^3 bed
  • Powered by a single cell lithium ion battery that is charged over micro USB
  • controlled wirelessly via WiFi on the esp8266, hopefully peer to peer compatible so no wireless network is required. Also Over the Air updates for flashing code.
  • Store multiple programs on board so you don't need to reflash every time you want the robot to do something different.
  • Use an accelerometer to make walking gaits smoother
  • Use a 2.8in TFT display for running programs without a computer
  • 7 servos for legs, arms, and head

How It Works

Read more »

  • 1 × ATSAMD21G18A 32bit MCU 256KB of flash
  • 7 × SG90 Servos
  • 1 × ESP8266 SMT MODULE
  • 1 × LIS3DHTR Accelerometer
  • 1 × AP2112K-3.3 600MA 3.3V Regulator

View all 13 components

  • TyroBot Alive

    Tyler Spadgenske12/12/2016 at 20:35 2 comments

    Before reading, please fill out this 6 question survey regarding my project to potentially win a $50 3D hubs gift card!

    Despite the clear lack of project documentation by me, progress on TyroBot is still underway albeit less due to school. Some main points on progress since Auguest:

    • TyroBot board v2 is functioning *almost* perfectly, but there are errors yet to be resolved.
    • TyroBot can walk in a straight line and turn, functionally equivalent to other 4 DOF bipeds.
    • Arm and head servos function properly, although no practical use, yet.
    • Accelerometer communication up and running, but forgot pull up resistors so board modification for v3 required.
    • SPI port working fine.
    • ESP8266 communication established, but concerns raised. I'll talk more on that later.
    • Touchscreen displays are a heap of trouble.

    With the board working and the robot moving around exquisitely, I decided to shift focus to the human user interface. In the above picture, TyroBot is aesthetically complete, but the touchscreen is yet to be operational and the electronics are seen in the background.

    One of the main goals of this project is usability. TyroBot in its name references the newbie. When complete, TyroBot will be printable on a bed of only 4"^3, and can be assembled with only a small screw driver. Other robots like this exist, but no robot will compare when it comes to software.

    One of the biggest advantages TyroBot will have to other robots is its software. TyroBot will not force the user to copy and paste code from stack overflow or be limited with an iPhone app. TyroBot will be programmed either from an IDE similar to Arduino (but better) or directly from the the display on the robot's face. My current challenge is getting the display to work.

    Instead of a static face like many robots, TyroBot's face will be a flat 2.8" touchscreen display. This will allow me or the user to change TyroBot's expression or robot settings without the need of an external computer or phone. I've convinced displays from ebay already on PCB's to work, and am in the process of designing TyroBot's rev 3 board to work with the displays out of the box. Instead of using the 40 pin ili9341 displays Adafruit uses, I will be using 18 pin variants like the ones found on the red ebay boards. If anyone has done this before, let me know, I need all the help I can get.

    1. Controller Board v0.2

      Tyler Spadgenske08/22/2016 at 12:49 0 comments

      Over the weekend I assembled the newest version of the controller board and ran some tests. The ESP8266 circuit remains unchanged from version 1, so I didn't solder in a module just in case there is something fatally wrong with another part of the circuit.

      The new regulator circuit works like a charm, the huge voltage drop found in the previous regulator is no longer present meaning longer operation times for TyroBot. The charging circuit appears to work, however I have not yet complete charged a dead battery to full capacity.

      I am still in the process of programming the ATSAMD21 and so far so good. Like I said in a previous log I don't have a Atmel ICE or J-Link debugger/programmer so I am attempting to hack the bootloader/firmware on the chip with STM's programmer, the ST-Link. Normally you would flash the chip in Atmel Studio, but the ST-Link is not compatible with the software. Instead, I have been using OpenOCD as the software and am semi-successful. I am able to communicate with the chip, but still unable to get Atmel's or Arduino's bootloader flashed. After a few hours of failed attempts I gave up and just ordered a J-Link.

      I'm pretty sure the problem is my sketchy programming setup and not the board itself. We will see in a week or two.

    2. Prototype Complete (well not quite)

      Tyler Spadgenske08/13/2016 at 22:24 3 comments

      While waiting for the v0.2 PCBs I finished 3D modeling the remaining pieces of the robot, including adding a head servo, controller board standoffs, and battery holder.

      The battery and controller board fit inside the head with plenty of room to spare. I don't have a display yet but right now getting the robot to walk around is a little more important. Once TyroBot is up and walking i'll add the display either as a separate PCB or part of the 3rd revision of the controller board.

      The controller board above can't really do anything, as only the esp8266 and the power circuit are functional. The PCBs and components should arrive around August 20th so shortly thereafter we *should* have a working robot.

      Here we have a look inside the torso. Not very much room left for wires, so they will be routed through the back and into the head.

      Now to wait for the new controller board so I can start writing TyroBot's firmware.

    3. Controller Board fixes and v0.2

      Tyler Spadgenske08/04/2016 at 01:26 2 comments

      Over the past weeks I have been working with the board mentioned in the previous log. Unfortunately it didn't work 100% correctly (as expected with my talent).

      First there was the minor problem of the VCC rail directly shorted to ground. As you can see on the right the DRC didn't notice that the back copper fill hadn't been recently done. Thanks KiCad. Luckily I didn't ruin any components and the battery was connected to a diode. I was able to fix the board by destroying the trace with a razor blade. I also cut a trace from the ATSAMD21 to the esp8266, so the ATSAMD21 is unable to reset the esp8266 automatically. This is okay for testing purposes.

      With that out of the way, I ran some basic tests.

      • The power regulator worked great, but the voltage drop is too high. After a while the board will fail to power up even though the battery is still quite full. On the next board I will use a different regulator, and maybe drop the protection diode that saved the board earlier.
      • The battery charging circuit worked as expected.
      • I was unable to connect to the ATSAMD21. This I *believe* is due to the fact I left two ground and one VCC pin disconnected with the false assumption that they were connected internally. I tried soldering wire to the pins but they were right next to each other in the middle of the chip. I accidentally broke the ground pin while trying to solder. Very frustrating.
      • I took a few days off to cool down from the above and played Pokemon Go.
      • Since the ATSAMD21 is nonoperational, I was unable to test the accelerometer. It should be fine since all I did was copy the Adafruit breakout board schematic.
      • The esp8266 booted up and worked perfectly, once I realized my FTDI breakout had the TX and RX swapped. I unintentionally swapped them twice, creating a double negative and connecting TX to TX and RX to RX.

      TyroBot Board v0.2

      I corrected all the mistakes mentioned above, including switching the 3.3v regulator to AP2112K-3.3. Doesn't provide quite as much current output but should be fine. I also replaced the two pin battery connector with a JST connector. The scematic and board render are below, and the design files are on Github, so if you see any more stupid mistakes be sure to let me know.

      While I am waiting for the new boards, I hope to get the 3D models in working order running off a ATMEGA328 so I am not wasting time waiting for parts.

    4. Controller Board Assembly

      Tyler Spadgenske07/18/2016 at 23:04 0 comments

      Received the boards in the mail today from @oshpark, and I got the components from @Digi-Key Electronics on Saturday.

      Being the lazy type I purchased a stencil and reflowed the board in my toaster oven. Everything came out great, now to flash a bootloader and get coding.

      I don't have a J-Link or a Atmel ICE so I'm going to have to get a bootloader on there with a ST-Link v2. We will see how that goes...

    5. Head, arms, design files

      Tyler Spadgenske07/11/2016 at 19:06 0 comments

      After another week of work, I finished head and arm prototypes, ordered the controller board and parts, plus started some testing.

      I made the head kinda large, plenty of room for the controller board, battery, a servo, a 2.8in SPI TFT display with touchscreen, and maybe a Raspberry Pi Zero...

      I also did some work on the arms. They are kinda boring so I will very likely change them in the future. I also decided that orange would be a good color for the robot.

      Besides from that I ordered the controller board pcbs from OSH park and parts from Digikey. While I wait looks like i'll be doing some basic testing, display research, and trying to find SG90 servos in a color other than blue or transparent orange. Oh, and I published all the design files to github.

    6. Designing the Controller Board

      Tyler Spadgenske07/05/2016 at 21:29 0 comments

      After some heavy research I chose the ATSAMD21 as the microcontroller for TyroBot. 48MHz, 38 io, 256KB of flash and 32KB of RAM should easily fulfill all the projects requirements. Below is the io that is going to be used.

      • 7 pins for the servos (all pins on the ATSAMD21 can work as PWM)
      • 1 analog in to monitor the battery
      • I2C port to communicate with the LIS3DH accelerometer.
      • I2C port for screen (may not be used if it is a SPI screen)
      • SPI port for LCD (may not be used if it is a I2C screen, TBD)
      • Serial port for communication with the esp8266
      • Maybe a SPI port for an SD card slot

      Below is a general flowchart of the electronics for #TyroBot

      Next I drew up a schematic, slightly based off of the Adafruit Huzzah board, #mini SAM and #JACK by @Michele Perla For the charging circuit I just used the recommended application in the datasheet, which I used in my generic battery charging circuit.I also did some layout and am currently checking for errors so I can purchase the parts from Digikey and send off the gerbers to oshpark. So if you see any flaws let me know. :)

    7. Rapid Prototyping

      Tyler Spadgenske06/20/2016 at 17:57 3 comments

      Over the past week I have been iterating the 3D printed mechanical parts for #TyroBot.

      Starting from the ground up, I designed TyroBot's feet. After a few different designs I finished with a foot with the servo enclosed, and much more surface area than on BoB. The servo is screwed in with the two screws that come with the servo.

      Next I spent a good deal of time perfecting the legs. I tried different sizes, hoping to get a more efficient walk cycle than that I experienced with Bob. I also wanted the servo horn to be as hidden as possible. What I ended up with is on the far left. Walking has improved but needs to be perfected.

      Finally we have TyroBot's body. I decided to go with a dome shape, just big enough to store the four servos for the arms and legs. There may also be room for a battery, but first I need to find a lipo that is more like a cube as most lithium ion batteries are too wide or long. Otherwise the battery will go in the head with the electronics. Hopefully weight isn't an issue...

      Above we have the TyroBots current form, without a head or arms. The current plan is a have a OLED or TFT display in the head for user input, but I am still contemplating different designs. Hopefully over the next week or two I'll design the controller board and get those pcbs off to @oshpark

    8. Standing on the Shoulders of Giants

      Tyler Spadgenske06/17/2016 at 17:34 0 comments

      Building a walking robot is not a trivial task, but luckily I do not have to start from scratch. For starters, the detailed project image sketch is based off of the project image for #Robotics Chat by @Radomir Dopieralski. I will also use the knowledge I gained from my 2014 Hackaday Prize Entry #ANDY: A Multi-Purpose "Humanoid" Robot

      After browsing the internet for quite some time, I came to the conclusion that either you had to pay thousands of dollars to get a advanced humanoid robot (almost always using proprietary technology) or hack together your own. There are a few options in between, but still two expensive with too little support for my liking.

      Of course I had to start out by building my own BOB the biped (the image on the left). I 3D printed out the files in white PLA on my Lulzbot Mini and assembled him with machine screws and SG90 servos purchased off of ebay. since pretty much all the code for BOB is based off Arduino, I used a Adafruit Pro Trinket 5V Hackaday Edition as the MCU.

      I flashed the first BOB arduino sketch I could find, and lets just say things didn't go smoothly. First, the servos tried moving to a position that didn't exist, and then the robot made jerky movements before tipping over. I played with the code for an hour or two before finally giving up and looking for more code to try. Next I some code that used some heavy duty mathematics to figure out how BOB should position his steps. This code partially worked, but the robot would still tip over every 2 or three steps, or stall the servos. When the robot did take the steps successfully, it was not in a straight line at all. After modifying the foot size writing my own code from scratch, I finally got decent results.

      After some more research I discovered the Zowi project from BQ Labs. Their code is heavily optimized for their Arduino derivative with Futaba 3003 servos. This is proof that you can get great results with just a 4 DOF biped, so that is what I am going to start out with on TyroBot.

      Although Zowi has the walking part down, the project mainly relies on the app limiting its practical use.


      In conclusion, TyroBot will work just fine with just four degrees of freedom. It will just require a sturdy structure (which BOB lacks) a good codebase (like Zowi) and a Accelerometer to help TyroBot make accurate steps. I included a list of project goals in the project description.

    View all 9 project logs

    Enjoy this project?



    Albert van Dalen wrote 02/11/2017 at 10:03 point

    I have made some libraries for the SAMD21, see my website, that may help you.

    SAMD21 Timer library for the SAM15x15 and Arduino Zero

    Fast PWM-DAC library for the SAM15x15 and Arduino Zero

    Fast analogRead / 10-bit ADC for the Arduino Uno and Zero

      Are you sure? yes | no

    oshpark wrote 08/23/2016 at 17:47 point

    Awesome project!  We're looking forward to your further updates

      Are you sure? yes | no

    Camilo Parra Palacio wrote 06/21/2016 at 02:50 point

    Hi Tyler

    We have similar approach with Otto we also want a way of programming more simple, good idea with the accelerometer!

      Are you sure? yes | no

    Radomir Dopieralski wrote 06/17/2016 at 21:55 point

    Have you considered using ESP8266 with Micropython on it? That should be pretty easy to program and friendly to newcomers.

    Also, I'm not entirely sure how the accelerometer will help with accurate steps? Do you have a plan for that? I would love to hear more.

      Are you sure? yes | no

    Tyler Spadgenske wrote 06/17/2016 at 22:16 point

    I am currently deciding what the controller board will do/what features it should have. The esp8266 is definitely a viable option, haven't tried MicroPython yet but there is a Huzzah board waiting for it.

    For the accelerometer my plan (as of now) is to have it "confirm" the robots steps. The robot will walk based on prewritten code cycles, and the accelerometer will confirm the robot has shifted its weight. If the step fails, the accelerometer will know the bot is out of cycle and make sure the robot adjusts accordingly. Sounds good in theory, but we will see...

      Are you sure? yes | no

    Similar Projects

    Does this project spark your interest?

    Become a member to follow this project and never miss any updates