DuckBot Clone


Ever since Jim Demello (demejOO) posted videos of his DuckBot in operation I have been obsessed with building one. The creativity, simplicity and construction techniquesmake his machine rate an A+ in my book. Jim has also expressed an interest in applying machine learning to solve the problem of getting the DckBot upright after a fall.

Mechanical Design

I do not possess Jim's imagine and built my using 3D modeling tools and a home-brew CPU board. My construction technique was to create and model the design in openscad. With it I was able to draw draw the components that need to be fabricated along with 3d models of the purchased components such as servo motors. Jim supplied basic dimensions for legs, neck, and body.

Openscad has a primitive animation mode by which the motion of the legs and neck can be observed at about 5 frames per second. This allowed me to view DuckBit under "ideal" conditions.

After the design looked good I used the openscad "projection" function to generate a 2D image of the part to be fabricated. The initial plan was to utilize a local Graphics Design shop to cut the parts on a laser cutter. It took multiple weeks to get the 2D image built to scale. I exported the image as a "svg" file and then used inkscape to print on inkjet printer. Inkscape apparently wants to use pixels and assumes something (I don't know what) about the printer resolution and paper size.

Sent design to two friends who routinely use CAD tools and they were able to measure pieces of the design and they looked good. Just not on my system. Eventually started using GIMP which at least scaled the X and Y the same. I then found the openscad scale function and scaled the design by 3.55 which converted mm to pixels on my printer.

This is a pdf DuckBot as seen in openscad.

OpenScad DuckBot

During this time I found out that the 2.25mm Polysytrene that I purchased at the local hobby store was actually ABS. I also became the owner of a power scroll saw. Instaead of laser cutting I printed the parts on a single sheet of sticky back paper and attached to top of the ABS plastic sheet. 30 minutes scroll saw,  sanding, and drilling the mounting holes produced quite reasonable parts. I will do the laser cut when the design is proven.

Electrical Design

The CPU board is a rework of a prior design modified to support 4 servos and 6 I2C ports. One logic error (connected an analog signal to a non analog I/O pin) and one layout error (pads to close) but otherwise working. Both errors have workable solutions.

In summary:

  • Microchip PIC24HJ64GP202 CPU
  • NRF24L01 radio
  • 6 I2C Ports
  • 4 GPIO Pins
  • 5 AAA batteries

This cpu has lots of hardware features making it ideal for small robots. Being a 16-bit CPU running at 40MHz it is less than 1 percent busy while controlling DuckBot.

Picture of PCB.

DuckBot PCB


Programming the servos to move the neck and legs was fairly easy. The CPU supports hardware PWM. The NRF24L01 code came intact from a prior project. I have not started on a GUI for the remote control. Right now, hitting any key on the remote console starts the motion sequence.


It can swing the neck, rotate a leg, and bend over but walking is a disaster. Falling over backwards seems to be its best behavior.

Possible Problems

  • I think my weight distribution is wrong.
  • The spacing between the legs is too wide.
  • The servos have plenty of power. Perhaps too much.
  • The feet need non slip bottoms.
  • The head needs some weight to cause the tilting action.
  • The legs are not sturdy enough.
  • The feet need to angle up. I used 5 degrees. Need more.

Current Activities

  • Add 2 accereramoters to detect falling.
  • Adding some leg and foot braces for additional support.
  • Paint the face.


I can equivalently state that Jim's DuckBot works better than mine but the DuckBot Clone War has just started.

Update 7/5/2016

Finally found a good weight distribution setup that supports both balance on one leg and forward bows. Added a  18350 3.7V LiPo battery, battery case, and DC-DC boost converter to the head area. Have yet to wire it together but hopeful.

Well that was a bust. The "quality" 3amp boost regulator from China barely supports 2 9g servo motors at the same time, 3 is a total flop. The same operations with bench supply show a power consumption of about 350mamp.   

This is a companion discussion topic for the original entry at

Wow looks great! Nice clean

Wow looks great! Nice clean design. Mine fell over backwards too until I added some magnets to the “face”.

I was thinking it would be fun to have two duckbots go at each other. Because they can get up after they fall it would be interesting to see how they track each other (ir I suppose) and interfere with each other but still get back into the action when they go down. Im not really for duck wars - but duck wrestling would be wholesome.

Inexpensive Duckbot

Now you have me thinking about how inexpensive a duckbot can be, but still easy enough for everyone to build and use.


When I get the balance under control I will publish the OpenScad 3D and 2D design files. I want to try printing the outline with laser toner and use Mr Dickel’s iron on transfer method. I don’t know if polystyrene will be stiff enough for the legs and feet or if the transfer will work with ABS.

DuckBot Clone

Just cloning the masters work. Could you publish the code for walking?

I stuck it in a blog if you

I stuck it in a blog if you didnt notice. I dont have github up and running yet and didnt want to mess up your coments with a big chunk of code. The code is rediculous but works on mine. Would be nice if someone who really knew what they were doing could code it. Just got a message that github wouldnt even install on my computer so will have to investigate that.

Good luck on your clone - I am really eagerly awaiting results.

Havent used github before

Havent used github before but here is link to code:

PS. To walk forward I just

PS. To walk forward I just put the forwardRoutine() function in a loop, you may want to comment out the readTilt() function which just checks if it has fallen and does a get back up routine.

I cant tell if you mounted

I cant tell if you mounted the 9volt (if you are using that to drive the computer) on the head but the head needs a lot of weight to work - I had the 9volt and two refridg magnets - thats what will get it to lean over and balance on one leg. Also, the reason your servos are too powerful is that they need to be slowed down as the myServo() function does; at full speed the servos will not work in many cases - it is a case of subtle transition to each balanced state.

Source Code

Thanks. I use a single bank of 5 AAA batteries to power the CPU and servos. As such, the servos have been getting around 6 Volts.

Have been experimenting with different weights on the head. Found that 90g is too little.

Took it apart to stiffen the legs, increase the angle of the feet, lower the CPU and battery pack, and hopefully shorten the distance between the legs so nothing is working.

Good work, man!I’m getting

Good work, man!

I’m getting more and more inspired to build my own. I guess we will have a DuckBots army here.

Your parts looks well produced, and your ABS seems to be ideal for it (polystyrene tends to bend with a single layer, i.e. 2mm, in my case).

DuckBot Status

I have been making some progress. It seems like two steps backwards for every one forward. I have to wonder how much time and rework Jim went thru!!!

The weight distribution is absolutely critical. My CPU board with 5 AAA batteries on the back was too heavy for the duck to tilt. Changed to 2 18350 3.7V LiPo’s mounted on the head. Works great for the tilt motion. Falls over forward when doing a front “Bow” operation. Perhaps a longer foot, placing the ankle further aft, positioning the hip and neck servos, or a combination will improve the situation.

I implemented Jim’s servo motion control rather nicely. The PIC24 PWM controller is configured with a period of about 13.2msec. I generate an interrupt at this time and adjust the servo PWM duty cycle inside the ISR. To make things a little smoother (I think), the servo updates are staggered by about 3msec. At least the power line signals look better on the bench with a scope.

I also got a order of 3mm ABS which should make the legs and neck a little stiffer.

The only thing that is working without grief is the NRF24L01 radio. Currently using single character codes to remotely control the duck. Being untethered from the start is a nice feeling. I think I will look into a wireless flash update process. Would like to hear from others that have gone this route.