Animatronics Controller
An easy to use animatronics controller that can be programmed in the field by the end user without the use of a computer and control up to two servos.
I had a need for some means of controlling a servo or two for an animatronics project, so I decided to design a general purpose animatronics controller that could also be used for future projects. After some consideration, I came up with a short list of requirements for the project:
- Run on a range of voltages to accommodate a variety of servos and batteries
- Use common, easy to source components that will be available long into the future
- Assemblable using tools I already own
- Control at least two servos
- Have battery undervoltage protection
- Have a remote that is small enough to be concealed inside a glove or article of clothing
Design
I designed the printed circuit board in KiCAD and had the PCB fabricated by a professional board manufacturer. Due to limited access to SMD soldering equipment, I opted for a through hole design so that I could assemble it using the tools available to me at the time. Using through-hole parts also had the advantage of making it easier to select components in standard packages that were available from a few different manufacturers to ensure that this design could be produced long into the future.
Technical Overview
The controller mainboard is based on the Atmel ATTINY44 microcontroller and the firmware was written in C using avrlibc. The board is able to control up to two servos independently of each other and can store three user defined programs which can be programmed on-the-fly using the remote.
The servos I planned on using were designed to run at 5-6v, but I realized that I would want to be able to run the board on a two cell lithium battery with a voltage of 7.4v at some point in the future. Hobby servos, such as the ones I planned on using are often designed to run directly from batteries without the need for a voltage regulator. However even if the servos can be powered directly from the batteries, the microcontroller would still need a voltage regulator. I selected the LD1117V33 3.3v voltage regulator in a TO-220 package for this task since these were available from almost every online electronics distributor.
In order to shift the servo control signal voltage up to the battery voltage, a pair of single transistor inverters are used. Q1 and Q2 are NPN transistors that form the inverters. The 47 Ohm resistor placed between the transistor and connector provides some overcurrent protection in case the servo is connected backwards or the connector is shorted.
R9 and R10 form a voltage divider that is used to measure the battery voltage. This voltage divider brings the battery voltage into the measurement range of the analog to digital converter of the microcontroller.
Usage
The programs that can be created by the user on-the-fly are limited to simple sweeping motions of the servos, but this is often adequate for scale models or cosplay.
Programs are created by pressing and holding the stop button (bottom center button). Once the button has been depressed for a short period of time, the LED will begin flashing. The left and right buttons on the remote can then be used to set the starting position of the servo. Pushing the stop button again will then set that position. This process is then repeated for the end position of the servo. The last step is setting the sweep speed, which is again set using the left/right buttons and then pressing the stop button.