The Adafruit CC3000 WiFi Breakout is a versatile and compact wireless networking module designed to provide Wi-Fi connectivity to microcontroller-based projects. It is based on the CC3000 module from Texas Instruments and is capable of connecting to 802.11b/g networks. This breakout is particularly useful for projects that require internet access or network connectivity, such as home automation systems, IoT devices, and remote data logging.
Pin Number | Name | Description |
---|---|---|
1 | VIN | Power supply (3.3V to 5V DC) |
2 | GND | Ground connection |
3 | SCK | SPI clock |
4 | MISO | SPI Master In Slave Out |
5 | MOSI | SPI Master Out Slave In |
6 | CS | SPI Chip Select |
7 | VBEN | Optional power control, enables module when high |
8 | IRQ | Interrupt request, active low |
#include <Adafruit_CC3000.h>
#include <ccspi.h>
#include <SPI.h>
// Define the pins for the CC3000 module
#define ADAFRUIT_CC3000_IRQ 3 // Must be an interrupt pin
#define ADAFRUIT_CC3000_VBAT 5
#define ADAFRUIT_CC3000_CS 10
// Create an instance of the Adafruit_CC3000 class
Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ,
ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIVIDER);
void setup() {
Serial.begin(115200);
Serial.println(F("Initializing the CC3000..."));
// Initialize the CC3000 (SPI clock speed must be set to 16 MHz)
if (!cc3000.begin()) {
Serial.println(F("Unable to initialize the CC3000! Check your wiring?"));
while (1);
}
// Connect to the Wi-Fi network (replace 'ssid' and 'password')
if (!cc3000.connectToAP("ssid", "password", WLAN_SEC_WPA2)) {
Serial.println(F("Failed to connect to WiFi. Please verify credentials"));
while (1);
}
Serial.println(F("Connected!"));
// ... Additional code to use the network ...
}
void loop() {
// Your main code here
}
#include
directives at the beginning include the necessary libraries for the CC3000.#define
statements set the pins used for the IRQ, VBEN, and CS connections.Adafruit_CC3000
object is initialized with the pins defined earlier.setup()
function, the CC3000 is initialized and an attempt is made to connect to a Wi-Fi network.'ssid'
and 'password'
with your actual Wi-Fi credentials.loop()
function is where you would place the code that runs continuously.Q: Can the CC3000 connect to 5 GHz Wi-Fi networks? A: No, the CC3000 only supports 2.4 GHz Wi-Fi networks.
Q: Does the CC3000 support Wi-Fi Protected Setup (WPS)? A: No, the CC3000 does not support WPS. Network credentials must be entered manually.
Q: Can I use the CC3000 with a battery? A: Yes, as long as the battery can provide a stable voltage within the 3.3V to 5V range and can supply sufficient current for operation.