Installing the Bean software for the first time?

You'll need to follow some special instructions to get started.

Let’s get to know the Bean!

The Bean has all these features Built-in:

  • Accelerometer
  • Temperature Sensor
  • Digital/Analog I/O
  • SPI (Serial Peripheral Interface)
  • I²C (Inter-Integrated Circuit)
  • Built-in Protoboard

Communicate with the Bean

The Bean provides two easy methods of communication over BLE.

A. Wireless Serial

Wireless serial is the most often used way to communicate. The native Arduino Serial Library communicates with your BLE device using a virtual serial port. When using the loader app, you can enable this serial port in OS X as /tmp/tty.LightBlue-Bean. All the nitty gritty protocol serial-BLE-serial bridging is taken care of for you in the background.

The Serial-BLE Bridge

Program the SerialLoopback Sketch

Setting Virtual Serial

Select Serial Port

Arduino Serial Monitor

B. Scratch Characteristics

We have also added 5 “Scratch” Characteristics.

These can be used to send any type of data to your devices.

Using the LightBlue application, you can easily read and write data to these characteristics.

Be sure to read through the Arduino Reference for more functions.

You can see these characteristics in the LightBlue application here.

The Arduino Bean Library

We have included an Arduino Bean Library that can be used to:

Digital I/O and I2C/SPI Buses

Here’s a diagram of the pinouts (inspired by the Teensy pinout diagrams):

  • To read the digital/analog pins, you use the regular Arduino digitalWrite/Read and analogWrite/Read functions you may already be familiar with.
  • analogWrite is actually used on PWM pins which are digital pins
  • The I2C and SPI bus libraries use the PWM pins as well.
  • Wire your own battery with pins BAT and GND as V+ and V-, respectively.
  • The Bean doesn’t have an on-board voltage regulator, so be sure to limit voltages between 3.0V and 3.6V.
  • A0 and A1 are your typical analog input pins.
  • D0-D5 offer 6 digital I/O pins.
  • A0 and A1 can also be used as digital I/O, giving you 8 digital I/O total.
  • Digital pins 0-3 can be used for PWM and “analog” outputs (analogWrite is really just a digital PWM output).
  • SPI and I2C share these same 8 pins.
  • SPI is on D2-D5, whereas I2C shares the A0 and A1 analog pins.
  • Connecting both a SPI and I2C device to your bean should still leave you with 2 digital I/Os.

  • The pins below the A0-1 and D0-5 pins are protoboard pins that are isolated from one another and the Arduino.

A Systems View of the Bean

To understand why the Bean library is used for certain features, we should take a look at a systems view of the Bean. This is all done behind the scenes to make the Bean easy to use.

Bean Systems Diagram

The LBM313 –
Low Energy Bluetooth Module

The LBM313 is the heart of BLE communications, it communicates with the BMA250, an accelerometer and temperature sensor, as well as sets the intensities of the RGB LEDs.

The LBM313 handles all BLE traffic to and from the Arduino.

The Bean is designed this way to free up the digital and SPI/I2C bus pins on the Atmega328p, so they can be used freely in your projects.

Atmega328p –
The Arduino microcontroller

The ATMega328P on the Bean is running at 8MHz.

This is bridged to the LBM313 using serial communication (UART at 57600bps).

We have constructed a serial protocol that allows the LBM313 and Atmega328p to communicate both messages from the client (OS X, iOS, etc.) to the Arduino. As well as send special commands to the LBM313 to do things like read the temperature sensor and set the LED.

We hope this guide helps you to start getting the most out of your Bean!

Still having questions? Want to collaborate with others on your project?

Our Community Forum provides a great source of project ideas and technical help.

Alexia McKenzieArduino User’s Guide