clyde + adafruit cc3000 wifi shield -...

7
Clyde + Adafruit CC3000 WiFi Shield Wednesday, August 20, 2014 This article is the first in an ongoing series about connecting Clyde to other devices. We will cover several WiFi, Bluetooth and ZigBee shields. Overview Adafruit CC3000 WiFi Shield with Onboard Ceramic Antenna $39.95 USD, http://www.adafruit.com/products/1491 Adafruit’s CC3000 WiFi Shield is a simple and affordable way to add WiFi to Clyde. Wirelessly connect Clyde to the internet by following these simple instructions. Hardware What you’ll need Clyde Adafruit CC3000 WiFi shield, http://www.adafruit.com/products/1491 2x3 stackable header, like this: http://www.adafruit.com/products/85 5 male-to-female jumper cables, like this: http://www.adafruit.com/products/1954 SIGN UP SIGN UP Clyde is currently sold out, but the next improved litter is on the way! PRE-ORDER CLYDE V2 FROM $135 PRE-ORDER CLYDE V2 FROM $135 Learn more about Clyde Stay up to date. We send occasional development news, approximately once a month. No spam, and we never share your info. your email Tags: 802.11b/g, wireless, shields, wifi Categories: Connectivity Shields Related Posts: Clyde + Seeed Studio RN171 WiFi Shi... Clyde + Arduino WiFi Shield Clyde + Sparkfun WiFly Shield Clyde + Seeed Studio Bluetooth Shie... expressive devices for creatives homes Forum Press Clyde Language: English Recent Posts

Upload: others

Post on 31-Dec-2019

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Clyde + Adafruit CC3000 WiFi Shield - Fabuleangelagabereau.com/.../fabule...blog_clyde-adafruit-cc3000-wifi-shield.pdf · Clyde + Adafruit CC3000 WiFi Shield Wednesday, August 20,

Clyde + Adafruit CC3000 WiFi ShieldWednesday, August 20, 2014

This article is the first in an ongoing series about connecting Clyde to otherdevices. We will cover several WiFi, Bluetooth and ZigBee shields.

Overview

Adafruit CC3000 WiFi Shield with Onboard Ceramic Antenna$39.95 USD, http://www.adafruit.com/products/1491

Adafruit’s CC3000 WiFi Shield is a simple and affordable way to add WiFi toClyde. Wirelessly connect Clyde to the internet by following these simpleinstructions.

Hardware

What you’ll need

ClydeAdafruit CC3000 WiFi shield, http://www.adafruit.com/products/14912x3 stackable header, like this: http://www.adafruit.com/products/855 male-to-female jumper cables, like this:http://www.adafruit.com/products/1954

SIGN UPSIGN UP

Clyde is currently sold out, but the nextimproved litter is on the way!

PRE-ORDER CLYDE V2 FROM $135PRE-ORDER CLYDE V2 FROM $135

Learn more about Clyde

Stay up to date.We send occasionaldevelopment news,approximately once a month.No spam, and we never shareyour info.

your email

Tags: 802.11b/g, wireless, shields, wifiCategories: Connectivity Shields

Related Posts:Clyde + Seeed Studio RN171 WiFi Shi...Clyde + Arduino WiFi ShieldClyde + Sparkfun WiFly ShieldClyde + Seeed Studio Bluetooth Shie...

expressive devices for creatives homes Forum PressClyde Language: English Recent Posts

Page 2: Clyde + Adafruit CC3000 WiFi Shield - Fabuleangelagabereau.com/.../fabule...blog_clyde-adafruit-cc3000-wifi-shield.pdf · Clyde + Adafruit CC3000 WiFi Shield Wednesday, August 20,

Prepare Adafruit CC3000 WiFi Shield

Adafruit CC3000 WiFi Shield communicates over SPI. On Clyde the SPI arethrough ICSP headers pins. By default, the shield does not have the ICSProuted through the ICSP headers. To enable, solder across the jumpers forMOSI, SCK and MISO on the back of the shield. See how in AdafruitCC3000 user's guide.

Connect Clyde to Adafruit CC3000 WiFi Shield

Unfortunately, the shield does not fit in Clyde’s head if placed on the board’spinout. And even if it did, Clyde has a non-standard ICSP pinout placement.Clyde's ICSP header pin is further inset and rotated 180 degrees. So you'llhave to use a few jumper cables and an extra 2x3 header pin to make thenecessary connections.

First, connect the header pins between Clyde and the Adafruit shield usingthe male-to-female jumper cables. Here are the mappings.

Pin Mapping

Clyde CC3000

5v+ 5v+

GND GND

D3 D3

D4 D5

D10 D10

We have included a diagram we created with Fritzing, a free simpleelectronics documentation software, to help demonstrate the connections.Clyde is not a Fritzing part, so we use a Leonardo in its place. The Adafruitshield is also not a Fritzing part, so we use an Arduino Prototyping Shield.We have selected the Leonardo part and the Arduino Prototyping Shield partbecause they have the same layout as Clyde and Adafruit CC3000 WiFishield respectively, and can therefore demonstrate the necessaryconnections between the 2. There is one exception, this diagram does notillustrate the connections between the ICSP pins. We will show thatconnection in images.

Clyde/Leonardo + Adafruit CC3000/Arduino Prototyping ShieldBreadboard Diagram

Connect jumpers to shields digital pins 3, 5 and 10.

Page 3: Clyde + Adafruit CC3000 WiFi Shield - Fabuleangelagabereau.com/.../fabule...blog_clyde-adafruit-cc3000-wifi-shield.pdf · Clyde + Adafruit CC3000 WiFi Shield Wednesday, August 20,

Connect jumpers to +5v and GND. Connect the 2x3 header.

Connect digital pin jumpers to Clyde's digital pins 3, 4 and 10.

Connect +5v and GND jumpers to Clyde.

Page 4: Clyde + Adafruit CC3000 WiFi Shield - Fabuleangelagabereau.com/.../fabule...blog_clyde-adafruit-cc3000-wifi-shield.pdf · Clyde + Adafruit CC3000 WiFi Shield Wednesday, August 20,

Once all the jumper wires are connected we are ready to connect the ICSP.On Clyde the ICSP connector is flipped. The pinouts are printed on theboard alongside the ICSP connector. So we will have to turn the Adafruitshield 180 degrees so that the wires are crossed.

Turn the shield 180 degrees so the jumper wires are crossed.

Plug the 2x3 header pin into Clyde's ICSP pins.

Hardware setup is complete. Now you are ready to move onto the software.

Page 5: Clyde + Adafruit CC3000 WiFi Shield - Fabuleangelagabereau.com/.../fabule...blog_clyde-adafruit-cc3000-wifi-shield.pdf · Clyde + Adafruit CC3000 WiFi Shield Wednesday, August 20,

Software

Now for the code. Download the Adafruit_CC3000_Library from GitHub.Unzip Adafruit_CC3000_Library-master.zip. The folder name will beAdafruit_CC3000_Library-master, rename the folder to Adafruit_CC3000.Now move the Adafruit_CC3000 folder into your Arduino sketchbook'slibraries folder. If you need more help installing Arduino libraries, you canfind instructions here: http://arduino.cc/en/Guide/Libraries

Ping!

The Adafruit CC3000 library provides the example sketch 'buildtest'. Thisexample is a simple program that connects an Arduino, or Arduinocompatible board like Clyde, to your WiFi network and pings adafruit.com.You'll need to make a few changes to the code to get it to work with Clyde.Clyde is based on Arduino's Leonardo, and code for Leonardo often requiressome special handling. Remember that it is necessary to make the followingchanges to any of the Adafruit CC3000 library's examples in order to havethem run on Clyde.

Code Modification

To open the sketch, in Arduino IDE go to:File > Examples > Adafruit_CC3000 > buildtestLibrary examples are read-only, so save yourself a copy: File > Save As >clydebuildtest

Add a wait for serial monitor to become availableIn clydebuildtest, add while (!Serial) ; before Serial is started in the setup(), in

Page 6: Clyde + Adafruit CC3000 WiFi Shield - Fabuleangelagabereau.com/.../fabule...blog_clyde-adafruit-cc3000-wifi-shield.pdf · Clyde + Adafruit CC3000 WiFi Shield Wednesday, August 20,

TweetTweet submit

line:

Serial.begin(115200);while (!Serial) ;

Extend wifi timeoutIn the library's code, in Adafruit_CC3000.h, change timeout lengthAdafruit_CC3000.h. Use a text editor like Notepad++ (Windows) or TextMate(Mac). This file can be found in [Arduino sketchbookfolder]/libraries/Adafruit_CC3000/Adafruit_CC3000.h.

Change the static variable WLAN_CONNECT_TIMEOUT from 1000 to2000:

#define WLAN_CONNECT_TIMEOUT 20000

Change pin number to 4The Adafruit shield uses digital pin 5. Clyde uses this pin for the red value ofambient RGB LEDs. You will need to connect the Adafruit digital pin 5 toClyde digital pin 4 with jumper cables. We will also need to change this pinnumber in the code.

Change static variable ADAFRUIT_CC3000_VBAT to 4:

#define ADAFRUIT_CC3000_VBAT 4

Change the WiFi network credentials.Set the following variables for your own WiFi network:

#define WLAN_SSID "myNetwork" //cannot be longer than 32 characters!#define WLAN_PASS "myPassword"//Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2#define WLAN_SECURITY WLAN_SEC_WPA2

Now you should be able to upload the buildtest sketch to Clyde. Open theSerial Monitor and you should see the output from the buildtest. It shouldping adafruit.com. If you are having problems, take a look at AdafruitCC3000 user's guide or start a discussion on our forum.

LinksPurchase: http://www.adafruit.com/products/1491User’s Guide: https://learn.adafruit.com/adafruit-cc3000-wifiAdafruit CC3000 Library:https://github.com/adafruit/Adafruit_CC3000_Library/archive/master.zipForum post about connecting to Leonardo:http://forums.adafruit.com/viewtopic.php?f=31&t=50280

Alternative formatAdafruit also offers a breakout board with the CC3000:Adafruit CC3000 WiFi Breakout with Onboard Ceramic Antenna$34.95, http://www.adafruit.com/products/1469

Sparkfun also offers a shield and breakout board using the CC3000:CC3000 WiFi Shield$39.95, https://www.sparkfun.com/products/12071CC3000 WiFi Breakout$34.95, https://www.sparkfun.com/products/12072

33LikeLike ShareShare ShareShare

Page 7: Clyde + Adafruit CC3000 WiFi Shield - Fabuleangelagabereau.com/.../fabule...blog_clyde-adafruit-cc3000-wifi-shield.pdf · Clyde + Adafruit CC3000 WiFi Shield Wednesday, August 20,

< Prev post: #clydeinvasion contest Next post: Clyde + Seeed Studio RN17 ... >

There are no comments on this post. Add a comment

About FabuleFounded by designers, Fabule makes unique domestic deviceswith a lot of personality. We are committed to creating smartproducts that make you feel smart. You can easily open,upgrade, tinker with or repair anything we design, and make ittruly yours.

BrowseHomeBlogForumPress

Contact [email protected] use our online form

Fabule Fabrications Inc201-642 Rue de Courcelle,Montreal, Qc, Canada H4C3C5

Copyright © 2012 - 2014 Fabule Fabrications Inc. All rights reserved.