Skip to content

Bluetooth TinyShield (OBSOLETE) Tutorial

The TinyShield Bluetooth board lets you use Bluetooth 2.1 wireless communications to your TinyDuino. This uses the Bluetooth Serial Port Profile (SPP), which is supported by most computers and smartphones (except Apple iPhones / iPads), and lets you communicate with your TinyDuino via a COM port, just like it’s connected via USB. No special software is required on your TinyDuino, all that’s needed is a standard serial connection software.

This TinyShield is based around the Microchip Roving Networks RN42 Bluetooth Module.

Learn more about the TinyDuino Platform


Technical Details

Written description of what the board does, typically links back to product page somehow.

To see what other TinyShields are compatible with this TinySheild, see the TinyShield Compatibility Matrix

Technical Details Microchip RN42 Specs
  • Fully certified Class 2 Bluetooth 2.1 + EDR module
  • Built-in Antenna
  • Bluetooth SIG qualified
  • UART (SPP or HCI) and USB (HCI only) data connection hardware interfaces
  • Onboard embedded Bluetooth stack (no host processor required)
  • Programmable low power modes
  • Secure communications, 128 bit encryption
  • Error correction for guaranteed packet delivery
  • UART local and over-the-air RF configuration
  • Auto-discovery/pairing requires no software configuration (instant cable replacement)
TinyDuino Power Requirements
  • Voltage: 3.3V - 5.5V
  • Current: 50mA (Data Transmit Mode). Due to the current, this board cannot be run using the TinyDuino coin cell option
Pins Used
  • 0 - BT_TX: The signal is the UART transmit from the Bluetooth Module to the TinyDuino
  • 1 - BT_RX: The signal is the UART receive to the Bluetooth Module from the TinyDuino
Dimensions
  • 20mm x 36mm (.787 inches x 1.417 inches)
  • Max Height (from lower bottom TinyShield Connector to upper top TinyShield Connector): 5.11mm (0.201 inches)
  • Weight: 2.9 grams (.10 ounces)

Notes

  • The Bluetooth TinyShield and the USB TinyShield share the same UART signals, therefore only one or the other can be plugged in at a particular time. The USB TinyShield and the Bluetooth TinyShield cannot be used at the same time.
  • Since the USB TinyShield cannot be used at the same time, the Bluetooth TinyShield cannot be plugged in when trying to program the TinyDuino with USB. The USB TinyShield must be unplugged after programming the TinyDuino when the Bluetooth TinyShield is used.
  • Since the USB TinyShield cannot be used at the same time, the TinyDuino needs to be powered with an external source. The coin cell option cannot be used due to power requirements; we recommend using the Lithium Battery version of the TinyDuino processor board.
  • By default, the Bluetooth TinyShield will power up at 57600 baud, so the TinyDuino processor needs to be configured at this baud rate in order for communications to work.

Materials

Hardware

Software

  • Arduino IDE
  • Include any libraries with links to download them
  • Include .ino program github link or zip file

Hardware Assembly

On top of your processor board of choice, place the Matrix LED TinyShield. Plug a MicroUSB cable into the micro USB port (or USB shield) and then plug the cable into an available USB port on your computer. Make sure the processor is switched on.

Note that when using this TinyShield, the USB TinyShield is only used for programming purposes.


Software Setup

To connect to the Bluetooth TinyShield, plug it into a TinyDuino and power the system(note, the USB TinyShield and the Bluetooth TinyShield share the same UART lines, so these cannot both be used at the same time).

On your computer, or phone, go to your Bluetooth settings and select to "Add a device".

Your computer should scan for available devices, and the TinyShield Bluetooth should appear and start with the name “TinyXXXX”, where XXXXX is the last few digits of the BT MAC Address (also shown printed on the module itself). Select to pair with this device.

If asked for a pairing code, the default code is “1234″. Newer operating systems also support creating a pairing code, if so you can use the code it provides to you.

After paired, the computer will create a COM Port for the Bluetooth device, make note of the number it provides for you. Now you can open up the COM port using different programs (like the serial terminal in the Arduino IDE, or Hyperterminal), to communicate with your TinyDuino over Bluetooth. This following example sketch will just report back the keypress that the user pushes to test out the Bluetooth connection:

Upload Program

By default, the Bluetooth TinyShield will power up at 57600 baud, so the TinyDuino processor needs to be configured at this baud rate in order for communications to work.

Note: Several Bluetooth TinyShields have accidentally been shipped with the resistor R4 included on the assembly - this will set the UART baud rate to 9600. Check to see if this is present if you are having issues, if so, you will need to set the UART baud rate of your TinyDuino processor to 9600 baud. You can also remove the resistor to return this to 57600 baud, or contact us at TinyCircuits and we can modify the unit for you.

Code
void setup()
{  
  Serial.begin(57600);
}

void loop()
{
  if (Serial.available())
  {    
     Serial.print("The character typed is: ");
     Serial.write(Serial.read());
     Serial.println("");
  }
}

Downloads


Contact Us

If you have any questions or feedback, feel free to email us or make a post on our forum. Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it.

Thanks for making with us!