Sweet Pea LeoFi

From Electronic Sweet Peas
Jump to: navigation, search



The Sweet Pea LeoFi is an Arduino Leonardo compatible board with an integrated CC3000 Wifi module. The board is based on the Arduino Leonardo design but is greatly enhanced with a Wifi module, a more sturdy USB connector, enhanced PCB layout and to top it all off, a blue LED that can be used to indicate the link status.


The SweetPea LeoFi is available in our webshop at the following url.


The WiFi module we have used on this board is the popular CC3000. The CC3000 is an excellent choice for devices like the LeoFi as it implements a unique feature called Smart Config. Smart Config will allow you to configure all the network parameters from an external iOS or Android device thus freeing up the SweePea LeoFi from having to do that. The module is always shipped with the latest firmware which currently is version 1.32. This matches the host driver version found on our github.

We have developed an extensive library that will do all the communication with the CC3000 device and let you focus on your application. It has features that will help you to push sensor data up to Xively, Sen.se or pretty much any data collection service that is available. The library also contains examples on how to create a web server, a web client, how to send a mail and a lot of other examples. The library source code can be found on [1]

You can also use this board to interface any Wifi enabled devices to your PC, as a mouse or a keyboard using the built in Wifi module and the USB interface.

The board includes a chip antenna which makes it ready to run out of the box, no external cables or antennas are needed. Also notice that this board has its own USB VID/PID combination which means that it does not infringe on Arduino license terms.

New Version !

As of the 20th of October 2014 revision B will be shipping. From that date all our products will be manufactured locally in our own factory. The revision B board also have three new connectors to allow the board to easily connect to external sensors and/or expansions. These connectors are:

  1. 4 pin I2C connector with SCL, SDA, +5V and GND
  2. 4 pin serial connector with RxD, TxD, +5V and GND
  3. A one wire connector with +5V, GND and a gpio pin with 10K pull up.


The image to the right is an overview of the board.

The basic hardware is directly compatible with the standard Arduino Leonardo board. The CC3000 WiFi module is connected to the SPI bus and uses three of the available pins on the board D5 - D7. If you for some reason do not want to use the WiFi module you can disable it by keeping D5 (VBAT) low. In this case pins D6 and D7 can be used for other purposes.

For normal usage the Sweet Pea WiFi library will configure the pins for you so there is no need to do any configuration in your sketch.

You might notice on the right side of the board that it has a protruding section which is not in line with standard Arduino boards. This is where the antenna is located. This small section of the board is essential to the functionality of the board. You should keep this part of the board away from large metallic objects or other PCB's with large ground planes.

Another difference from the standard Arduino Leonardo board is that there is a 700mA 3.3V regulator. This regulator was introduced in order to supply the CC3000 WiFi module with a clean and stable 3.3V power source.

IC1 (74LS125) was introduced to handle the 5V to 3.3V level translation of the SPI bus between the ATMega and the CC3000.

As mentioned previously the LED marked "L" is blue and can be used to indicated link status and/or network activity.


Revision B boards have 10 different connectors in total. Here's a run down of them all.

  • J6 - Power Connector. A 5.5mm/2.1mm barrel connector that will accept voltages from 6.5 up to 12 volts. Remember that the center tap must be positive.
  • J8 - Micro USB Connector. A standard micro USB connector that is used to communicate with your PC
  • J1 - I2C. A 4 pin connector that allows you to hook I2C compatible peripherals to your LeoFi. This connector is also compatible with Groove I2C accessories.
  • J2 - Serial. A 4 pin connector with Serial1 signals.
  • J7 - OneWire. A 3 pin connector that allows you to connect one wire peripherals to your LeoFi.
  • ICSP - The Arduino processor (ATMega32U4 JTAG connector)
  • J3 - Arduino Power connector
  • J4 - Arduino Communication and GPIO connector
  • J5 - Arduino Analog input connector
  • JP3 - Arduino GPIO connector

The connectors J1, J2 and J7 are nonstandard Arduino connectors and are explained in more detail here.



This is a 4 pin JST 2.0mm connector that contain I2C and power signals. It is mapped as follows:

  1. GND
  2. +5V
  3. SDA
  4. SCL



This is a 4-pin JST 2.0mm connector that holds a serial port. It is mapped as follows:

  1. GND
  2. +5V
  3. TX
  4. RX



This is a 3-pin JST 2.0mm connector that holds a OneWire Channel. It is mapped as follows:

  1. +5V
  2. GND
  3. Data

The data signal is connected to a 10K pull up resistor.

The OneWire connector allows you to quickly hook our upcoming OneWire sensor products. The first product to be released is the DS18B20 OneWire sensor with a 1 meter cable and a 2.0mm JST conector on it.

Getting started with your SweetPea LeoFi

If you are running Windows you need to install the proper Sweet Pea LeoFi driver before connecting your board. Here's how:


These instructions assume that you are running Arduino 1.6.3 IDE or higher.

  • Download the Arduino.inf.zip file found in the Downloads section below.
  • Make a backup copy of the Arduino/drivers/arduino.inf file
  • Extract and copy the new Arduino.inf file to the Arduino/drivers/ directory.
  • Install the Arduino IDE board level support package, instructions are here

The system should now detect and install the correct driver for the LeoFi.


Linux already comes with drivers installed so there is no need to mess around with that, but you still need to apply the Arduino IDE board level support files.

  • Make sure all Arduino IDE instances are closed
  • Install the Arduino IDE board level support package, instructions are here

Your first contact with the SweetPea LeoFi board

When you receive your board it is already preloaded with a demonstration web server. This server is very simple and will only print out the analog channels, much like the Arduino Ethernet web server demo. Before the demo starts you need to hook it up to a computer via the USB channel and connect a terminal software to it. The serial terminal in the standard Arduino environment will do fine. When the LeoFi sees the connection it will start to connect to an open access point and start serving web pages. It will print out what IP address it receives from the DHCP server which you will then use in your browser to connect.

The result should look like the picture below.


This section contains useful files to be used with your LeofI.

Tips, Tricks and useful links

  • If you are using Linux and are having problems with connecting with the LeoFi board, try disabling the modemmanager. I had to do this on one of my Laptops in order for it to work. I am not 100% sure why but disabling the modemmanager allowed me to work with the board again.