Introduction: Playful Puppy Robot
No soldering is required and it is Arduino compatible for easy programming.
The kit with all parts except batteries is now being sold!
The controller comes with an ATmega8 but this is easily upgradeable if required.
The sample code provided allows the puppy to sit, shake hands, lie down, beg and walk on it's hind legs.
This robot is fully interactive and is controlled by hand gestures.
- #1 Phillips screwdriver.
- Small (2.4mm or 3/32 inch) flat head screwdriver.
- Long nose pliers
(Available around the world from online stores that sell DAGU products)
- QuadBot chassis kit.
- Pan / tilt kit.
- IR compound eye.
- Magician robot controller.
- Pack of jumper wires (male to male and female to female).
- 1x 1N5400 3A rectifier diode
- 4x small servo extension cables 100mm (4 inch).
- 2x 25mm (1 inch) brass hex spacers with suitable mounting screws.
- Small cable ties and two larger cable ties to hold the battery holder.
NOTE: The robot works best with a 7.4V 2300mAH battery as shown in the videos but it can also work with 6x NiMh AA batteries in a 3x2 battery holder. There are two variations of the sample code depending on which battery you use. The only difference is that the NiMh batteries are heavier so that the robot needs different code to balance on it's hind legs.
Step 1: Center Your Servos
The QuadBot chassis kit includes 8x miniature servos and the Pan/Tilt kit includes 2 miniature servos. These servos have clear cases so you should be able to see through them well enough to check that they are centered.
When the servo is centered it can physically turn the same amount in each direction (approximately 90 degrees). Before you begin assembly check that all 10 of your servos are centered. This will save you time in later steps. Once the robot is assembled, the center position of each servo can be refined in the software if required.
Step 2: Attach the Foam Rubber Feet
Instructions are included with the QuadBot chassis and can also be downloaded from my DAGU product support site . I will go through them in detail here.
There are 8 identical leg segments included in the kit. Select 4 of them and attach foam rubber feet using the 3 x 12mm panhead screws. There are only 4 of these screws and they are the largest so they are easy to find.
Self tapping screws have a course thread and tapered tip that can drill into soft materials like plastic and wood.
Pan head screws have an extra large head. This is the equivalent of using a seperate washer and screw. The pan head screws in this kit are also self tapping screws.
Machine screws have a fine thread and are designed to screw into machined parts where a thread is already present.
Step 3: Mount Knee Servos to Legs
Mount 4 of your servos on the leg segments with the foam rubber feet. Use 2.3 x 8mm self tapping screws.
Make sure the output shaft is away from the foot as shown in the photo.
Step 4: Mount Servo Horns on the Thigh Segments
A servo horn is a piece of plastic that fits onto the output shaft of the servo and allows you to attach control rods or other devices using self tapping screws.
Take the 4 unused leg segments and fit servo horns as shown in the photo below using 2 x 6mm self tapping screws. There are are only 8 of these. Use two for each servo horn.
Step 5: Attach Your Thigh Segment to Your Legs
Once you have mounted the servo horns on the thigh segments they can be attached to your knee servos using 4 of the 8 supplied 2 x 8mm pan head screws. With your knee servo centered the thighs should be at 90 degrees to the leg segment with the foam rubber foot.
Step 6: Left and Right Legs
So far all of your legs should look identical. Now we will seperate them into left and right legs. The only difference between a left leg and a right leg is the way in which the thigh servo is mounted.
Mount you thigh servos as shown in the photo using the 2 x 8mm self tapping screws. Note the difference in the position of the output shaft in the left leg thigh servos compared to the right leg thigh servos. They are mirror imaged.
Step 7: Attach Your Legs to the Mounting Plate
The mounting plate of the QuadBot chassis is the laser cut acrylic panel that you mount all your parts on. Mount your left and right legs as shown in the photo.
NOTE: the rounded end is the rear of your robot. The hole in the center of the rear is where you will mount your tail.
Step 8: Fit Mounting Spacers to Pan Servo.
The brass hex spacers used to mount the pan / tilt kit require a 3mm screw but the miniature servo housing has a hole designed for a 2mm screw. Previously I have tried using a 3mm drill bit but it bites into the plastic which can break the servo mounts and it can accidently dig into the servo cable.
Since the hole only needs to be opened by a small amount I found it was easier and safer to use my phillips head screwdriver to ream out the holes on each side. Do not press to hard, you only need to ream out each side of the hole by a small amount so that the 3mm screw can be inserted without too much force.
Once you have the 3mm screw in all the way, continue turning the screw a few times so that the screw thread can drill out the hole a bit more. You can now easily fit your 25mm (1 inch) brass hex spacers. Use your pliers if necessary to hold the brass spacers when tightening the screws. Do not overtighten otherwise you will crack the servo mounts.
Step 9: Attach the Pan Servo to the Pan Bracket
The pan / tilt kit comes with two large brackets. Each bracket has a different hole pattern on it to suit many different sensors. Look at the photo below and make sure you attach the correct bracket to the pan servo as the compound eye cannot be mounted if you use the wrong bracket.
The assembly instructions for the pan / tilt kit are included in the kit. They can also be downloaded from my product support site . Use 2 x 6mm pan head servos to mount the bracket to the round servo horn and another 2 x 6mm pan head to mount the servo horn onto the pan servo as shown.
Step 10: Attach the Tilt Servo Locating Bracket
The tilt servo locating bracket doesn't actually hold the tilt servo in place. It's main purpose is to prevent the tilt servo from twisting while allowing some play so the servo can self center.
This bracket is mounted using two 3 x 6mm machine thread screws and two 3mm nuts. Leave these nuts slightly loose at this stage so that the bracket can move forwards and backwards slightly. We will tighten them once the servo is aligned.
Step 11: Attach the Servo Horn to the Tilt Bracket
Use two 2 x 6mm pan head screws to attach a round servo horn to the tilt bracket. Use holes that will allow the center hole of the servo horn to align with the bracket as shown without allowing too much play if the screws come loose.
Step 12: Align the Tilt Servo
Use a 2.3 x 12mm screw to align your tilt servo. The servo will be a firm fit in the tilt servo locating bracket. Adjust the position so that the servo alignes with the pan bracket and allow room for spacer washers and a servo horn. Once everything is aligned you can tighten the 3mm screws holding the tilt servo locating bracket so that it wont move.
Step 13: Inserting the Spacer Washers
There are some spacer washers that must be inserted so that the tilt assembly can rotate smoothly. The easiest way I know to insert these spacer washers is to lie the pan / tilt assembly on it's side with the tilt bracket at about 40 degrees when the tilt servo is centered as shown in the first photo.
Stack your spacer washers neatly and insert them as best you can with your hand or long nose pliers as shown in the second photo.
Use a plastic cable tie to gently push the washers into position as shown in the third photo. Once the holes line up it's easy to insert your 2.3 x 10mm screw through the brackets and washers into the servo output shaft.
Tighten all the way being careful not to overtighten and then back off 1/4 of a turn. The tilt bracket should be able to tilt up and down fairly easily. Loosen the screw a little more if required.
Do the same on the other side with the 3 x 10mm machine screw and nylon nut on the other side.
NOTE: The nylon nut should be slightly loose so that the tilt assembly can move easily.
Step 14: Mount the Eye
The IR compound eye is a simple sensor that measures ambient light and reflected IR light from an object. The eye has seven connectors. Vcc (+5V) and Ground for power. The ENable pin turns the IR LEDs on or off and then there are 4 analog outputs for up, down, left and right.
Attach the four mounting spacers on the tilt bracket as shown in the first photo. Make sure the 3mm nuts are tight.
Connect 80mm female to female jumper wires to the eye as shown in the second photo. I've used red for Vcc (+5V), black for ground (0V), orange for the enable pin and white for the 4 analog outputs.
Because 80mm is not long enough I have then attached 80mm male to male jumper wires. This gives me 160mm female to male jumper wires as shown in the third photo.
By runing the wires under the tilt bracket and then over the tilt servo as shown I find the head can move freely in any direction without pulling on the wires.
Step 15: Mount the Head Onto the Body
Use two 3 x 10mm pan head machine screws to mount the head. Notice the holes used in the first photo. The servo is mounted slightly toone side so that the pan servo's output shaft is centered rather than the servo body. The pan servo is mounted a reasonable distance back to improve the ballance of the robot and to help protect the pan servo if the robot runs into a wall.
Step 16: Mount Your Batteries
This robot works best with a small LiPo battery (7.4V, 2300mAH) but rechargeable AA NiMh batteries are more common and easier to recharge so we will use 6x AA NiMh batteries for these instructions. Do not use alkaline batteries, the voltage is too high and they cannot put out enough current to drive the servos. This will cause your processor to continually reset. Use good quality batteries with at least 2000mAH capacity.
2 x 3 cell battery holders are fairly common and are small enough to fit between the legs of the robot. Place some tape on the ends of the wires before you starts so that they can't short out before you are ready to connect them and then install 6x fully charged batteries.
Cable tie your battery holder to the center of the mounting plate with your wires on the right hand side. Make sure all legs can move inward about 45 degrees without hitting it. Do not make the cable ties too tight ! You should be able to just slide the battery holder sideways out of the cable ties when it is time to recharge the batteries.
Step 17: Mount the Magician Robot Controller
Attach the four supplied brass spacers to the corners of the controller PCB. Now mount the board on the chassis with the power connection on the right hand side and the analog pins closest to the head as shown in the second photo.
Step 18: Wire Up the Head
Connect your pan servo to A4 and your tilt servo to A5 with the white signal wire towards the female header. The software reconfigures these pins as servo outputs.
Fit small black and red female to female jumper wires to Vcc and ground as shown in the photo. These will provide power for the infrared compound eye. Check the third photo if your not certain where to connect something or download the manual from my support site . Connect the red and black power wires from the eye.
The motor control circuitry connects to the processor via 4 jumpers. remove the jumpers on D8 and D10. Leave the jumpers on D7 and D9. This allows us to use D8 to control the IR LEDs on the eye. D10 might be used to control a small speaker or LED. The left motor control circuit is still connected and can be used to drive a small shaker motor to make the tail wag.
Connect your orange jumper wire to D8 and connect your 4 analog outputs from your eye.
A0 is up.
A1 is left.
A2 is down.
A3 is right.
Step 19: Power Configuration
The power configuration for this robot is slightly unusual.
10 miniature servos combined can draw more than 3amps when the robot is running around. This is far more than the Magician's regulator can handle. The magician board does allow you to power up to 8 servos directly from the battery but the servos are rated at 6V and the battery is 7.2V!
To solve these problems, the pan and tilt servos which are not heavily loaded are run from analog pins 4 and 5. These pins have been converted to servo outputs in the software and have power supplied by the 5V regulator (normally used for sensors). This leaves the 8 leg servos to be powered directly from the battery.
What we do here is to use diodes to drop the voltage to a safe level. Most silicon diodes have a forward voltage drop of about 0.6V regardless of the current. The Magician controller already has a 3A diode in series with the battery to protect against accidently connecting the power around the wrong way.
This diode will drop the voltage by about 0.6V. By adding a second diode in place of the jumper that selects the servo power we effectively have two 3A diodes in series with the battery that is reducing the voltage to the servos by a total of 1.2V. Our leg servos are now getting the 6V they are rated for.
The leads on a 3A diode are slightly thicker that a male header pin. bend the leads close to the body of the diode as shown and fit two small female to female jimper wires. they will be a tight fit but this is good as it ensures a good electrical connection. Fit a red wire to the anode and a black wire to the cathode.
Now remove the servo power selection jumper and fit the diode instead. Attach the red wire to VBAT and the black wire to the center pin. The servos will now receive power through this diode. If you accidentally connect the diode the wrong way around then the servos will not get power but no damage will be done.
NOTE: If you want your robot to stand on it's hind legs with NiMh batteries then you may need to leave the diode out and use the original jumper. This will give your servos 6.6V and more power. You will increase your risk of damaging the servos slightly if you do this.
Step 20: Connect the Leg Servos
Start by fitting the servo extension cables to the front leg servos. Now plug in your leg servos.
D2 - Rear left hip
D3 - Rear left knee
D4 - Front left hip
D5 - Front left knee
D6 - Front right knee
D11 - Front right hip
D12 - Rear right knee
D13 - Rear right hip
Make sure your white / orange control wire is closest to the female header.
Step 21: Connect Your Batteries.
Make sure the power switch is in the off position and then remove the tape from your black (- negative) wire. strip the wire back, twist the strands together and then bend it over before inserting into the screw terminal as shown in the photo. This will help to ensure a good connection. Now remove the tape on the red wire (+ positive) and do the same.
Step 22: Add a Tail
Perhaps the easiest way to make a tail is to use a short length of spiral wrap. If you don't have spiral wrap then you can make some by feeding a drinking straw through a pencil sharpener. The pencil sharpener will probably need a new blade as it has to be sharp.
Plug one end with some hotglue or putty. Then use a self tapping screw to mount it at the back of the chassis as shown in the second photo. If you can get hold of a small shaker motor from an old mobile phone then mount it on the tail and connect it to the left motor output. The sample code will shake the tail harder as your hand gets closer.
Step 23: Installing the Software
To install the sample code you must first have the Arduino IDE version 18 or later running on your computer. Download here .
The Magician controller uses the CP2102 interface IC. Depending on your OS you may need to install drivers. You can download the USB drivers as well as the QuadBot Puppy program from my support site .
Once you have the Arduino IDE running, you can open the program. Make sure you have the version suited to the batteries you are using so that the robot will be able to stand on it's hind legs. You will see that the code has a constants tab and an IO pins tab.
The constants tab stores values such as the center positions of servos. This makes it quick and easy to fine tune your code. The IOpins tab is like a map for your wiring. It tells you which device is connected to what pin.
Go to the tools menu and select your board type. The Magician controller is compatible with "Arduino NG or older /w ATmega8"
Now plug in your USB cable. After a few seconds your computer should detect the USB interface of the Magician controller. Go back to the tools menu and select your USB virtual serial port.
Press the reset button on the controller and upload the program.
Step 24: Controlling Your Robot
The sample code tracks your hand movements with the compound eye and responds accordingly. If you leave the robot alone for 3 seconds then it will sit down out of boredom. Once it sits down it gets lazy and will only track your hand with it's head.
If you slowly bring your hand within range and move your hand to a paw then the robot will lift that paw for you to shake hands. If you bring your hand between the paws it will lie down.
Once sitting you must excite the robot to get it to stand back on it's feet. taking your hand to one side or above the robot so it can no longer see your hand will do this.
When the robot is standing it will try and maintain a set distance from your hand. It will walk forward, move backward or turn in order to keep your hand in range. Do not move your hand too quick or it may loose sight of your hand.
If you move your hand directly over it's head while the robot is standing then it will try to jump on it's rear legs. If your hand stays in range of the eye the robot will try and walk on it's back legs to follow your hand. This trick might not work with the NiMh batteries as they are heavier than the LiPo battery used in the demo video.
Step 25: Trouble Shooting
The robot probably won't work very well at first. Each servo is a little bit different so some tweaking is required. At the start of the main loop add the line "return;". This will cause the robot to stand still indefinitely.
You can now adjust the servo center positions in the constants tab until the rear hips are at 90 degrees to the body and the front hips are slightly forward. All knees should bend inward slightly. If any of your servos are drastically out of alignment then you may need to reseat the servo horn.
Your head should look straight forward with the head looking up at about a 30 - 40 degree angle. Once your robots servos are set correctly you can remove the "return;" line from your main loop.
If the head does not track your hand then check your eye connections. If the head turns away from your hand then you may have accidently swapped your wires or mounted the eye upside down (the wires should come out at the bottom). Double check everything in steps 14 and 18. Are your servos plugged in corectly?
If the robot frequently resets then you may have a bad battery or battery connection. Check your batteries have a good charge and are making a good connection with the battery holder terminals. Are the battery terminal screws tight? Some cheap batteries may not be able to deliver enough current.
If the head does not follow at all then check your eye has power (5V) and that the orange wire is connected to D8. Double check everything in steps 14 and 18.
If the head works but the legs don't move then your diode that replaced the servo power jumper in step 19 may be around the wrong way or not plugged into the correct pins. Check step 20 to make sure you have the servos plugged in correctly with the signal wire closest to the female header.
If the robot walks funny then you may have accidently swapped hip and knee servos. The hip servo allows the leg to move forward and backward. The knee servo allows the leg to move up and down.
If the robot cannot stand on it's hind legs then check you have the correct version of the code. NiMh batteries are heavier than LiPo batteries. This affects the robots ballance. You may need to play with the code or adjust the position of your batteries a bit.
If you are Using NiMh then you will probably need to remove the voltage drop diode and re-install the voltage selection jumper for the servo power. This will run your servos at 6.6V giving them more power but there is a greater chance of the servo stripping a gear or overheating.
Step 26: Give Your Puppy Some Personality!
The Sample code is just the beginning. Experiment with it! If you make a mess of it you can always download the original code and start again.
Moods such as happy and bored are easily programmed into the robot. Use a counter to determine happiness by how much a person plays with it. When they stop playing then the counter counts down.
Boredom sets in when you don't play with it for a short while. Perhaps your robot will be naughty if it becomes too bored?