Atmel AT90USBKey

The Atmel AT90USBKey is a low-cost development board that comes pre-assembled with an 8-bit microcontroller (AT90USB1287) and on-board resources such as six I/O ports (A-F), a USB interface, a JTAG interface, a 4+1-ways joystick, 2 bi-color LEDs, a temperature sensor (C in Figure 1), serial dataflash memory, an on-board RESET Button, an on-board HWD Button to force bootloader section execution at reset, and an 8 MHz crystal system clock. For further information, please refer to the Hardware Guide which describes the board and the User Manual which describes the mircocontroller. Figure 1 shows the placement of the ports and on-board resources.

Figure 1 - Port Configurations

Each I/O port has 10 pin connections. Pin 2 is reserved for ground (#8 in Figure 2) and Pin 1 is reserved for power (#9 in Figure 2) for that port. In software, the pins are accessed through labels such as PORTD0 (Pin 10), PORTD1 (Pin 9), etc. Figure 2 shows the configuration of the pins using the labels. The port is in the same alignment as in Figure 1 above.

Figure 2 - Port Pin Connections

For this project, we used two AT90 boards: one as part of the base station and one attached to the blimp. The program code is stored on the microcontroller chip and any external devices are connected through the I/O ports. One item worth mentioning is that in order to properly use the I/O ports, any external device or component should be connected through the power and ground connections of the port unless they require a separate power supply.



The AT90 board has several reserved pins and registers for using UART, which is used in this project to print debugging or status messages on a hyper-terminal of a computer. The UART cannot, however, be directly connected to the AT90 board; an ADM233LJ chip is used to provide the connectivity.

ADM233LJ chip

As mentioned, the ADM233LJ chip allows us to connect the AT90 board to the UART and the RS-232 serial port of a computer. This chip converts the +5V input power to the ±10V required for RS-232 output levels. Figure 3 is a snapshot of the UART connections. The transmit pin (Pin 2) of the chip is connected to Port D3 of the AT90 board and the receive pin (Pin&nbsp3) is connected to Port&nbspD2. Of note is the fact that the ADM233LJ chip requires a separate +5V power supply. To this end, a LM7805 voltage regulator (top left in photo) is used to convert the varying input voltage from a 9V AC adapter into a constant regulated voltage of +5V. A capacitor is connected across the output terminals to smooth out the output voltage.


Figure 3 - UART Connection Diagram



The radio is used for two-way wireless communication between the base station and the blimp, allowing for manual control and monitoring of the blimp from the base station. The radio used is the TRW-24G (see Figure 4 below). This transceiver has a built-in antenna, operates in the frequency range of 2.4 GHz, has a maximum supply voltage of 3.6V, and incorporates a buffer that is clocked in/out at any clock speed. Once the transmit bit is set, data is transmitted at 1 Mbps.

Figure 4 - TRW-24G Radio Transceiver

Each radio chip is connected in the same way to each AT90 board. Table 2 specifies the pin connections used for this project and their corresponding connection pins on the AT90 board.

Radio AT90 Board
Vcc - Power Supply +3.3V power
GND - Common Ground 0V ground
CE - Chip Enable PORT A3
CS - Chip Select PORT A2
CLK1 - Clock 1 PORT A1
DR1 - Data Ready 1 PORT E4
Table 1 - Radio Connections


The joystick provided is the Flagstick Pro (see Figure 5 below). For this project, we use three analog inputs (or potentiometers): &nbspthe handle in the X-Y plane and the larger throttle dial on the base. The two smaller dials on the base are used to fine tune the X-Y values. We do not use the buttons on the handle of the joystick.


Figure 5 - Flagstick Pro Joystick

The joystick is connected to the AT90 board via Port F which is configured to perform analog to digital conversion. By supplying 3.3V and a ground reference to the joystick, the position (in X and Y coordinates) is determined by measuring the voltage across the "wiper"of the potentiometers. These voltages are then converted to a digital signal by the AT90USB1287. Figure 6 shows the connections between the AT90 board and the joystick.

Joystick Pin Out

Figure 6 - Joystick Connection Diagram


DC Motors

The DC motor is an analog actuator whose speed is proportional to the applied voltage. Figure 7 is a pictorial view of the style of motor used.

Figure 7 - DC Motor with attached propeller

For this project, we utilize three motors: two that control the lateral movement of the blimp (left/right) and one that controls the height of the blimp (up/down). The motors cannot be connected directly to the AT90 board because it is not capable of supplying the necessary amount of current for the motors; therefore, a separate power supply of +5V and L293D H-Bridge chips are required to supply current and varying voltage. See Figure 8 for the motor pin connections.


The L293D is a motor interface chip that basically consists of two H-Bridge MOSFET drivers. Each H-Bridge is capable of driving a single DC motor, controlling its speed using Pulse Width Modulation (PWM). In order for the L293D chip to work, the power and ground pins for both H-Bridge drivers must be connected even if only one side of the chip is being used.


The 74HC04 Inverter chip is necessary to control the direction of the motors. For example, when Port B4 is pulled high, Pin 5 corresponds to +5V and is the input to an inverter gate on the 74HC04 IC. The output from the same inverter is reflected on Pin 6, which will be 0V (the direct opposite of Pin 5). When Port B4 is pulled low, Pin 5 will be 0V and Pin 6 will be +5V. The difference in polarity causes the motor to spin in the opposite direction from when Port B4 is pulled high.

Figure 8 - Motor Connection Diagram

Port D4, D5, and D7 turn the motors on. Port B4, D1, and B7 control the speed and direction of the motors.



The MaxSonar-EZ1 sensor (Figure 9 below) is used to calculate the height of the blimp. The sensor is able to detect objects from 0 to 6.45 metres. It is connected to the AT90 board via two pin connections: the RX pin (via Port C6) and the PW pin (via Port C7). The RX pin is used to trigger a sonic pulse and the PW pin is used together with interrupts to calculate the return time of the echo pulse. For instance, when RX is held high for a minimum of 20 µs, a pulse is emitted and PW is pulled high. PW is pulled low again when an object is detected (ie. return echo received). The time difference between PW being pulled high and then low corresponds to the pulse width representation of the range.

Figure 9 - MaxSonar-EZ1


Complete System

Figure 10 is a picture of our complete project. The AT90 board on the left represents the blimp and the AT90 board on the right represents the base station.

Figure 10 - Front View of Project 1