DPRG Events Shoptalk

Website design and hosting by NCC

Quickie Servo Tester

October 2002, by Earl W. Bollinger

Assembled Servo Tester

Project Summary

Thanks to Jeff Koenig for getting me motivated enough to finish my little servo tester unit. I have been meaning to get this little device done for several months now. I finally did it. Jeff had demonstrated a great little PIC micro based servo tester earlier at a RPL and that did the trick.

This servo tester is based on a ATMEL AT90S2343 MCU with 8 pins. This little MCU is very nice in that it has 2k of Flash Program ROM, 128 bytes of RAM, and 128 bytes of EEPROM. That is a lot of power in a little 8 pin package. It has five I/O pins of which we are using four in this project.

I prefer using a Basic compiler such as the BACOM AVR compiler from MCS Electronics. The compiler costs about $69 for the full blown version but you can download a evaluation version that limits you to 2k bytes of program space. Guess what, the AT90s2343 just happens to have 2k of program space, very nice indeed.

Servo Tester PCB

I used one of my earlier PCB layouts using the free software as provided by ExpressPCB. I usually piggyback a number of layouts onto their Miniboard service, thus I can get a lot of tiny PCBs on one board to have ExpressPCB make for me. The PCB board layout depicted in the photos is a "general purpose board" I use for different things.

Servo Tester PCB

The secret to building a surface mount PCB and soldering the components is to use a liquid flux (such as the brand from GC Electronics, "Liquid Solder Flux" number 10-4202). This flux is sticky and helps a lot in holding the parts down and helps to position the little parts as well. The flux helps to prevent solder bridges from forming between the IC chip pins, which is its main purpose. But it also allows you to position a IC chip without the little legs falling in between the PCB pads on the board and getting stuck there. As these parts get smaller, the pads get bigger, thus the liquid flux is a big help. You don't even need a tiny soldering iron tip, a standard narrow point tip works fine.

Servo Tester PCB

Servo Tester PCB

You can use the schematic and the PCB layout software to view the board and use these as a reference in assembling the PCB should you like. I did use a Molex Micro connector and I made a adapter for it to use with my Atmel AVR-ISP programmer. You can redo the PCB layout and substitute a more regular connector plus you can substitute a DIP package IC as well. I have provided photos of the PCB layout and how I mounted it into the little carrier box.

Servo Tester PCB

Servo Tester PCB

The Atmel AT90S2343 REV F ICs or earlier had a bug in them. If during a cold start, the VCC voltage was to momentarily dip below zero volts, the MCU would mistakenly read its fuse bits and set itself to run off a external clock. This seems to be a problem if you use a AC power supply to furnish 5v for the MCU. If you are using a battery you shouldn't encounter this as a problem. In the first photo you can see where I was using a AC power supply to test the PCB and I had to temporarily hook up a external clock oscillator to get the chip to run. Actually, if you turn it on and then wait a second and turn it off, and then turn it on before the 47uf cap discharges, the MCU would work fine. You can read more info on this at Atmel in the errata sheets on the 2343 chips. Naturally I happen to have the Rev F chips.

Servo Tester PCB

The first program example is a simple LED blinker program to test the PCB to ensure that "It's Alive!" The second example is a simple program to exercise servos. If no buttons are pushed, it defaults to centering the servo. If one or the other button is pushed it moves the servo one direction or the other. If you hold the third button down and push one of the other two buttons the servo moves extra slow instead of fast.

Servo Tester PCB

Servo Tester PCB

I used a little transparent plastic box, and cut some holes for the pushbutton switches to protrude through, and a hole in the side for the on/off switch. Plus I simply used "GOOP" and glued the 4 cell battery pack to the back of the box for convenience. You can see in the photos how the PCB was put into the box.

Servo Tester PCB

Now what does a servo tester have to do with robots? One use is to test servos modified for continuous rotation, another is servos being used to pan or tilt cameras or operate things on a robot. It is very handy for testing and programming RC car ESC electronic motor speed controls too. Then my big use was for testing my new Gripper claw for my "Big Red" robot as I depict in the photos.

Now there is one I/O pin left on the tester. As a enhancement, you could use that pin to measure a potentiometer and use it to perform proportional movements of the servo. Another use would be to hook up a small serial LCD, such as from Kronos Robotics and have a real time display also. You could dispense with the third button and have both enhancements too. A simple way to measure the potentiometer is to use a simple RC circuit and discharge a capacitor and time how long the capacitor takes to charge up to the zero to one threshold on the I/O port pin. You can read how this works in the online manuals at the Parallax web site.

Just because I used a small 8 pin chip doesn't mean you have to, a Atmel AT90s2313 would work just as well. I used the little AT90s2343 as it has a internal 1mhz oscillator, thus I don't need to use a crystal oscillator when I run it from battery power and not AC.

One final note, do not use a five cell battery pack (6v), as that exceeds the maximum voltage rating for the MCU. If you want to run the servo at six volts, you will need to run a separate battery for the servo and the tester both. In this case the servo has six volts and the tester has 4.8 volts. Only the ground wire and the signal wires go from the servo tester to the servo.

Schematic Diagram

Servo Tester schematic
Click for full-sized image

Component List

  • U1 = Atmel AT90S2343 MCU
  • D1 = LED SMT 1206
  • R1 = 3.9k SMT 603
  • R2-R7 1k SMT 603
  • C1 = 0.047uf ceramic SMT 805
  • C2 = 47uf 16v electrolyte SMT 1206
  • C3 = 0.10uf ceramic SMT 805
  • J1 = Molex Micro Connector WM1735-ND (Digikey #), Molex #530-47-0610-P
  • SW1-SW3 Pushbutton PCB, normally open
  • SW4 SPDT small power switch

The Details

Copyright © 2002 Dallas Person Robotics Group
The Quickie Servo Tester code, schematic and PCB artwork are licensed under version 2 or later of the GNU GPL. This means everyone has the freedom to use this design for any purpose, to study it, to copy it, to distribute it, and to change or improve it, provided such changes are also made freely available to everyone.

Copyright © 1984 - 2014 Dallas Personal Robotics Group. All rights reserved.