Introduction
This is probably the smallest Arduino controller speically designed for controlling servos. It features a 12 standard servo control capbility with an Xbee socket which can be used in model helicopters or UAVs via the Xbee link. The feather weight (7.5g) makes it an ideal controller for application with a limited payload. The built in regulator allows the input voltage to vary from 3.5-8V which fits most power supplies without any modification.
Note: A FTDI Basic breakout is required to upload the program (@3.3V)
Warning: The controller is working under 3.3V, please do not program it with a 5V FTDI breakout, it will damage the module permanently.
Specification
CPU:Atmega328P
Working voltage:3.3V
Input voltage:3.5-8V (regulated)
12 Channel servo control
Xbee socket
Analog input: 8
SRAM:2K
EEPROM:1K
Weight:7.5 gram
Board Overview
NOTE: Pin "RX" and pin "TX" are on the left side, FTDI interface
Tutorial
Sample Code
#include <MegaServo.h>
#define NBR_SERVOS 12 // the number of servos, up to 48 for Mega, 12 for other boards
#define FIRST_SERVO_PIN 2
MegaServo Servos[NBR_SERVOS] ; // max servos is 48 for mega, 12 for other boards
int pos = 0; // variable to store the servo position
int potPin = 0; // connect a pot to this pin.
void setup()
{
for( int i =0; i < NBR_SERVOS; i++)
Servos[i].attach( FIRST_SERVO_PIN +i, 800, 2200);
}
void loop()
{
pos = analogRead(potPin); // read a value from 0 to 1023
for( int i =0; i <NBR_SERVOS; i++)
Servos[i].write( map(pos, 0,1023,0,180));
delay(15);
}
Expected Results
It can be used as a standard mini Arduino board and can control up to 12 servos.For more information, check the Arduino library.
More Documents
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.