The Arduino BT (Bluetooth) is a microcontroller board based on the ATmega168 (datasheet) and the Bluegiga WT11 Bluetooth® module datasheet [pdf]). It has 14 digital input/output pins (of which 6 can be used as PWM outputs and one can be used to reset the WT11 module), 6 analog inputs, a 16 MHz crystal oscillator, screw terminals for power, an ICSP header, and a reset button. It contains everything needed to support the microcontroller and can be programmed wirelessly over the Bluetooth® connection. Instructions are available for getting started with the Arduino BT.
Microcontroller | ATmega168 |
Operating Voltage | 5V |
Input Voltage | 1.2-5.5 V |
Digital I/O Pins | 14 (of which 6 provide PWM output) |
Analog Input Pins | 6 |
DC Current per I/O Pin | 40 mA |
DC Current for 3.3V Pin | 50 mA |
Flash Memory | 16 KB (of which 2 KB used by bootloader) |
SRAM | 1 KB |
EEPROM | 512 bytes |
Clock Speed | 16 MHz |
Reference Design: arduino-bt-reference-design.zip
Schematic: arduino_bt06.pdf
The Arduino BT can be powered via the V+ and GND screw terminals. The board contains a DC-DC convector that allows it to be powered with as little as 1.2V, but a maximum of 5.5V. Higher voltages or reversed polarity in the power supply can damage or destroy the board.
The power pins are as follows:
The ATmega168 has 16 KB of flash memory for storing code (of which 2 KB is used for the bootloader). It has 1 KB of SRAM and 512 bytes of EEPROM (which can be read and written with the EEPROM library).
Each of the 14 digital pins on the BT can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms. In addition, some pins have specialized functions:
The BT has 6 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and some low-level code. Additionally, some pins have specialized functionality:
There are a couple of other pins on the board:
See also the mapping between Arduino pins and ATmega168 ports.
The Bluegiga WT11 module on the Arduino BT provides Bluetooth® communication with computers, phones, and other Bluetooth® devices. The WT11 communicates with the ATmega168 via serial (shared with the RX and TX pins on the board). It comes configured for 115200 baud communication. The module should be configurable and detectable by your operating system's Bluetooth® drivers, which should then provide a virtual com port for use by other applications. The Arduino software includes a serial monitor which allows simple textual data to be sent to and from the Arduino board over this Bluetooth® connection. The board can also be reprogrammed using this same wireless connection.
The WT11 is specially configured for use in the Arduino BT. Its name is set to ARDUINOBT and passcode to 12345. For details, see the complete initialization sketch below.
The Arduino BT has a number of other facilities for communicating. The ATmega168's UART TTL (5V) serial communication is available on digital pins 0 (RX) and 1 (TX) as well as being connected to the WT11 module.
A SoftwareSerial library allows for serial communication on any of the BT's digital pins.
The ATmega168 also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire library to simplify use of the I2C bus; see the documentation on the Wiring website for details. To use the SPI communication, please see the ATmega168 datasheet.
The Arduino BT can be programmed with the Arduino software (download). For details, see the reference and [tutorials]((https://docs.arduino.cc/tutorials/).
The ATmega168 on the Arduino BT comes preburned with a bootloader that allows you to upload new code to it without the use of an external hardware programmer. It communicates using the original STK500 protocol (reference, C header files).
You can also bypass the bootloader and program the ATmega168 through the ICSP (In-Circuit Serial Programming) header; see these instructions for details.
The maximum length and width of the BT are approximately 3.2 and 2.1 inches respectively. Three screw holes allow the board to be attached to a surface or case. Note that the distance between digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the other pins.
This sketch is run once on each Arduino BT v1 to initialize the Bluetooth® module before the board is shipped (you shouldn't need to run this code; it's just here for reference). For details on the commands sent to the module, see the iWrap data sheet.
1/* BT test 012* ------------------3* Massimo Banzi4*5*/6
7int LED = 13; // select the pin for the LED8int RESET = 7;9
10void setup() {11 pinMode(LED,OUTPUT); // declare the LED's pin as output12 pinMode(RESET,OUTPUT); // declare the LED's pin as output13 Serial.begin(115200); // connect to the serial port14 digitalWrite(RESET, HIGH);15 delay(10);16 digitalWrite(RESET, LOW);17 delay(2000);18 Serial.println("SET BT PAGEMODE 3 2000 1");19 Serial.println("SET BT NAME ARDUINOBT");20 Serial.println("SET BT ROLE 0 f 7d00");21 Serial.println("SET CONTROL ECHO 0");22 Serial.println("SET BT AUTH * 12345");23 Serial.println("SET CONTROL ESCAPE - 00 1");24 Serial.println("SET CONTROL BAUD 115200,8n1"); //first release 1920025}26
27void loop () {28 digitalWrite(LED, HIGH);29 delay(100);30 digitalWrite(LED, LOW);31 Serial.println("ciao");32 delay(1000);33}