Sunday, March 16, 2014

Quick Hack - Arduino with Bluetooth Low Energy

This week, the nRF 8001 module arrived from Olimex. These are available for around $14 and take just over a week to ship from Bulgaria.

In order to connect it up, I used a "bare bones" Arduino like board of my own design, that runs at 3.3V This is important, as the nRF8001 IC from Nordic Semiconductor will not withstand 5V.  The board is simply an ATmega328, a 16MHz crystal, reset circuit, a 3V3 regulator and a 6 pin header for a FTDI cable.

The nRF8001 module from Olimex is breadboard friendly, and once having soldered a couple of headers to the underside, it can be mounted in a breadboard.

In the middle is the nRF8001 IC, with the 16MHz crystal above it. To the left is the low power 32kHz crystal, and to the extreme right of the  pcb is the L-shaped pcb trace antenna.  Another 22 surface mount passive components complete the design.

The close up above shows how just 8 jumper wires are needed to connect it. The top header connects 3.3V, 0V and Reset, and the bottom header connects MOSI, MISO, SCK and two handshaking signals REQN and RDYN on digital pins 9 and 8 respectively.  These are used to synchronise the transfer of data between the ATmega328 and the nRF8001.

Once I had downloaded the latest Nordic Semiconductor nRF8001 example sketches and Library from Github, and loaded the nRF UART app from the Google store (Apple version also available), it was very quick and easy to get the example running.  Within a few minutes I was able to type ASCII characters into the phone and have them appear on the Arduino serial terminal window, and vice versa.

Other example code allows the phone to control the various ports on the Arduino remotely over the BLE link.  Once connected the nRF8001 uses only about 600uA average current, whilst the ATmega uses about 7mA!


No comments: