Step 3: Circuit Design
The quadcopter needs to be light so we can only use a small battery. The battery must be rechargable and can provide enough current for the four motors. So a Li-poly cell is selected. Knowing the rough size I'm aiming for already, I went to Hobby King and picked out a small cell that is rated 350mAH and 20C.
Now I know I'm working with 3.7 volts. The ATmega128RFA1 is designed to be battery powered directly, but my sensors are not. I need 3.3 volts, so I need a 3.3V voltage regulator. Since the input voltage will be 3.7 volts, this regulator needs to be a low-dropout regulator.
A really basic power supply circuit is designed, inspired by example schematics from various datasheets. Higher voltage goes in, regulated voltage comes out...
Lithium batteries should not be over-discharged so battery monitoring is required. The ATmega128RFA1 has a battery monitor feature so that's taken care of already, no extra components required for battery monitoring.
I keep a bunch of MCP73831T lithium battery charging ICs around for any quick designs that require a lithium battery. They are tiny and easy to use. The battery charging circuit is designed using the examples provided in the datasheet of the MCP73831T.
The motor control circuitry is simple. The N-channel MOSFET acts as a switch (low side, which is friendlier for microcontroller controls). There are pull down resistors on the gate to prevent accidental activation, and series resistors to prevent the gate capacitance to draw too much current from the microcontroller during switching. There is a "flywheel" diode for each motor since they are inductive loads, so the diode is a fast switching Schottky diode that dissipates any stored reverse voltage during switching. The MOSFET itself has to be able to handle the amount of current required but also needs to be small, I chose one that can handle 1.15A and in SOT23 packaging.
The brains of the circuit are the two ATmega128RFA1 microcontrollers. They need a 16 MHz clock source for two main reasons: the radio transceiver requires it, MultiWii and AeroQuad code are designed for it. So there's a 16 MHz crystal for each microcontroller, and load capacitors for the crystals. I also know I need at least MOSI, MISO, SCK, and RESET signals to be connected to an AVR programmer later so I can program the microcontroller. The serial port signals are also connected so I can debug and use the computer's graphical configuration and monitoring utilities. The power pins are properly decoupled with capacitors. The radio circuitry consists of a BALUN to match the 100 ohm balanced output of the microcontroller to a unbalanced 50 ohm impedance antenna. The circuit is mainly derived from the datasheet's example circuit, and Zigduino's schematic.
The PWM pins are connected to the motor control circuits so the microcontroller can control the speed of the motors. I added some LEDs. The sensors and Wii Classic Controller all connect to an I2C bus. (in "version 1", I omitted pull-up resistors on the I2C bus, apparently the ATmega128RFA1's internal pull-up resistors didn't work, so "version 2" has these resistors added).
The sensor circuitry is also derived from their perspective datasheets, and looking at SparkFun's breakout board designs (because AeroQuad uses those breakout boards).
In "version 2", I improved the transmitter design by adding a FT232R chip, this added a USB virtual serial port, which works with the MultiWii and AeroQuad graphical utilities.